Package io.milton.http.http11.auth
Class DigestGenerator
java.lang.Object
io.milton.http.http11.auth.DigestGenerator
- Author:
- brad
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodePasswordInA1Format(String username, String realm, String password) generateDigest(DigestResponse dr, String password) Computes theresponseportion of a Digest authentication header.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)
-
Constructor Details
-
DigestGenerator
public DigestGenerator()
-
-
Method Details
-
generateDigest
Computes theresponseportion of a Digest authentication header. Both the server and user agent should compute theresponseindependently. Provided as a static method to simplify the coding of user agents.- Parameters:
dr- - the auth request from the clientpassword- - 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
-
md5
-