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