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[] dgc, Instant expiration)
Based on the CBOR encoded DGC payload and a expiration time, the method signs it, deflates it, Base45 encodes it, and finally delivers it as a barcode.Barcode
encodeToBarcode(DigitalGreenCertificate dgc, Instant expiration)
Based on the DGC 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(DigitalGreenCertificate dgc, Instant expiration) throws DGCSchemaException, IOException, SignatureException, BarcodeException
Based on the DGC 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:
dgc
- the contents of the DGCexpiration
- the expiration of the DGC- Returns:
- a barcode containing the signed DGC
- Throws:
DGCSchemaException
- for DGC schema errorsIOException
- for errors encoding data, for example CBOR related errorsSignatureException
- errors concerning signing the DGCBarcodeException
- errors creating the barcode
-
encodeToBarcode
Barcode encodeToBarcode(byte[] dgc, Instant expiration) throws IOException, SignatureException, BarcodeException
Based on the CBOR encoded DGC payload and a expiration time, the method signs it, deflates it, Base45 encodes it, and finally delivers it as a barcode.- Parameters:
dgc
- the contents of the DGC in its CBOR encodingexpiration
- the expiration of the DGC- Returns:
- a barcode containing the signed DGC
- Throws:
IOException
- for errors encoding data, for example CBOR related errorsSignatureException
- errors concerning signing the DGCBarcodeException
- errors creating the barcode
-
-