Enum DigestScheme.DigestAlgorithm
- java.lang.Object
-
- java.lang.Enum<DigestScheme.DigestAlgorithm>
-
- org.apache.hc.client5.http.impl.auth.DigestScheme.DigestAlgorithm
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<DigestScheme.DigestAlgorithm>
- Enclosing class:
- DigestScheme
private static enum DigestScheme.DigestAlgorithm extends java.lang.Enum<DigestScheme.DigestAlgorithm>
Enum representing supported digest algorithms for HTTP Digest Authentication, including session-based variants.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MD5MD5 digest algorithm.MD5_SESSMD5 digest algorithm with session-based variant.SHA_256SHA-256 digest algorithm.SHA_256_SESSSHA-256 digest algorithm with session-based variant.SHA_512_256SHA-512/256 digest algorithm.SHA_512_256_SESSSHA-512/256 digest algorithm with session-based variant.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringbaseAlgorithmprivate booleansessionBased
-
Constructor Summary
Constructors Modifier Constructor Description privateDigestAlgorithm(java.lang.String baseAlgorithm, boolean sessionBased)Constructor forDigestAlgorithm.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static DigestScheme.DigestAlgorithmfromString(java.lang.String algorithm)Maps a string representation of an algorithm to the corresponding enum constant.private java.lang.StringgetBaseAlgorithm()Retrieves the base algorithm name without session suffix.private booleanisSessionBased()Checks if the algorithm is session-based.static DigestScheme.DigestAlgorithmvalueOf(java.lang.String name)Returns 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 Detail
-
MD5
public static final DigestScheme.DigestAlgorithm MD5
MD5 digest algorithm.
-
MD5_SESS
public static final DigestScheme.DigestAlgorithm MD5_SESS
MD5 digest algorithm with session-based variant.
-
SHA_256
public static final DigestScheme.DigestAlgorithm SHA_256
SHA-256 digest algorithm.
-
SHA_256_SESS
public static final DigestScheme.DigestAlgorithm SHA_256_SESS
SHA-256 digest algorithm with session-based variant.
-
SHA_512_256
public static final DigestScheme.DigestAlgorithm SHA_512_256
SHA-512/256 digest algorithm.
-
SHA_512_256_SESS
public static final DigestScheme.DigestAlgorithm SHA_512_256_SESS
SHA-512/256 digest algorithm with session-based variant.
-
-
Constructor Detail
-
DigestAlgorithm
private DigestAlgorithm(java.lang.String baseAlgorithm, boolean sessionBased)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 Detail
-
values
public static DigestScheme.DigestAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DigestScheme.DigestAlgorithm c : DigestScheme.DigestAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DigestScheme.DigestAlgorithm valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getBaseAlgorithm
private java.lang.String 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
private static DigestScheme.DigestAlgorithm fromString(java.lang.String algorithm)
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
-
-