Class DefaultDGCSignatureVerifier

  • All Implemented Interfaces:
    DGCSignatureVerifier

    public class DefaultDGCSignatureVerifier
    extends Object
    implements DGCSignatureVerifier
    Implementation of the DGCSignatureVerifier interface.
    Author:
    Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
    • Constructor Detail

      • DefaultDGCSignatureVerifier

        public DefaultDGCSignatureVerifier()
    • 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 interface DGCSignatureVerifier
        Parameters:
        signedCwt - the signed CWT holding the DCC
        certificateProvider - 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 errors
        CertificateExpiredException - if the DCC has expired
      • setTestValidationTime

        public void setTestValidationTime​(Instant testValidationTime)
        For test only: Simulates the current validation time.
        Parameters:
        testValidationTime - simulated "now"