Package org.forgerock.json.jose.jws
Enum JwsAlgorithm
- All Implemented Interfaces:
Serializable
,Comparable<JwsAlgorithm>
,Algorithm
An Enum of the possible signing algorithms that can be used to sign a JWT.
- Since:
- 2.0.0
- See Also:
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionECDSA using SHA-256 hash algorithm.ECDSA using SHA-384 hash algorithm.ECDSA using SHA-512 hash algorithm.HMAC using SHA-256 hash algorithm.HMAC using SHA-384 hash algorithm.HMAC using SHA-512 hash algorithm.No digital signature or MAC value included.RSA using SHA-256 hash algorithm. -
Method Summary
Modifier and TypeMethodDescriptionGets the actual name of the algorithm that is understood by Java cryptographic operations.Gets the JwsAlgorithmType of the JwsAlgorithm.Return the standard name of the elliptic curve definition.Gets the name of the algorithm as defined in the JWA standard.static JwsAlgorithm
getJwsAlgorithm
(String algorithm) Deprecated.Returns the Java-friendly name of the message digest algorithm implementation.static JwsAlgorithm
parseCryptographicAlgorithm
(String algorithm) Parses the given algorithm string to find the matching Java Cryptographic algorithm name.toString()
Turns the JwsAlgorithm constant into a JSON value string.static JwsAlgorithm
Returns the enum constant of this type with the specified name.static JwsAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NONE
No digital signature or MAC value included. -
HS256
HMAC using SHA-256 hash algorithm. -
HS384
HMAC using SHA-384 hash algorithm. -
HS512
HMAC using SHA-512 hash algorithm. -
RS256
RSA using SHA-256 hash algorithm. -
ES256
ECDSA using SHA-256 hash algorithm. -
ES384
ECDSA using SHA-384 hash algorithm. -
ES512
ECDSA using SHA-512 hash algorithm.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getAlgorithm
Description copied from interface:Algorithm
Gets the actual name of the algorithm that is understood by Java cryptographic operations.- Specified by:
getAlgorithm
in interfaceAlgorithm
- Returns:
- The name of the algorithm.
-
getJwaAlgorithmName
Description copied from interface:Algorithm
Gets the name of the algorithm as defined in the JWA standard.- Specified by:
getJwaAlgorithmName
in interfaceAlgorithm
- Returns:
- The name of the algorithm.
-
getMdAlgorithm
Returns the Java-friendly name of the message digest algorithm implementation.- Returns:
- the Java-friendly name of the message digest algorithm implementation.
- See Also:
-
getEllipticCurveName
Return the standard name of the elliptic curve definition. Only applicable for ECDSA algorithms.- Returns:
- the curve name or null if not applicable.
-
getAlgorithmType
Gets the JwsAlgorithmType of the JwsAlgorithm.- Returns:
- The JwsAlgorithmType.
-
getJwsAlgorithm
Deprecated.Replaced byparseCryptographicAlgorithm(String)
- Parameters:
algorithm
- The Java Cryptographic string algorithm name.- Returns:
- The matching JwsAlgorithm.
-
parseCryptographicAlgorithm
Parses the given algorithm string to find the matching Java Cryptographic algorithm name.If the given algorithm name does not match the algorithm name of any of the constants, then an IllegalArgumentException will be thrown.
- Parameters:
algorithm
- The Java Cryptographic string algorithm name.- Returns:
- The matching JwsAlgorithm.
-
toString
Turns the JwsAlgorithm constant into a JSON value string.- Overrides:
toString
in classEnum<JwsAlgorithm>
- Returns:
-
parseCryptographicAlgorithm(String)