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

private static enum DigestScheme.DigestAlgorithm extends Enum<DigestScheme.DigestAlgorithm>
Enum representing supported digest algorithms for HTTP Digest Authentication, including session-based variants.
Since:
4.0
  • Enum Constant Details

  • Field Details

    • baseAlgorithm

      private final String baseAlgorithm
    • sessionBased

      private final boolean sessionBased
  • Constructor Details

    • DigestAlgorithm

      private DigestAlgorithm(String baseAlgorithm, boolean sessionBased)
      Constructor for DigestAlgorithm.
      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

      public static DigestScheme.DigestAlgorithm[] 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

      public static DigestScheme.DigestAlgorithm valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getBaseAlgorithm

      private 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:
      true if the algorithm includes the "-sess" suffix, otherwise false
    • fromString

      private static DigestScheme.DigestAlgorithm fromString(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 DigestAlgorithm constant
      Throws:
      UnsupportedDigestAlgorithmException - if the algorithm is unsupported