|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas.security.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 java.lang.String |
DEFAULT_ALGO
The default algorithm |
Method Summary | |
---|---|
static HashPassword |
getHashPassword(java.lang.String password)
Return the haspassword object from a string. |
static java.lang.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 java.lang.String |
hashPassword(char[] pwd,
java.lang.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 java.lang.String |
hashPassword(java.lang.String string,
java.lang.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 java.lang.String DEFAULT_ALGO
Method Detail |
---|
public static HashPassword getHashPassword(java.lang.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 zeropublic static java.lang.String hashPassword(char[] pwd) throws java.security.NoSuchAlgorithmException
pwd
- The password to hash
java.security.NoSuchAlgorithmException
- if this is not a valid algorithmpublic static java.lang.String hashPassword(char[] pwd, java.lang.String algo) throws java.security.NoSuchAlgorithmException
pwd
- The password to hashalgo
- The type of Message Digest Algorithms
java.security.NoSuchAlgorithmException
- if the algorithm can not be foundpublic static java.lang.String hashPassword(java.lang.String string, java.lang.String algo) throws java.security.NoSuchAlgorithmException
string
- The password to hashalgo
- The type of Message Digest Algorithms
java.security.NoSuchAlgorithmException
- if the algorithm can not be found
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |