Class DefaultJWSSignerFactory
- java.lang.Object
-
- com.nimbusds.jose.crypto.factories.DefaultJWSSignerFactory
-
- All Implemented Interfaces:
JCAAware<JCAContext>,JOSEProvider,JWSProvider,JWSSignerFactory
public class DefaultJWSSignerFactory extends Object implements JWSSignerFactory
A factory to create JWS signers from a JWK instance based on the key type.- Since:
- 2020-03-29
- Author:
- Justin Richer
-
-
Field Summary
Fields Modifier and Type Field Description static Set<JWSAlgorithm>SUPPORTED_ALGORITHMSThe supported JWS algorithms.
-
Constructor Summary
Constructors Constructor Description DefaultJWSSignerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JWSSignercreateJWSSigner(JWK key)Create a JWS signer based on the key.JWSSignercreateJWSSigner(JWK key, JWSAlgorithm alg)Create a JWS signer based on the key and algorithm.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
-
DefaultJWSSignerFactory
public DefaultJWSSignerFactory()
-
-
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.
-
createJWSSigner
public JWSSigner createJWSSigner(JWK key) throws JOSEException
Description copied from interface:JWSSignerFactoryCreate a JWS signer based on the key.- Specified by:
createJWSSignerin interfaceJWSSignerFactory- Throws:
JOSEException
-
createJWSSigner
public JWSSigner createJWSSigner(JWK key, JWSAlgorithm alg) throws JOSEException
Description copied from interface:JWSSignerFactoryCreate a JWS signer based on the key and algorithm. Ensures that the key supports the given algorithm.- Specified by:
createJWSSignerin interfaceJWSSignerFactory- Throws:
JOSEException
-
-