Enum SignatureAlgorithm
- java.lang.Object
-
- java.lang.Enum<SignatureAlgorithm>
-
- org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SignatureAlgorithm>
,JwaAlgorithm
,JwsAlgorithm
public enum SignatureAlgorithm extends java.lang.Enum<SignatureAlgorithm> implements JwsAlgorithm
An enumeration of the cryptographic algorithms defined by the JSON Web Algorithms (JWA) specification and used by JSON Web Signature (JWS) to digitally sign the contents of the JWS Protected Header and JWS Payload.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ES256
ECDSA using P-256 and SHA-256 (Recommended+)ES384
ECDSA using P-384 and SHA-384 (Optional)ES512
ECDSA using P-521 and SHA-512 (Optional)PS256
RSASSA-PSS using SHA-256 and MGF1 with SHA-256 (Optional)PS384
RSASSA-PSS using SHA-384 and MGF1 with SHA-384 (Optional)PS512
RSASSA-PSS using SHA-512 and MGF1 with SHA-512 (Optional)RS256
RSASSA-PKCS1-v1_5 using SHA-256 (Recommended)RS384
RSASSA-PKCS1-v1_5 using SHA-384 (Optional)RS512
RSASSA-PKCS1-v1_5 using SHA-512 (Optional)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SignatureAlgorithm
from(java.lang.String name)
Attempt to resolve the provided algorithm name to aSignatureAlgorithm
.java.lang.String
getName()
Returns the algorithm name.static SignatureAlgorithm
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static SignatureAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RS256
public static final SignatureAlgorithm RS256
RSASSA-PKCS1-v1_5 using SHA-256 (Recommended)
-
RS384
public static final SignatureAlgorithm RS384
RSASSA-PKCS1-v1_5 using SHA-384 (Optional)
-
RS512
public static final SignatureAlgorithm RS512
RSASSA-PKCS1-v1_5 using SHA-512 (Optional)
-
ES256
public static final SignatureAlgorithm ES256
ECDSA using P-256 and SHA-256 (Recommended+)
-
ES384
public static final SignatureAlgorithm ES384
ECDSA using P-384 and SHA-384 (Optional)
-
ES512
public static final SignatureAlgorithm ES512
ECDSA using P-521 and SHA-512 (Optional)
-
PS256
public static final SignatureAlgorithm PS256
RSASSA-PSS using SHA-256 and MGF1 with SHA-256 (Optional)
-
PS384
public static final SignatureAlgorithm PS384
RSASSA-PSS using SHA-384 and MGF1 with SHA-384 (Optional)
-
PS512
public static final SignatureAlgorithm PS512
RSASSA-PSS using SHA-512 and MGF1 with SHA-512 (Optional)
-
-
Method Detail
-
values
public static SignatureAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SignatureAlgorithm c : SignatureAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SignatureAlgorithm valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getName
public java.lang.String getName()
Returns the algorithm name.- Specified by:
getName
in interfaceJwaAlgorithm
- Returns:
- the algorithm name
-
from
public static SignatureAlgorithm from(java.lang.String name)
Attempt to resolve the provided algorithm name to aSignatureAlgorithm
.- Parameters:
name
- the algorithm name- Returns:
- the resolved
SignatureAlgorithm
, ornull
if not found
-
-