Package net.visma.autopay.http.digest
Enum Class DigestAlgorithm
- All Implemented Interfaces:
Serializable
,Comparable<DigestAlgorithm>
,Constable
Hash algorithms. Algorithms with status Deprecated are not handled.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<DigestAlgorithm>
fromHttpKey
(String httpKey) Returns algorithm corresponding to Digest Fields' algorithm keyReturns algorithm key to be used as dictionary key in Digest HTTP headersReturns "JVM" name of this algorithm, which then can be used to callMessageDigest.getInstance(String)
static DigestAlgorithm
Returns the enum constant of this class with the specified name.static DigestAlgorithm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
SHA_256
SHA-256 algorithm -
SHA_512
SHA-512 algorithm
-
-
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
-
getHttpKey
Returns algorithm key to be used as dictionary key in Digest HTTP headers- Returns:
- Algorithm key as defined in Digest Fields
-
getJvmName
Returns "JVM" name of this algorithm, which then can be used to callMessageDigest.getInstance(String)
- Returns:
- JVM name of this algorithm
-
fromHttpKey
Returns algorithm corresponding to Digest Fields' algorithm key- Parameters:
httpKey
- Algorithm key- Returns:
- DigestAlgorithm for provided key or empty Optional if the key is unknown
-