SignatureValidatorpublic class RsaSignatureValidator extends RsaProvider implements SignatureValidator
| Modifier and Type | Field | Description |
|---|---|---|
protected io.jsonwebtoken.SignatureAlgorithm |
alg |
|
static SecureRandom |
DEFAULT_SECURE_RANDOM |
JJWT's default SecureRandom number generator.
|
protected Key |
key |
| Constructor | Description |
|---|---|
RsaSignatureValidator(io.jsonwebtoken.SignatureAlgorithm alg,
Key key) |
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
doVerify(Signature sig,
PublicKey publicKey,
byte[] data,
byte[] signature) |
|
protected Signature |
getSignatureInstance() |
|
protected boolean |
isBouncyCastleAvailable() |
|
boolean |
isValid(byte[] data,
byte[] signature) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateSignatureInstance, doSetParameter, generateKeyPair, generateKeyPair, generateKeyPair, generateKeyPair, generateKeyPair, setParameterpublic 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 io.jsonwebtoken.SignatureAlgorithm alg
protected final Key key
public RsaSignatureValidator(io.jsonwebtoken.SignatureAlgorithm alg,
Key key)
public boolean isValid(byte[] data,
byte[] signature)
isValid in interface SignatureValidatorprotected boolean doVerify(Signature sig, PublicKey publicKey, byte[] data, byte[] signature) throws InvalidKeyException, SignatureException
protected Signature getSignatureInstance() throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionprotected boolean isBouncyCastleAvailable()
Copyright © 2019. All rights reserved.