Package se.digg.dgc.service
Interface DGCBarcodeEncoder
-
- All Superinterfaces:
DGCEncoder
- All Known Implementing Classes:
DefaultDGCBarcodeEncoder
public interface DGCBarcodeEncoder extends DGCEncoder
An extension to theDGCEncoder
interface that defines methods for encoding to a barcode representation.- 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 Barcode
encodeToBarcode(byte[] dcc, Instant expiration)
Based on the CBOR encoded DCC payload and a expiration time, the method signs it, deflates it, Base45 encodes it, and finally delivers it as a barcode.Barcode
encodeToBarcode(DigitalCovidCertificate dcc, Instant expiration)
Based on the DCC payload and a expiration time, the method encodes the payload to CBOR, signs it, deflates it, Base45 encodes it, and finally delivers it as a barcode.-
Methods inherited from interface se.digg.dgc.service.DGCEncoder
encode, encode, sign, sign
-
-
-
-
Method Detail
-
encodeToBarcode
Barcode encodeToBarcode(DigitalCovidCertificate dcc, Instant expiration) throws DGCSchemaException, IOException, SignatureException, BarcodeException
Based on the DCC payload and a expiration time, the method encodes the payload to CBOR, signs it, deflates it, Base45 encodes it, and finally delivers it as a barcode.- Parameters:
dcc
- the contents of the DCCexpiration
- the expiration of the DCC- Returns:
- a barcode containing the signed DCC
- Throws:
DGCSchemaException
- for DCC schema errorsIOException
- for errors encoding data, for example CBOR related errorsSignatureException
- errors concerning signing the DCCBarcodeException
- errors creating the barcode
-
encodeToBarcode
Barcode encodeToBarcode(byte[] dcc, Instant expiration) throws IOException, SignatureException, BarcodeException
Based on the CBOR encoded DCC payload and a expiration time, the method signs it, deflates it, Base45 encodes it, and finally delivers it as a barcode.- Parameters:
dcc
- the contents of the DCC in its CBOR encodingexpiration
- the expiration of the DCC- Returns:
- a barcode containing the signed DCC
- Throws:
IOException
- for errors encoding data, for example CBOR related errorsSignatureException
- errors concerning signing the DCCBarcodeException
- errors creating the barcode
-
-