Signerpublic class MacSigner extends MacProvider implements Signer
| 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 |
|---|---|
MacSigner(io.jsonwebtoken.SignatureAlgorithm alg,
byte[] key) |
|
MacSigner(io.jsonwebtoken.SignatureAlgorithm alg,
Key key) |
| Modifier and Type | Method | Description |
|---|---|---|
protected Signature |
createSignatureInstance() |
|
protected Mac |
doGetMacInstance() |
|
protected Mac |
getMacInstance() |
|
protected Signature |
getSignatureInstance() |
|
protected boolean |
isBouncyCastleAvailable() |
|
byte[] |
sign(byte[] data) |
generateKey, generateKey, generateKeypublic 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 MacSigner(io.jsonwebtoken.SignatureAlgorithm alg,
byte[] key)
public MacSigner(io.jsonwebtoken.SignatureAlgorithm alg,
Key key)
protected Mac getMacInstance() throws io.jsonwebtoken.security.SignatureException
io.jsonwebtoken.security.SignatureExceptionprotected Mac doGetMacInstance() throws NoSuchAlgorithmException, InvalidKeyException
protected Signature createSignatureInstance()
protected Signature getSignatureInstance() throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionprotected boolean isBouncyCastleAvailable()
Copyright © 2019. All rights reserved.