org.pf.security.crypto
Class HashedString

java.lang.Object
  extended by org.pf.security.crypto.HashedString

public class HashedString
extends java.lang.Object

Container for a SHA hashed password including salt if it is SSHA.

Version:
1.0
Author:
Manfred Duchrow

Constructor Summary
HashedString(java.lang.String password)
          Initialize the new instance with a hashed password.
 
Method Summary
 boolean isEqual(byte[] password)
          Compares the given clear text password with the hashed password.
 boolean isEqual(java.lang.String string)
          Compares the given clear text string with the hashed value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashedString

public HashedString(java.lang.String password)
Initialize the new instance with a hashed password.

Parameters:
password - A base64 encoded hash of a password with a prefix {SHA} or {SSHA}
Method Detail

isEqual

public boolean isEqual(java.lang.String string)
Compares the given clear text string with the hashed value. Returns true if the hash of the given string equals the hash in this object.


isEqual

public boolean isEqual(byte[] password)
Compares the given clear text password with the hashed password. Returns true if the hash of the given password equals the password hash in this object.