com.caucho.server.security
Class PasswordDigest

java.lang.Object
  extended by com.caucho.security.PasswordDigest
      extended by com.caucho.server.security.PasswordDigest
Direct Known Subclasses:
PasswordDigest

public class PasswordDigest
extends PasswordDigest

Calculates a digest for the user and password.

If the realm is missing, the digest will calculate:

 MD5(user + ':' + password)
 

If the realm is specified, the digest will calculate:

 MD5(user + ':' + realm + ':' + password)
 

The second version matches the way HTTP digest authentication is handled, so it is the preferred method for storing passwords.

The returned result is the base64 encoding of the digest.


Constructor Summary
PasswordDigest()
           
 
Method Summary
 
Methods inherited from class com.caucho.security.PasswordDigest
addDigestUTF8, addDigestUTF8, addDigestUTF8, addText, digestToBase64, digestToCharArray, digestToHex, digestToString, getAlgorithm, getFormat, getPasswordDigest, getPasswordDigest, getPasswordDigest, getPasswordDigest, getPasswordDigest, getPasswordDigest, getPasswordDigest, getRealm, getType, init, setAlgorithm, setFormat, setRealm, stringToDigest, stringToDigest, toString, updateDigest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PasswordDigest

public PasswordDigest()