public class EllipticCurveSigner extends EllipticCurveProvider implements Signer
限定符和类型 | 字段和说明 |
---|---|
protected SignatureAlgorithm |
alg |
static java.security.SecureRandom |
DEFAULT_SECURE_RANDOM
JJWT's default SecureRandom number generator.
|
protected java.security.Key |
key |
构造器和说明 |
---|
EllipticCurveSigner(SignatureAlgorithm alg,
java.security.Key key) |
限定符和类型 | 方法和说明 |
---|---|
protected java.security.Signature |
createSignatureInstance() |
protected byte[] |
doSign(byte[] data) |
protected java.security.Signature |
getSignatureInstance() |
protected boolean |
isBouncyCastleAvailable() |
byte[] |
sign(byte[] data) |
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 EllipticCurveSigner(SignatureAlgorithm alg, java.security.Key key)
protected byte[] doSign(byte[] data) throws java.security.InvalidKeyException, java.security.SignatureException, JwtException
java.security.InvalidKeyException
java.security.SignatureException
JwtException
protected java.security.Signature createSignatureInstance()
protected java.security.Signature getSignatureInstance() throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException
protected boolean isBouncyCastleAvailable()