Package | Description |
---|---|
io.jsonwebtoken | |
io.jsonwebtoken.security |
Modifier and Type | Method and Description |
---|---|
void |
SignatureAlgorithm.assertValidSigningKey(Key key)
Deprecated.
Returns quietly if the specified key is allowed to create signatures using this algorithm
according to the JWT JWA Specification (RFC 7518) or throws an
InvalidKeyException if the key is not allowed or not secure enough for this algorithm. |
void |
SignatureAlgorithm.assertValidVerificationKey(Key key)
Deprecated.
Returns quietly if the specified key is allowed to verify signatures using this algorithm
according to the JWT JWA Specification (RFC 7518) or throws an
InvalidKeyException if the key is not allowed or not secure enough for this algorithm. |
static SignatureAlgorithm |
SignatureAlgorithm.forSigningKey(Key key)
Deprecated.
Returns the recommended signature algorithm to be used with the specified key according to the following
heuristics:
SecretKey
1
256 <= size <= 383 2
HS256
SecretKey
1
384 <= size <= 511
HS384
SecretKey
1
512 <= size
HS512
ECKey
instanceof
256 <= size <= 383 3
ES256
ECKey
instanceof
384 <= size <= 511
ES384
ECKey
instanceof
4096 <= size
ES512
RSAKey
instanceof
2048 <= size <= 3071 4,5
RS256
RSAKey
instanceof
3072 <= size <= 4095 5
RS384
RSAKey
instanceof
4096 <= size 5
RS512
|
JwtBuilder |
JwtBuilder.signWith(Key key)
Signs the constructed JWT with the specified key using the key's recommended signature algorithm
as defined below, producing a JWS.
|
JwtBuilder |
JwtBuilder.signWith(Key key,
SignatureAlgorithm alg)
Deprecated.
since 0.12.0 to use the more flexible
JwtBuilder.signWith(Key, SecureDigestAlgorithm) . |
<K extends Key> |
JwtBuilder.signWith(K key,
SecureDigestAlgorithm<? super K,?> alg)
Signs the constructed JWT with the specified key using the specified algorithm, producing a JWS.
|
JwtBuilder |
JwtBuilder.signWith(SignatureAlgorithm alg,
byte[] secretKey)
Deprecated.
as of 0.10.0: use
Keys .hmacShaKeyFor(bytes) to
obtain the Key and then invoke JwtBuilder.signWith(Key) or
JwtBuilder.signWith(Key, SecureDigestAlgorithm) .
This method will be removed in the 1.0 release. |
JwtBuilder |
JwtBuilder.signWith(SignatureAlgorithm alg,
Key key)
Deprecated.
since 0.10.0. Use
JwtBuilder.signWith(Key, SecureDigestAlgorithm) instead.
This method will be removed before the 1.0 release. |
JwtBuilder |
JwtBuilder.signWith(SignatureAlgorithm alg,
String base64EncodedSecretKey)
Deprecated.
as of 0.10.0: use
JwtBuilder.signWith(Key) or JwtBuilder.signWith(Key, SignatureAlgorithm) instead. This
method will be removed in the 1.0 release. |
Modifier and Type | Class and Description |
---|---|
class |
MalformedKeyException
Exception thrown when encountering a key or key material that is incomplete or improperly configured or
formatted and cannot be used as expected.
|
class |
WeakKeyException
Exception thrown when encountering a key that is not strong enough (of sufficient length) to be used with
a particular algorithm or in a particular security context.
|
Copyright © 2014–2024 jsonwebtoken.io. All rights reserved.