org.jboss.seam.security.management
Class PasswordHash

java.lang.Object
  extended by org.jboss.seam.security.management.PasswordHash

@Scope(value=STATELESS)
@Name(value="org.jboss.seam.security.passwordHash")
@Install(precedence=0)
@BypassInterceptors
public class PasswordHash
extends Object

Password hashing utility functions

Author:
Shane Bryzak

Field Summary
static String ALGORITHM_MD5
           
static String ALGORITHM_SHA
           
 
Constructor Summary
PasswordHash()
           
 
Method Summary
 String createPasswordKey(char[] password, byte[] salt, int iterations)
           
 String generateHash(String password)
          Deprecated. 
 String generateHash(String password, String algorithm)
          Deprecated. 
 byte[] generateRandomSalt()
           
 String generateSaltedHash(String password, String saltPhrase)
          Deprecated. 
 String generateSaltedHash(String password, String saltPhrase, String algorithm)
          Deprecated. Use PasswordHash.createPasswordKey() instead
 String getHashAlgorithm()
           
 int getSaltLength()
           
static PasswordHash instance()
           
 void setHashAlgorithm(String hashAlgorithm)
           
 void setSaltLength(int saltLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALGORITHM_MD5

public static final String ALGORITHM_MD5
See Also:
Constant Field Values

ALGORITHM_SHA

public static final String ALGORITHM_SHA
See Also:
Constant Field Values
Constructor Detail

PasswordHash

public PasswordHash()
Method Detail

generateHash

@Deprecated
public String generateHash(String password)
Deprecated. 


generateHash

@Deprecated
public String generateHash(String password,
                                      String algorithm)
Deprecated. 


generateSaltedHash

@Deprecated
public String generateSaltedHash(String password,
                                            String saltPhrase)
Deprecated. 


generateSaltedHash

@Deprecated
public String generateSaltedHash(String password,
                                            String saltPhrase,
                                            String algorithm)
Deprecated. Use PasswordHash.createPasswordKey() instead


generateRandomSalt

public byte[] generateRandomSalt()

createPasswordKey

public String createPasswordKey(char[] password,
                                byte[] salt,
                                int iterations)
                         throws GeneralSecurityException
Throws:
GeneralSecurityException

instance

public static PasswordHash instance()

getHashAlgorithm

public String getHashAlgorithm()

setHashAlgorithm

public void setHashAlgorithm(String hashAlgorithm)

getSaltLength

public int getSaltLength()

setSaltLength

public void setSaltLength(int saltLength)