public class EllipticCurveSignatureValidator extends EllipticCurveProvider implements SignatureValidator
限定符和类型 | 字段和说明 |
---|---|
protected SignatureAlgorithm |
alg |
static java.security.SecureRandom |
DEFAULT_SECURE_RANDOM
JJWT's default SecureRandom number generator.
|
protected java.security.Key |
key |
构造器和说明 |
---|
EllipticCurveSignatureValidator(SignatureAlgorithm alg,
java.security.Key key) |
限定符和类型 | 方法和说明 |
---|---|
protected java.security.Signature |
createSignatureInstance() |
protected boolean |
doVerify(java.security.Signature sig,
java.security.PublicKey publicKey,
byte[] data,
byte[] signature) |
protected java.security.Signature |
getSignatureInstance() |
protected boolean |
isBouncyCastleAvailable() |
boolean |
isValid(byte[] data,
byte[] signature) |
generateKeyPair, generateKeyPair, generateKeyPair, generateKeyPair, getSignatureByteArrayLength, transcodeSignatureToConcat, transcodeSignatureToDER
public static final java.security.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 java.security.Key key
public EllipticCurveSignatureValidator(SignatureAlgorithm alg, java.security.Key key)
public boolean isValid(byte[] data, byte[] signature)
isValid
在接口中 SignatureValidator
protected boolean doVerify(java.security.Signature sig, java.security.PublicKey publicKey, byte[] data, byte[] signature) throws java.security.InvalidKeyException, java.security.SignatureException
java.security.InvalidKeyException
java.security.SignatureException
protected java.security.Signature createSignatureInstance()
protected java.security.Signature getSignatureInstance() throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
protected boolean isBouncyCastleAvailable()