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 DigitalCovidCertificate
decodeBarcode(byte[] image)
Given a barcode image the method verifies amd decodes the contents into its DCC payload representation.byte[]
decodeBarcodeToBytes(byte[] image)
Given a barcode image the method verifies and decodes the contents into the CBOR encoding of the DCC payload.-
Methods inherited from interface se.digg.dgc.service.DGCDecoder
decode, decodeRaw, decodeRawToBytes, decodeToBytes
-
-
-
-
Method Detail
-
decodeBarcode
DigitalCovidCertificate decodeBarcode(byte[] image) throws DGCSchemaException, SignatureException, CertificateExpiredException, BarcodeException, IOException
Given a barcode image the method verifies amd decodes the contents into its DCC payload representation.- Parameters:
image
- the barcode image holding the encoded and signed DCC- Returns:
- the DCC payload
- Throws:
DGCSchemaException
- for DCC schema errorsSignatureException
- for signature verification errorsCertificateExpiredException
- if the DCC 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 DCC payload.- Parameters:
image
- the barcode image holding the encoded and signed DCC- Returns:
- the DCC payload in its CBOR representation
- Throws:
SignatureException
- for signature verification errorsCertificateExpiredException
- if the DCC has expiredBarcodeException
- for errors reading the barcodeIOException
- for errors decoding data, for example CBOR related errors- See Also:
decodeBarcode(byte[])
-
-