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