Package org.forgerock.json.jose.jws
Class SigningManager
java.lang.Object
org.forgerock.json.jose.jws.SigningManager
A service to get the appropriate SigningHandler for a specific Java Cryptographic signing algorithm.
For details of all supported signing algorithms see JwsAlgorithm
- Since:
- 2.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConstructs a new handler for signing ES256 signatures.Constructs a new handler for verifying ES256 signatures.newHmacSigningHandler
(byte[] sharedSecret) Constructs a new HmacSigningHandler.Constructs an implementation of the SigningHandler which does not perform any signing or verifying.newRsaSigningHandler
(Key key) Constructs a new RSASigningHandler, with a SignatureUtil instance to delegate the signing and verifying calls to.
-
Constructor Details
-
SigningManager
public SigningManager()
-
-
Method Details
-
newNopSigningHandler
Constructs an implementation of the SigningHandler which does not perform any signing or verifying.- Returns:
- an implementation of the SigningHandler which does not perform any signing or verifying.
-
newHmacSigningHandler
Constructs a new HmacSigningHandler.- Parameters:
sharedSecret
- The shared secret to use to sign the data.- Returns:
- a new HmacSigningHandler.
-
newRsaSigningHandler
Constructs a new RSASigningHandler, with a SignatureUtil instance to delegate the signing and verifying calls to.- Parameters:
key
- The key used to sign and verify the signature.- Returns:
- a new RSASigningHandler, with a SignatureUtil instance to delegate the signing and verifying calls to.
-
newEcdsaSigningHandler
Constructs a new handler for signing ES256 signatures.- Parameters:
key
- the elliptic curve private key. Should use the required curve for the given signing algorithm (P-256 for ES256).- Returns:
- the signing handler.
-
newEcdsaVerificationHandler
Constructs a new handler for verifying ES256 signatures.- Parameters:
key
- the elliptic curve public key. Should use the required curve for the given signing algorithm (P-256 for ES256).- Returns:
- the signing handler configured for verification.
-