Package se.digg.dgc.service
Interface DGCBarcodeDecoder
-
- All Superinterfaces:
DGCDecoder
- All Known Implementing Classes:
DefaultDGCBarcodeDecoder
public interface DGCBarcodeDecoder extends DGCDecoder
An extension to theDGCDecoder
interface that defines methods for decoding from a barcode image.- Author:
- Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DigitalGreenCertificate
decodeBarcode(byte[] image)
Given a barcode image the method verifies amd decodes the contents into its DGC payload representation.byte[]
decodeBarcodeToBytes(byte[] image)
Given a barcode image the method verifies and decodes the contents into the CBOR encoding of the DGC payload.-
Methods inherited from interface se.digg.dgc.service.DGCDecoder
decode, decodeRaw, decodeRawToBytes, decodeToBytes
-
-
-
-
Method Detail
-
decodeBarcode
DigitalGreenCertificate decodeBarcode(byte[] image) throws DGCSchemaException, SignatureException, CertificateExpiredException, BarcodeException, IOException
Given a barcode image the method verifies amd decodes the contents into its DGC payload representation.- Parameters:
image
- the barcode image holding the encoded and signed DGC- Returns:
- the DGC payload
- Throws:
DGCSchemaException
- for DGC schema errorsSignatureException
- for signature verification errorsCertificateExpiredException
- if the DGC has expiredBarcodeException
- for errors reading the barcodeIOException
- for errors decoding data, for example CBOR related errors- See Also:
decodeBarcodeToBytes(byte[])
-
decodeBarcodeToBytes
byte[] decodeBarcodeToBytes(byte[] image) throws SignatureException, CertificateExpiredException, BarcodeException, IOException
Given a barcode image the method verifies and decodes the contents into the CBOR encoding of the DGC payload.- Parameters:
image
- the barcode image holding the encoded and signed DGC- Returns:
- the DGC payload in its CBOR representation
- Throws:
SignatureException
- for signature verification errorsCertificateExpiredException
- if the DGC has expiredBarcodeException
- for errors reading the barcodeIOException
- for errors decoding data, for example CBOR related errors- See Also:
decodeBarcode(byte[])
-
-