@ThreadSafe public class RSASSASigner extends Object implements JWSSigner
JWS objects. This class is thread-safe.
Supports the following algorithms:
| Modifier and Type | Field and Description |
|---|---|
static Set<JWSAlgorithm> |
SUPPORTED_ALGORITHMS
The supported JWS algorithms by the RSA-SSA provider class.
|
| Constructor and Description |
|---|
RSASSASigner(PrivateKey privateKey)
Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) signer.
|
RSASSASigner(RSAKey rsaJWK)
Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) signer.
|
| Modifier and Type | Method and Description |
|---|---|
JCAContext |
getJCAContext()
Returns the Java Cryptography Architecture (JCA) context.
|
PrivateKey |
getPrivateKey()
Gets the private RSA key.
|
Base64URL |
sign(JWSHeader header,
byte[] signingInput)
Signs the specified
input of a
JWS object. |
Set<JWSAlgorithm> |
supportedJWSAlgorithms()
Returns the names of the supported algorithms by the JWS provider
instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsupportedJWSAlgorithmsgetJCAContextpublic static final Set<JWSAlgorithm> SUPPORTED_ALGORITHMS
public RSASSASigner(PrivateKey privateKey)
privateKey - The private RSA key. Must not be null.public RSASSASigner(RSAKey rsaJWK) throws JOSEException
rsaJWK - The RSA JSON Web Key (JWK). Must contain a private
part. Must not be null.JOSEException - If the RSA JWK doesn't contain a private part
or its extraction failed.public PrivateKey getPrivateKey()
RSAPrivateKey may not be
possible if the key is backed by a key store that doesn't
expose the private key parameters.public Base64URL sign(JWSHeader header, byte[] signingInput) throws JOSEException
JWSSignerinput of a
JWS object.sign in interface JWSSignerheader - The JSON Web Signature (JWS) header. Must
specify a supported JWS algorithm and must not
be null.signingInput - The input to sign. Must not be null.JOSEException - If the JWS algorithm is not supported, if a
critical header parameter is not supported or
marked for deferral to the application, or if
signing failed for some other internal reason.public Set<JWSAlgorithm> supportedJWSAlgorithms()
JWSProvideralg JWS header parameter.supportedJWSAlgorithms in interface JWSProviderpublic JCAContext getJCAContext()
JCAAwaregetJCAContext in interface JCAAware<JCAContext>null.Copyright © 2016 Connect2id Ltd.. All rights reserved.