Enum Class DigestSpec.Algorithm
- All Implemented Interfaces:
Serializable, Comparable<DigestSpec.Algorithm>, Constable
- Enclosing class:
DigestSpec
Enumeration of supported digest algorithms.
Each constant defines the JCA algorithm name and whether the variant is an extendable-output function (XOF).
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSHA-256 digest from the SHA-2 family.SHA-384 digest from the SHA-2 family.SHA-512 digest from the SHA-2 family.SHA3-256 digest from the SHA-3 family.SHA3-512 digest from the SHA-3 family.SHAKE128 extendable-output function (XOF).SHAKE256 extendable-output function (XOF). -
Method Summary
Modifier and TypeMethodDescriptionbooleanisXof()Indicates whether this algorithm is an XOF (extendable-output function).jca()Returns the canonical JCA algorithm name.static DigestSpec.AlgorithmReturns the enum constant of this class with the specified name.static DigestSpec.Algorithm[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SHA_256
SHA-256 digest from the SHA-2 family. -
SHA_384
SHA-384 digest from the SHA-2 family. -
SHA_512
SHA-512 digest from the SHA-2 family. -
SHA3_256
SHA3-256 digest from the SHA-3 family. -
SHA3_512
SHA3-512 digest from the SHA-3 family. -
SHAKE128
SHAKE128 extendable-output function (XOF). -
SHAKE256
SHAKE256 extendable-output function (XOF).
-
-
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
-
jca
Returns the canonical JCA algorithm name.- Returns:
- JCA name string (e.g.,
"SHA-256"or"SHAKE256")
-
isXof
public boolean isXof()Indicates whether this algorithm is an XOF (extendable-output function).- Returns:
trueif this algorithm is an XOF,falseotherwise
-