Class Digest

java.lang.Object
org.restlet.data.Digest

public class Digest extends Object
Describes a digest value and the digest algorithm used. Digests can have several use cases such as ensuring the integrity of representations exchanges between resources, or for authentication purpose.
Author:
Jerome Louvel
See Also:
  • Field Details

    • ALGORITHM_MD2

      public static final String ALGORITHM_MD2
      Digest algorithm defined in RFC 1319.
      See Also:
    • ALGORITHM_MD5

      public static final String ALGORITHM_MD5
      Digest algorithm defined in RFC 1321.
      See Also:
    • ALGORITHM_NONE

      public static final String ALGORITHM_NONE
      No digest algorithm defined.
      See Also:
    • ALGORITHM_SHA_1

      public static final String ALGORITHM_SHA_1
      Digest algorithm defined in Secure Hash Standard, NIST FIPS 180-1.
      See Also:
    • ALGORITHM_SHA_256

      public static final String ALGORITHM_SHA_256
      NIST approved digest algorithm from SHA-2 family.
      See Also:
    • ALGORITHM_SHA_384

      public static final String ALGORITHM_SHA_384
      NIST approved digest algorithm from SHA-2 family.
      See Also:
    • ALGORITHM_SHA_512

      public static final String ALGORITHM_SHA_512
      NIST approved digest algorithm from SHA-2 family.
      See Also:
    • ALGORITHM_HTTP_DIGEST

      public static final String ALGORITHM_HTTP_DIGEST
      Digest algorithm for the HTTP DIGEST scheme. This is exactly the A1 value specified in RFC2617 which is a MD5 hash of the user name, realm and password, separated by a colon character.
      See Also:
  • Constructor Details

    • Digest

      public Digest(byte[] value)
      Constructor using the MD5 algorithm by default.
      Parameters:
      value - The digest value.
    • Digest

      public Digest(String algorithm, byte[] value)
      Constructor.
      Parameters:
      algorithm - The digest algorithm.
      value - The digest value.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getAlgorithm

      public String getAlgorithm()
      Returns the digest algorithm.
      Returns:
      The digest algorithm.
    • getValue

      public byte[] getValue()
      Returns the digest value.
      Returns:
      The digest value.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object