001package com.nimbusds.jose.proc;
002
003
004import java.security.Key;
005
006import com.nimbusds.jose.JOSEException;
007import com.nimbusds.jose.JWSHeader;
008import com.nimbusds.jose.JWSProvider;
009import com.nimbusds.jose.JWSVerifier;
010
011
012/**
013 * JSON Web Signature (JWS) verifier factory.
014 *
015 * @author Vladimir Dzhuvinov
016 * @version 2015-11-16
017 */
018public interface JWSVerifierFactory extends JWSProvider {
019
020
021        /**
022         * Creates a new JWS verifier for the specified header and key.
023         *
024         * @param header The JWS header. Not {@code null}.
025         * @param key    The key intended to verify the JWS message. Not
026         *               {@code null}.
027         *
028         * @return The JWS verifier.
029         *
030         * @throws JOSEException If the JWS algorithm is not supported or the
031         *                       key type or length doesn't match the expected
032         *                       for the JWS algorithm.
033         */
034        JWSVerifier createJWSVerifier(final JWSHeader header, final Key key)
035                throws JOSEException;
036}