|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.security.internal.realm.lib.HashHelper
public class HashHelper
Methods to hash Strings. All the methods in here are static so HashHelper should never be instantiated.
| Field Summary | |
|---|---|
static String |
DEFAULT_ALGO
The default algorithm |
| Method Summary | |
|---|---|
static org.ow2.jonas.security.realm.lib.HashPassword |
getHashPassword(String password)
Return the haspassword object from a string. |
static String |
hashPassword(char[] pwd)
Performs the default algorithm hashing on the supplied password and return a char array containing the password as a printable string. |
static String |
hashPassword(char[] pwd,
String algo)
Performs an algorithm specified by the user hashing on the supplied password and return a char array containing the encrypted password as a printable string. |
static String |
hashPassword(String string,
String algo)
Performs an algorithm specified by the user hashing on the supplied password and return a char array containing the encrypted password as a printable string. |
static char[] |
hexDump(byte[] src)
Turn a byte array into a char array containing a printable hex representation of the bytes. |
static void |
smudge(byte[] pwd)
Zero the contents of the specified array. |
static void |
smudge(char[] pwd)
Zero the contents of the specified array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_ALGO
| Method Detail |
|---|
public static org.ow2.jonas.security.realm.lib.HashPassword getHashPassword(String password)
password - contain password and algorithm
public static char[] hexDump(byte[] src)
src - the source array
public static void smudge(char[] pwd)
pwd - the array to zeropublic static void smudge(byte[] pwd)
pwd - the array to zero
public static String hashPassword(char[] pwd)
throws NoSuchAlgorithmException
pwd - The password to hash
NoSuchAlgorithmException - if this is not a valid algorithm
public static String hashPassword(char[] pwd,
String algo)
throws NoSuchAlgorithmException
pwd - The password to hashalgo - The type of Message Digest Algorithms
NoSuchAlgorithmException - if the algorithm can not be found
public static String hashPassword(String string,
String algo)
throws NoSuchAlgorithmException
string - The password to hashalgo - The type of Message Digest Algorithms
NoSuchAlgorithmException - if the algorithm can not be found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||