@ThreadSafe public class ECDSAVerifier extends java.lang.Object implements JWSVerifier
JWS objects.
Supports the following JSON Web Algorithms (JWAs):
Accepts all reserved JWS header parameters. Modify the header filter properties to restrict the acceptable JWS algorithms and
header parameters, or to allow custom JWS header parameters.
| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<JWSAlgorithm> |
SUPPORTED_ALGORITHMS
The supported JWS algorithms.
|
| Constructor and Description |
|---|
ECDSAVerifier(java.math.BigInteger x,
java.math.BigInteger y)
Creates a new Elliptic Curve Digital Signature Algorithm (ECDSA)
verifier.
|
| Modifier and Type | Method and Description |
|---|---|
protected static com.nimbusds.jose.crypto.ECDSAParameters |
getECDSAParameters(JWSAlgorithm alg)
Gets the initial parameters for the specified ECDSA-based JSON Web
Algorithm (JWA).
|
JWSHeaderFilter |
getJWSHeaderFilter()
Gets the JWS header filter associated with the verifier.
|
protected static int |
getSignatureByteArrayLength(JWSAlgorithm alg)
Gets the expected signature byte array length (R + S parts) for the
specified ECDSA algorithm.
|
java.math.BigInteger |
getX()
Gets the 'x' coordinate for the elliptic curve point.
|
java.math.BigInteger |
getY()
Gets the 'y' coordinate for the elliptic curve point.
|
java.util.Set<JWSAlgorithm> |
supportedAlgorithms()
Returns the names of the supported JWS algorithms.
|
boolean |
verify(ReadOnlyJWSHeader header,
byte[] signedContent,
Base64URL signature)
Verifies the specified
signature of a
JWS object. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsupportedAlgorithmspublic static final java.util.Set<JWSAlgorithm> SUPPORTED_ALGORITHMS
public ECDSAVerifier(java.math.BigInteger x, java.math.BigInteger y)
x - The 'x' coordinate for the elliptic curve point. Must not
be null.y - The 'y' coordinate for the elliptic curve point. Must not
be null.public java.math.BigInteger getX()
public java.math.BigInteger getY()
public JWSHeaderFilter getJWSHeaderFilter()
JWSVerifiersupported JWS algorithms and
header parameters that the verifier is configured to accept.
Attempting to verify a JWS object signature with an
algorithm or header parameter that is not accepted must result in a
JOSEException.
getJWSHeaderFilter in interface JWSVerifierpublic boolean verify(ReadOnlyJWSHeader header, byte[] signedContent, Base64URL signature) throws JOSEException
JWSVerifiersignature of a
JWS object.verify in interface JWSVerifierheader - The JSON Web Signature (JWS) header. Must
specify an accepted JWS algorithm, must contain
only accepted header parameters, and must not be
null.signedContent - The signed content. Must not be null.signature - The signature part of the JWS object. Must not
be null.true if the signature was successfully verified, else
false.JOSEException - If the JWS algorithm is not accepted, if a header
parameter is not accepted, or if signature
verification failed for some other reason.protected static int getSignatureByteArrayLength(JWSAlgorithm alg) throws JOSEException
alg - The JSON Web Algorithm (JWA). Must be supported and not
null.JOSEException - If the algorithm is not supported.protected static com.nimbusds.jose.crypto.ECDSAParameters getECDSAParameters(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()
JWSAlgorithmProvideralg JWS header parameter.supportedAlgorithms in interface JWSAlgorithmProviderCopyright © 2013 NimbusDS. All Rights Reserved.