Enum Class MacAlgorithm
- All Implemented Interfaces:
Serializable
,Comparable<MacAlgorithm>
,Constable
,JwaAlgorithm
,JwsAlgorithm
An enumeration of the cryptographic algorithms defined by the JSON Web Algorithms (JWA)
specification and used by JSON Web Signature (JWS) to create a MAC of the contents of
the JWS Protected Header and JWS Payload.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MacAlgorithm
Attempt to resolve the provided algorithm name to aMacAlgorithm
.getName()
Returns the algorithm name.static MacAlgorithm
Returns the enum constant of this class with the specified name.static MacAlgorithm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HS256
HMAC using SHA-256 (Required) -
HS384
HMAC using SHA-384 (Optional) -
HS512
HMAC using SHA-512 (Optional)
-
-
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
-
getName
Returns the algorithm name.- Specified by:
getName
in interfaceJwaAlgorithm
- Returns:
- the algorithm name
-
from
Attempt to resolve the provided algorithm name to aMacAlgorithm
.- Parameters:
name
- the algorithm name- Returns:
- the resolved
MacAlgorithm
, ornull
if not found
-