@ThreadSafe public class ECDSASigner 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 EC-DSA provider class.
|
| Constructor and Description |
|---|
ECDSASigner(ECKey ecJWK)
Creates a new Elliptic Curve Digital Signature Algorithm (ECDSA)
signer.
|
ECDSASigner(ECPrivateKey privateKey)
Creates a new Elliptic Curve Digital Signature Algorithm (ECDSA)
signer.
|
| Modifier and Type | Method and Description |
|---|---|
JCAContext |
getJCAContext()
Returns the Java Cryptography Architecture (JCA) context.
|
ECPrivateKey |
getPrivateKey()
Returns the private EC 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, waitsupportedJWSAlgorithmspublic static final Set<JWSAlgorithm> SUPPORTED_ALGORITHMS
public ECDSASigner(ECPrivateKey privateKey) throws JOSEException
privateKey - The private EC key. Must not be null.JOSEException - If the elliptic curve of key is not supported.public ECDSASigner(ECKey ecJWK) throws JOSEException
ecJWK - The EC JSON Web Key (JWK). Must contain a private part.
Must not be null.JOSEException - If the EC JWK doesn't contain a private part,
its extraction failed, or the elliptic curve
is not supported.public ECPrivateKey getPrivateKey()
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 © 2015 Connect2id Ltd.. All Rights Reserved.