Class DefaultJWSSignerFactory
java.lang.Object
com.nimbusds.jose.crypto.factories.DefaultJWSSignerFactory
- All Implemented Interfaces:
JCAAware<JCAContext>
,JOSEProvider
,JWSProvider
,JWSSignerFactory
A factory to create JWS signers from a JWK instance based on the
key type.
- Since:
- 2024-05-07
- Author:
- Justin Richer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateJWSSigner
(JWK key) Create a JWS signer based on the key.createJWSSigner
(JWK key, JWSAlgorithm alg) Create a JWS signer based on the key and algorithm.Returns the Java Cryptography Architecture (JCA) context.Returns the names of the supported algorithms by the JWS provider instance.
-
Field Details
-
SUPPORTED_ALGORITHMS
The supported JWS algorithms.
-
-
Constructor Details
-
DefaultJWSSignerFactory
public DefaultJWSSignerFactory()
-
-
Method Details
-
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
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
Description copied from interface:JWSSignerFactory
Create a JWS signer based on the key.- Specified by:
createJWSSigner
in interfaceJWSSignerFactory
- Parameters:
key
- The JWK. Must not benull
.- Returns:
- The JWS signer.
- Throws:
JOSEException
-
createJWSSigner
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
- Parameters:
key
- The JWK. Must not benull
.alg
- The algorithm. Must not benull
.- Returns:
- The JWS signer.
- Throws:
JOSEException
-