Class DefaultJWSVerifierFactory
- java.lang.Object
-
- com.nimbusds.jose.crypto.factories.DefaultJWSVerifierFactory
-
- All Implemented Interfaces:
JCAAware<JCAContext>,JOSEProvider,JWSProvider,JWSVerifierFactory
@ThreadSafe public class DefaultJWSVerifierFactory extends Object implements JWSVerifierFactory
Default JSON Web Signature (JWS) verifier factory.Supports all standard JWS algorithms implemented in the
com.nimbusds.jose.cryptopackage.- Version:
- 2020-10-30
- Author:
- Vladimir Dzhuvinov
-
-
Field Summary
Fields Modifier and Type Field Description static Set<JWSAlgorithm>SUPPORTED_ALGORITHMSThe supported JWS algorithms.
-
Constructor Summary
Constructors Constructor Description DefaultJWSVerifierFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JWSVerifiercreateJWSVerifier(JWSHeader header, Key key)Creates a new JWS verifier for the specified header and key.JCAContextgetJCAContext()Returns the Java Cryptography Architecture (JCA) context.Set<JWSAlgorithm>supportedJWSAlgorithms()Returns the names of the supported algorithms by the JWS provider instance.
-
-
-
Field Detail
-
SUPPORTED_ALGORITHMS
public static final Set<JWSAlgorithm> SUPPORTED_ALGORITHMS
The supported JWS algorithms.
-
-
Constructor Detail
-
DefaultJWSVerifierFactory
public DefaultJWSVerifierFactory()
-
-
Method Detail
-
supportedJWSAlgorithms
public Set<JWSAlgorithm> supportedJWSAlgorithms()
Description copied from interface:JWSProviderReturns the names of the supported algorithms by the JWS provider instance. These correspond to thealgJWS header parameter.- Specified by:
supportedJWSAlgorithmsin interfaceJWSProvider- Returns:
- The supported JWS algorithms, empty set if none.
-
getJCAContext
public JCAContext getJCAContext()
Description copied from interface:JCAAwareReturns the Java Cryptography Architecture (JCA) context. May be used to set a specific JCA security provider or secure random generator.- Specified by:
getJCAContextin interfaceJCAAware<JCAContext>- Returns:
- The JCA context. Not
null.
-
createJWSVerifier
public JWSVerifier createJWSVerifier(JWSHeader header, Key key) throws JOSEException
Description copied from interface:JWSVerifierFactoryCreates a new JWS verifier for the specified header and key.- Specified by:
createJWSVerifierin interfaceJWSVerifierFactory- Parameters:
header- The JWS header. Notnull.key- The key intended to verify the JWS message. Notnull.- Returns:
- The JWS verifier.
- Throws:
JOSEException- If the JWS algorithm is not supported or the key type or length doesn't match the expected for the JWS algorithm.
-
-