Enum Class DigestAlgorithm

java.lang.Object
java.lang.Enum<DigestAlgorithm>
net.visma.autopay.http.digest.DigestAlgorithm
All Implemented Interfaces:
Serializable, Comparable<DigestAlgorithm>, Constable

public enum DigestAlgorithm extends Enum<DigestAlgorithm>
Hash algorithms. Algorithms with status Deprecated are not handled.
See Also:
  • Enum Constant Details

  • Method Details

    • values

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

      public static DigestAlgorithm valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getHttpKey

      public String getHttpKey()
      Returns algorithm key to be used as dictionary key in Digest HTTP headers
      Returns:
      Algorithm key as defined in Digest Fields
    • getJvmName

      public String getJvmName()
      Returns "JVM" name of this algorithm, which then can be used to call MessageDigest.getInstance(String)
      Returns:
      JVM name of this algorithm
    • fromHttpKey

      public static Optional<DigestAlgorithm> fromHttpKey(String httpKey)
      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