Class DigestGenerator

java.lang.Object
io.milton.http.http11.auth.DigestGenerator

public class DigestGenerator extends Object
Author:
brad
  • Constructor Details

    • DigestGenerator

      public DigestGenerator()
  • Method Details

    • generateDigest

      public String generateDigest(DigestResponse dr, String password) throws IllegalArgumentException
      Computes the response portion of a Digest authentication header. Both the server and user agent should compute the response independently. Provided as a static method to simplify the coding of user agents.
      Parameters:
      dr - - the auth request from the client
      password - - plain text unencoded password
      Returns:
      the MD5 of the digest authentication response, encoded in hex
      Throws:
      IllegalArgumentException - if the supplied qop value is unsupported.
    • generateDigestWithEncryptedPassword

      public String generateDigestWithEncryptedPassword(DigestResponse dr, String a1Md5) throws IllegalArgumentException
      Use this method if you are persisting a one way hash of the user name, password and realm (referred to as a1md5 in the spec)
      Parameters:
      dr -
      a1Md5 -
      Returns:
      Throws:
      IllegalArgumentException
    • encodePasswordInA1Format

      public String encodePasswordInA1Format(String username, String realm, String password)
    • md5

      public String md5(String... ss)