| Modifier and Type | Method and Description |
|---|---|
static int |
getSignatureByteArrayLength(JWSAlgorithm alg)
Returns the expected signature byte array length (R + S parts) for
the specified ECDSA algorithm.
|
static Signature |
getSignerAndVerifier(JWSAlgorithm alg,
Provider jcaProvider)
Creates a new JCA signer / verifier for ECDSA.
|
static JWSAlgorithm |
resolveAlgorithm(Curve curve)
Resolves the matching EC DSA algorithm for the specified elliptic
curve.
|
static JWSAlgorithm |
resolveAlgorithm(ECKey ecKey)
Resolves the matching EC DSA algorithm for the specified EC key
(public or private).
|
static byte[] |
transcodeSignatureToConcat(byte[] derSignature,
int outputLength)
Transcodes the JCA ASN.1/DER-encoded signature into the concatenated
R + S format expected by ECDSA JWS.
|
static byte[] |
transcodeSignatureToDER(byte[] jwsSignature)
Transcodes the ECDSA JWS signature into ASN.1/DER format for use by
the JCA verifier.
|
public static JWSAlgorithm resolveAlgorithm(ECKey ecKey) throws JOSEException
ecKey - The EC key. Must not be null.JOSEException - If the elliptic curve of key is not supported.public static JWSAlgorithm resolveAlgorithm(Curve curve) throws JOSEException
curve - The elliptic curve. May be null.JOSEException - If the elliptic curve of key is not supported.public static Signature getSignerAndVerifier(JWSAlgorithm alg, Provider jcaProvider) throws JOSEException
alg - The ECDSA JWS algorithm. Must not be
null.jcaProvider - The JCA provider, null if not specified.JOSEException - If a JCA signer / verifier couldn't be
created.public static int getSignatureByteArrayLength(JWSAlgorithm alg) throws JOSEException
alg - The ECDSA algorithm. Must be supported and not
null.JOSEException - If the algorithm is not supported.public static byte[] transcodeSignatureToConcat(byte[] derSignature, int outputLength) throws JOSEException
derSignature - The ASN1./DER-encoded. Must not be null.outputLength - The expected length of the ECDSA JWS signature.JOSEException - If the ASN.1/DER signature format is invalid.public static byte[] transcodeSignatureToDER(byte[] jwsSignature) throws JOSEException
jwsSignature - The JWS signature, consisting of the
concatenated R and S values. Must not be
null.JOSEException - If the ECDSA JWS signature format is invalid.Copyright © 2019 Connect2id Ltd.. All rights reserved.