Enum DigestScheme.DigestAlgorithm
java.lang.Object
java.lang.Enum<DigestScheme.DigestAlgorithm>
org.apache.hc.client5.http.impl.auth.DigestScheme.DigestAlgorithm
- All Implemented Interfaces:
Serializable, Comparable<DigestScheme.DigestAlgorithm>, java.lang.constant.Constable
- Enclosing class:
DigestScheme
Enum representing supported digest algorithms for HTTP Digest Authentication,
including session-based variants.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMD5 digest algorithm.MD5 digest algorithm with session-based variant.SHA-256 digest algorithm.SHA-256 digest algorithm with session-based variant.SHA-512/256 digest algorithm.SHA-512/256 digest algorithm with session-based variant. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDigestAlgorithm(String baseAlgorithm, boolean sessionBased) Constructor forDigestAlgorithm. -
Method Summary
Modifier and TypeMethodDescriptionprivate static DigestScheme.DigestAlgorithmfromString(String algorithm) Maps a string representation of an algorithm to the corresponding enum constant.private StringRetrieves the base algorithm name without session suffix.private booleanChecks if the algorithm is session-based.static DigestScheme.DigestAlgorithmReturns the enum constant of this type with the specified name.static DigestScheme.DigestAlgorithm[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
MD5
MD5 digest algorithm. -
MD5_SESS
MD5 digest algorithm with session-based variant. -
SHA_256
SHA-256 digest algorithm. -
SHA_256_SESS
SHA-256 digest algorithm with session-based variant. -
SHA_512_256
SHA-512/256 digest algorithm. -
SHA_512_256_SESS
SHA-512/256 digest algorithm with session-based variant.
-
-
Field Details
-
baseAlgorithm
-
sessionBased
private final boolean sessionBased
-
-
Constructor Details
-
DigestAlgorithm
Constructor forDigestAlgorithm.- Parameters:
baseAlgorithm- the base name of the algorithm, e.g., "MD5" or "SHA-256"sessionBased- indicates if the algorithm is session-based (i.e., includes the "-sess" suffix)
-
-
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
-
getBaseAlgorithm
Retrieves the base algorithm name without session suffix.- Returns:
- the base algorithm name
-
isSessionBased
private boolean isSessionBased()Checks if the algorithm is session-based.- Returns:
trueif the algorithm includes the "-sess" suffix, otherwisefalse
-
fromString
Maps a string representation of an algorithm to the corresponding enum constant.- Parameters:
algorithm- the algorithm name, e.g., "SHA-256" or "SHA-512-256-sess"- Returns:
- the corresponding
DigestAlgorithmconstant - Throws:
UnsupportedDigestAlgorithmException- if the algorithm is unsupported
-