public class EllipticCurveSigner extends EllipticCurveProvider implements Signer
| Modifier and Type | Field and Description |
|---|---|
protected SignatureAlgorithm |
alg |
static SecureRandom |
DEFAULT_SECURE_RANDOM
JJWT's default SecureRandom number generator.
|
protected Key |
key |
| Constructor and Description |
|---|
EllipticCurveSigner(SignatureAlgorithm alg,
Key key) |
| Modifier and Type | Method and Description |
|---|---|
protected Signature |
createSignatureInstance() |
protected byte[] |
doSign(byte[] data) |
protected Signature |
getSignatureInstance() |
protected boolean |
isBouncyCastleAvailable() |
byte[] |
sign(byte[] data) |
generateKeyPair, generateKeyPair, generateKeyPair, generateKeyPair, getSignatureByteArrayLength, transcodeSignatureToConcat, transcodeSignatureToDERpublic static final SecureRandom DEFAULT_SECURE_RANDOM
static {
DEFAULT_SECURE_RANDOM = new SecureRandom();
DEFAULT_SECURE_RANDOM.nextBytes(new byte[64]);
}
nextBytes is called to force the RNG to initialize itself if not already initialized. The
byte array is not used and discarded immediately for garbage collection.
protected final SignatureAlgorithm alg
protected final Key key
public EllipticCurveSigner(SignatureAlgorithm alg, Key key)
protected byte[] doSign(byte[] data)
throws InvalidKeyException,
SignatureException,
JwtException
protected Signature createSignatureInstance()
protected Signature getSignatureInstance() throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionprotected boolean isBouncyCastleAvailable()
Copyright © 2018. All rights reserved.