@ThreadSafe public class RSASSASigner extends java.lang.Object implements JWSSigner
JWS objects
. This class is thread-safe.
Supports the following JSON Web Algorithms (JWAs):
Modifier and Type | Field and Description |
---|---|
static java.util.Set<JWSAlgorithm> |
SUPPORTED_ALGORITHMS
The supported JWS algorithms.
|
Constructor and Description |
---|
RSASSASigner(java.security.interfaces.RSAPrivateKey privateKey)
Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) signer.
|
Modifier and Type | Method and Description |
---|---|
java.security.interfaces.RSAPrivateKey |
getPrivateKey()
Gets the private RSA key.
|
protected static java.security.Signature |
getRSASignerAndVerifier(JWSAlgorithm alg)
Gets an RSA signer and verifier for the specified RSASSA-based JSON
Web Algorithm (JWA).
|
Base64URL |
sign(ReadOnlyJWSHeader header,
byte[] signableContent)
Signs the specified
signable
content of a JWS object . |
java.util.Set<JWSAlgorithm> |
supportedAlgorithms()
Returns the names of the supported JWS algorithms.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supportedAlgorithms
public static final java.util.Set<JWSAlgorithm> SUPPORTED_ALGORITHMS
public RSASSASigner(java.security.interfaces.RSAPrivateKey privateKey)
privateKey
- The private RSA key. Must not be null
.public java.security.interfaces.RSAPrivateKey getPrivateKey()
public Base64URL sign(ReadOnlyJWSHeader header, byte[] signableContent) throws JOSEException
JWSSigner
signable
content
of a JWS object
.sign
in interface JWSSigner
header
- The JSON Web Signature (JWS) header. Must
specify a supported JWS algorithm and must not
be null
.signableContent
- The content to sign. Must not be null
.JOSEException
- If the JWS algorithm is not supported or if
signing failed for some other reason.protected static java.security.Signature getRSASignerAndVerifier(JWSAlgorithm alg) throws JOSEException
alg
- The JSON Web Algorithm (JWA). Must be supported and not
null
.JOSEException
- If the algorithm is not supported.public java.util.Set<JWSAlgorithm> supportedAlgorithms()
JWSAlgorithmProvider
alg
JWS header parameter.supportedAlgorithms
in interface JWSAlgorithmProvider
Copyright © 2013 NimbusDS. All Rights Reserved.