@ThreadSafe public class RSASSAVerifier extends Object implements JWSVerifier, CriticalHeaderParamsAware
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 |
---|
RSASSAVerifier(RSAKey rsaJWK)
Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) verifier.
|
RSASSAVerifier(RSAPublicKey publicKey)
Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) verifier.
|
RSASSAVerifier(RSAPublicKey publicKey,
Set<String> defCritHeaders)
Creates a new RSA Signature-Scheme-with-Appendix (RSASSA) verifier.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getDeferredCriticalHeaderParams()
Returns the names of the critical (
crit ) header parameters
that are deferred to the application for processing and will be
ignored by the JWS verifier / JWE decrypter. |
JCAContext |
getJCAContext()
Returns the Java Cryptography Architecture (JCA) context.
|
Set<String> |
getProcessedCriticalHeaderParams()
Returns the names of the critical (
crit ) header parameters
that are understood and processed by the JWS verifier / JWE
decrypter. |
RSAPublicKey |
getPublicKey()
Gets the public RSA key.
|
Set<JWSAlgorithm> |
supportedJWSAlgorithms()
Returns the names of the supported algorithms by the JWS provider
instance.
|
boolean |
verify(JWSHeader header,
byte[] signedContent,
Base64URL signature)
Verifies the specified
signature of a
JWS object . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supportedJWSAlgorithms
getJCAContext
public static final Set<JWSAlgorithm> SUPPORTED_ALGORITHMS
public RSASSAVerifier(RSAPublicKey publicKey)
publicKey
- The public RSA key. Must not be null
.public RSASSAVerifier(RSAKey rsaJWK) throws JOSEException
rsaJWK
- The RSA JSON Web Key (JWK). Must not be null
.JOSEException
- If the RSA JWK extraction failed.public RSASSAVerifier(RSAPublicKey publicKey, Set<String> defCritHeaders)
publicKey
- The public RSA key. Must not be null
.defCritHeaders
- The names of the critical header parameters
that are deferred to the application for
processing, empty set or null
if none.public RSAPublicKey getPublicKey()
public Set<String> getProcessedCriticalHeaderParams()
CriticalHeaderParamsAware
crit
) header parameters
that are understood and processed by the JWS verifier / JWE
decrypter.getProcessedCriticalHeaderParams
in interface CriticalHeaderParamsAware
public Set<String> getDeferredCriticalHeaderParams()
CriticalHeaderParamsAware
crit
) header parameters
that are deferred to the application for processing and will be
ignored by the JWS verifier / JWE decrypter.getDeferredCriticalHeaderParams
in interface CriticalHeaderParamsAware
public boolean verify(JWSHeader header, byte[] signedContent, Base64URL signature) throws JOSEException
JWSVerifier
signature
of a
JWS object
.verify
in interface JWSVerifier
header
- The JSON Web Signature (JWS) header. Must
specify a supported JWS algorithm and must not
be null
.signedContent
- The signing input. Must not be null
.signature
- The signature part of the JWS object. Must not
be null
.true
if the signature was successfully verified,
false
if the signature is invalid or if a critical
header is neither supported nor marked for deferral to the
application.JOSEException
- If the JWS algorithm is not supported, or if
signature verification failed for some other
internal reason.public Set<JWSAlgorithm> supportedJWSAlgorithms()
JWSProvider
alg
JWS header parameter.supportedJWSAlgorithms
in interface JWSProvider
public JCAContext getJCAContext()
JCAAware
getJCAContext
in interface JCAAware<JCAContext>
null
.Copyright © 2016 Connect2id Ltd.. All rights reserved.