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_ALGORITHMS
The supported JWS algorithms.
-
Constructor Summary
Constructors Constructor Description DefaultJWSSignerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JWSSigner
createJWSSigner(JWK key)
Create a JWS signer based on the key.JWSSigner
createJWSSigner(JWK key, JWSAlgorithm alg)
Create a JWS signer based on the key and algorithm.JCAContext
getJCAContext()
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:JWSProvider
Returns the names of the supported algorithms by the JWS provider instance. These correspond to thealg
JWS header parameter.- Specified by:
supportedJWSAlgorithms
in interfaceJWSProvider
- Returns:
- The supported JWS algorithms, empty set if none.
-
getJCAContext
public JCAContext getJCAContext()
Description copied from interface:JCAAware
Returns the Java Cryptography Architecture (JCA) context. May be used to set a specific JCA security provider or secure random generator.- Specified by:
getJCAContext
in interfaceJCAAware<JCAContext>
- Returns:
- The JCA context. Not
null
.
-
createJWSSigner
public JWSSigner createJWSSigner(JWK key) throws JOSEException
Description copied from interface:JWSSignerFactory
Create a JWS signer based on the key.- Specified by:
createJWSSigner
in interfaceJWSSignerFactory
- Throws:
JOSEException
-
createJWSSigner
public JWSSigner createJWSSigner(JWK key, JWSAlgorithm alg) throws JOSEException
Description copied from interface:JWSSignerFactory
Create a JWS signer based on the key and algorithm. Ensures that the key supports the given algorithm.- Specified by:
createJWSSigner
in interfaceJWSSignerFactory
- Throws:
JOSEException
-
-