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.JWSVerifier; 009 010 011/** 012 * JSON Web Signature (JWS) verifier factory. 013 * 014 * @author Vladimir Dzhuvinov 015 * @version 2015-06-08 016 */ 017public interface JWSVerifierFactory { 018 019 020 /** 021 * Creates a new JWS verifier for the specified header and key. 022 * 023 * @param header The JWS header. Not {@code null}. 024 * @param key The key intended to verify the JWS message. Not 025 * {@code null}. 026 * 027 * @return The JWS verifier. 028 * 029 * @throws JOSEException If the JWS algorithm is not supported or the 030 * key type or length doesn't match the expected 031 * for the JWS algorithm. 032 */ 033 JWSVerifier createJWSVerifier(final JWSHeader header, final Key key) 034 throws JOSEException; 035}