Class ECDSAVerifier

    • Constructor Detail

      • ECDSAVerifier

        public ECDSAVerifier​(ECPublicKey publicKey)
                      throws JOSEException
        Creates a new Elliptic Curve Digital Signature Algorithm (ECDSA) verifier.
        Parameters:
        publicKey - The public EC key. Must not be null.
        Throws:
        JOSEException - If the elliptic curve of key is not supported.
      • ECDSAVerifier

        public ECDSAVerifier​(ECKey ecJWK)
                      throws JOSEException
        Creates a new Elliptic Curve Digital Signature Algorithm (ECDSA) verifier.
        Parameters:
        ecJWK - The EC JSON Web Key (JWK). Must not be null.
        Throws:
        JOSEException - If the elliptic curve of key is not supported.
      • ECDSAVerifier

        public ECDSAVerifier​(ECPublicKey publicKey,
                             Set<String> defCritHeaders)
                      throws JOSEException
        Creates a new Elliptic Curve Digital Signature Algorithm (ECDSA) verifier.
        Parameters:
        publicKey - The public EC key. Must not be null.
        defCritHeaders - The names of the critical header parameters that are deferred to the application for processing, empty set or null if none.
        Throws:
        JOSEException - If the elliptic curve of key is not supported.
    • Method Detail

      • verify

        public boolean verify​(JWSHeader header,
                              byte[] signedContent,
                              Base64URL signature)
                       throws JOSEException
        Description copied from interface: JWSVerifier
        Verifies the specified signature of a JWS object.
        Specified by:
        verify in interface JWSVerifier
        Parameters:
        header - The JSON Web Signature (JWS) header. Must specify a supported JWS algorithm and must not be null.
        signedContent - The signing input. Must not be null.
        signature - The signature part of the JWS object. Must not be null.
        Returns:
        true if the signature was successfully verified, false if the signature is invalid or if a critical header is neither supported nor marked for deferral to the application.
        Throws:
        JOSEException - If the JWS algorithm is not supported, or if signature verification failed for some other internal reason.