Enum Class JwsAlgorithm
- All Implemented Interfaces:
Serializable,Comparable<JwsAlgorithm>,Constable
The JWS signature algorithms
JwtAuthenticator can verify, all implemented by the JDK.
none is deliberately absent: an unsigned token is never accepted. A token's alg
header must name one of these and match the algorithm its verification key was registered for.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionEdDSA (RFC 8037) on Ed25519 only; Ed448 keys and signatures are refused.ECDSA on P-256 with SHA-256.ECDSA on P-384 with SHA-384.ECDSA on P-521 with SHA-512.HMAC with SHA-256; a secret of at least 32 bytes.HMAC with SHA-384; a secret of at least 48 bytes.HMAC with SHA-512; a secret of at least 64 bytes.RSASSA-PSS with SHA-256, MGF1 with SHA-256 and a 32-byte salt; an RSA public key of at least 2048 bits.RSASSA-PSS with SHA-384, MGF1 with SHA-384 and a 48-byte salt; an RSA public key of at least 2048 bits.RSASSA-PSS with SHA-512, MGF1 with SHA-512 and a 64-byte salt; an RSA public key of at least 2048 bits.RSASSA-PKCS1-v1_5 with SHA-256; an RSA public key of at least 2048 bits.RSASSA-PKCS1-v1_5 with SHA-384; an RSA public key of at least 2048 bits.RSASSA-PKCS1-v1_5 with SHA-512; an RSA public key of at least 2048 bits. -
Method Summary
Modifier and TypeMethodDescriptionstatic JwsAlgorithmReturns the enum constant of this class with the specified name.static JwsAlgorithm[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HS256
HMAC with SHA-256; a secret of at least 32 bytes. -
HS384
HMAC with SHA-384; a secret of at least 48 bytes. -
HS512
HMAC with SHA-512; a secret of at least 64 bytes. -
RS256
RSASSA-PKCS1-v1_5 with SHA-256; an RSA public key of at least 2048 bits. -
RS384
RSASSA-PKCS1-v1_5 with SHA-384; an RSA public key of at least 2048 bits. -
RS512
RSASSA-PKCS1-v1_5 with SHA-512; an RSA public key of at least 2048 bits. -
PS256
RSASSA-PSS with SHA-256, MGF1 with SHA-256 and a 32-byte salt; an RSA public key of at least 2048 bits. -
PS384
RSASSA-PSS with SHA-384, MGF1 with SHA-384 and a 48-byte salt; an RSA public key of at least 2048 bits. -
PS512
RSASSA-PSS with SHA-512, MGF1 with SHA-512 and a 64-byte salt; an RSA public key of at least 2048 bits. -
ES256
ECDSA on P-256 with SHA-256. -
ES384
ECDSA on P-384 with SHA-384. -
ES512
ECDSA on P-521 with SHA-512. -
EdDSA
EdDSA (RFC 8037) on Ed25519 only; Ed448 keys and signatures are refused.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-