Class PasswordHasher2Adapter

  extended by
All Implemented Interfaces:
PasswordHasher, PasswordHasher2,
Direct Known Subclasses:
SaltedDigestPasswordHasher, SaltedMD5PasswordHasher

public abstract class PasswordHasher2Adapter
extends java.lang.Object
implements PasswordHasher2

An adapter that implements the base PasswordHasher interface for PasswordHasher2 implementations. This passes a dummy login ID to the PasswordHasher2 interfaces, allowing the PasswordHasher2 to work in an old PasswordHasher environment. Note, however, that mixing the use of the PasswordHasher and PasswordHasher2 interfaces will fail (ie client and server must use the same interface).

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
Constructor Summary
Method Summary
 boolean checkPassword(java.lang.String pLoginPassword, java.lang.String pEncryptedPassword, java.lang.Object pHashKey)
          Returns true if the login password matches the encrypted password.
 java.lang.String encryptPassword(java.lang.String pPassword)
          Encrypts a password suitably for long-term storage.
 java.lang.String hashPasswordForLogin(java.lang.String pPassword)
          Performs the appropriate hashing function for a login process.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface
checkPassword, encryptPassword, getLoginPasswordHasher, getPasswordHashKey, hashPasswordForLogin

Field Detail


public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail


public PasswordHasher2Adapter()
Method Detail


public java.lang.String encryptPassword(java.lang.String pPassword)
Encrypts a password suitably for long-term storage.

Specified by:
encryptPassword in interface PasswordHasher


public boolean checkPassword(java.lang.String pLoginPassword,
                             java.lang.String pEncryptedPassword,
                             java.lang.Object pHashKey)
Returns true if the login password matches the encrypted password.

Specified by:
checkPassword in interface PasswordHasher


public java.lang.String hashPasswordForLogin(java.lang.String pPassword)
Performs the appropriate hashing function for a login process. This value will later be passed to checkPassword().

Specified by:
hashPasswordForLogin in interface PasswordHasher