|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pelzer.util.PasswordCrypt
public class PasswordCrypt
| Constructor Summary | |
|---|---|
PasswordCrypt()
|
|
| Method Summary | |
|---|---|
static String |
computePasswordHash(String password,
byte[] salt)
Uses PBKDF2WithHmacSHA1 to hash the password using the given salt, returning the has in encoded hexadecimal form. |
static String |
computePasswordHash(String password,
String salt)
Converts the salt into a byte array using stringToSalt(String) and
then calls computePasswordHash(String, byte[]) |
static byte[] |
generateRandomSalt()
Generates a random byte array to be used as a salt for computePasswordHash(String, byte[]) |
static byte[] |
stringToSalt(String string)
Uses SHA-1 to hash the given string and returns the byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PasswordCrypt()
| Method Detail |
|---|
public static String computePasswordHash(String password,
String salt)
stringToSalt(String) and
then calls computePasswordHash(String, byte[])
public static String computePasswordHash(String password,
byte[] salt)
public static byte[] generateRandomSalt()
computePasswordHash(String, byte[])
public static byte[] stringToSalt(String string)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||