Package se.digg.dgc.signatures.impl
Class DefaultDGCSignatureVerifier
- java.lang.Object
-
- se.digg.dgc.signatures.impl.DefaultDGCSignatureVerifier
-
- All Implemented Interfaces:
DGCSignatureVerifier
public class DefaultDGCSignatureVerifier extends Object implements DGCSignatureVerifier
Implementation of theDGCSignatureVerifier
interface.- Author:
- Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface se.digg.dgc.signatures.DGCSignatureVerifier
DGCSignatureVerifier.Result
-
-
Constructor Summary
Constructors Constructor Description DefaultDGCSignatureVerifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setTestValidationTime(Instant testValidationTime)
For test only: Simulates the current validation time.DGCSignatureVerifier.Result
verify(byte[] signedCwt, CertificateProvider certificateProvider)
Verifies the signature and validity of the supplied signed DCC.
-
-
-
Method Detail
-
verify
public DGCSignatureVerifier.Result verify(byte[] signedCwt, CertificateProvider certificateProvider) throws SignatureException, CertificateExpiredException
Verifies the signature and validity of the supplied signed DCC.Note: This method only checks the signature and the validity of the DCC. Any other checks must be done after this method has completed successfully.
- Specified by:
verify
in interfaceDGCSignatureVerifier
- Parameters:
signedCwt
- the signed CWT holding the DCCcertificateProvider
- the provider that is used to find the certificate(s) to use when validating the signature- Returns:
- if signature verification a Result object containing the DCC payload along with its metadata is returned
- Throws:
SignatureException
- for signature validation errorsCertificateExpiredException
- if the DCC has expired
-
setTestValidationTime
public void setTestValidationTime(Instant testValidationTime)
For test only: Simulates the current validation time.- Parameters:
testValidationTime
- simulated "now"
-
-