Package se.digg.dgc.service
Interface DGCDecoder
-
- All Known Subinterfaces:
DGCBarcodeDecoder
- All Known Implementing Classes:
DefaultDGCBarcodeDecoder,DefaultDGCDecoder
public interface DGCDecoderService for decoding a Digital Covid Certificate from its image representation into the actual DCC payload.- 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 DigitalCovidCertificatedecode(String base45)Given the base45-encoding of a signed DCC the method verifies and decodes it into the DCC payload representation.DigitalCovidCertificatedecodeRaw(byte[] cwt)Verifies a "raw" DCC (i.e., a signed CWT holding the DCC payload) and decodes it to the actual DCC payload.byte[]decodeRawToBytes(byte[] cwt)Verifies a "raw" DCC (i.e., a signed CWT holding the DCC payload) and returns the CBOR encoding of the DCC payload.byte[]decodeToBytes(String base45)Given the base45-encoding of a signed DCC the method verifies and decodes it into the CBOR encoding of the DCC payload.
-
-
-
Method Detail
-
decode
DigitalCovidCertificate decode(String base45) throws DGCSchemaException, SignatureException, CertificateExpiredException, IOException
Given the base45-encoding of a signed DCC the method verifies and decodes it into the DCC payload representation.- Parameters:
base45- the base45-encoding of the signed DCC (including the HCERT header)- Returns:
- the DCC payload
- Throws:
DGCSchemaException- for DCC schema errorsSignatureException- for signature verification errorsCertificateExpiredException- if the DCC has expiredIOException- for errors decoding data, for example CBOR related errors- See Also:
#decodeBarcodeToBytes(byte[])
-
decodeToBytes
byte[] decodeToBytes(String base45) throws SignatureException, CertificateExpiredException, IOException
Given the base45-encoding of a signed DCC the method verifies and decodes it into the CBOR encoding of the DCC payload.- Parameters:
base45- the base45-encoding of the signed DCC (including the HCERT header)- Returns:
- the CBOR encoding of the DCC payload
- Throws:
SignatureException- for signature verification errorsCertificateExpiredException- if the DCC has expiredIOException- for errors decoding data, for example CBOR related errors- See Also:
#decodeBarcode(byte[])
-
decodeRaw
DigitalCovidCertificate decodeRaw(byte[] cwt) throws DGCSchemaException, SignatureException, CertificateExpiredException, IOException
Verifies a "raw" DCC (i.e., a signed CWT holding the DCC payload) and decodes it to the actual DCC payload.- Parameters:
cwt- the signed CWT holding the DCC- Returns:
- the DCC payload
- Throws:
DGCSchemaException- for DCC schema errorsSignatureException- for signature verification errorsCertificateExpiredException- if the DCC has expiredIOException- for errors decoding data, for example CBOR related errors- See Also:
decodeRawToBytes(byte[])
-
decodeRawToBytes
byte[] decodeRawToBytes(byte[] cwt) throws SignatureException, CertificateExpiredException, IOExceptionVerifies a "raw" DCC (i.e., a signed CWT holding the DCC payload) and returns the CBOR encoding of the DCC payload.- Parameters:
cwt- the signed CWT holding the DCC- Returns:
- the CBOR encoded DCC payload
- Throws:
SignatureException- for signature verification errorsCertificateExpiredException- if the DCC has expiredIOException- for errors decoding data, for example CBOR related errors- See Also:
decodeRaw(byte[])
-
-