com.bradmcevoy.http.http11.auth
Class DigestGenerator

java.lang.Object
  extended by com.bradmcevoy.http.http11.auth.DigestGenerator

public class DigestGenerator
extends java.lang.Object

Author:
brad

Constructor Summary
DigestGenerator()
           
 
Method Summary
 java.lang.String encodePasswordInA1Format(java.lang.String username, java.lang.String realm, java.lang.String password)
           
 java.lang.String generateDigest(DigestResponse dr, java.lang.String password)
          Computes the response portion of a Digest authentication header.
 java.lang.String generateDigestWithEncryptedPassword(DigestResponse dr, java.lang.String a1Md5)
          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)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigestGenerator

public DigestGenerator()
Method Detail

generateDigest

public java.lang.String generateDigest(DigestResponse dr,
                                       java.lang.String password)
                                throws java.lang.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:
java.lang.IllegalArgumentException - if the supplied qop value is unsupported.

generateDigestWithEncryptedPassword

public java.lang.String generateDigestWithEncryptedPassword(DigestResponse dr,
                                                            java.lang.String a1Md5)
                                                     throws java.lang.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:
java.lang.IllegalArgumentException

encodePasswordInA1Format

public java.lang.String encodePasswordInA1Format(java.lang.String username,
                                                 java.lang.String realm,
                                                 java.lang.String password)


Copyright © 2011. All Rights Reserved.