org.objectweb.jonas.security.realm.lib.HashHelper Class Reference

List of all members.

Static Public Member Functions

HashPassword getHashPassword (String password)
char[] hexDump (byte[] src)
void smudge (char[] pwd)
void smudge (byte[] pwd)
String hashPassword (char[] pwd) throws NoSuchAlgorithmException
String hashPassword (char[] pwd, String algo) throws NoSuchAlgorithmException
String hashPassword (String string, String algo) throws NoSuchAlgorithmException

Static Public Attributes

final String DEFAULT_ALGO = "MD5"

Detailed Description

Methods to hash Strings. All the methods in here are static so HashHelper should never be instantiated.
Author:
Andy Armstrong, andy@tagish.com

Yann Petiot for the modifications

Florent Benoit modifications for integration in JOnAS

Definition at line 38 of file HashHelper.java.


Member Function Documentation

HashPassword org.objectweb.jonas.security.realm.lib.HashHelper.getHashPassword String  password  )  [static]
 

Return the haspassword object from a string. It extracts algorithm and password from the string

Parameters:
password contain password and algorithm
Returns:
the haspassword object

Definition at line 93 of file HashHelper.java.

String org.objectweb.jonas.security.realm.lib.HashHelper.hashPassword String  string,
String  algo
throws NoSuchAlgorithmException [static]
 

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. The hash is computed on the low 8 bits of each character.

Parameters:
string The password to hash
algo The type of Message Digest Algorithms
Returns:
a string representation of the hash password
Exceptions:
NoSuchAlgorithmException if the algorithm can not be found

Definition at line 214 of file HashHelper.java.

String org.objectweb.jonas.security.realm.lib.HashHelper.hashPassword char[]  pwd,
String  algo
throws NoSuchAlgorithmException [static]
 

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. The hash is computed on the low 8 bits of each character.

Parameters:
pwd The password to hash
algo The type of Message Digest Algorithms
Returns:
a string representation of the hash password
Exceptions:
NoSuchAlgorithmException if the algorithm can not be found

Definition at line 186 of file HashHelper.java.

String org.objectweb.jonas.security.realm.lib.HashHelper.hashPassword char[]  pwd  )  throws NoSuchAlgorithmException [static]
 

Performs the default algorithm hashing on the supplied password and return a char array containing the password as a printable string. The hash is computed on the low 8 bits of each character.

Parameters:
pwd The password to hash
Returns:
a string representation of the hash password
Exceptions:
NoSuchAlgorithmException if this is not a valid algorithm

Definition at line 172 of file HashHelper.java.

char [] org.objectweb.jonas.security.realm.lib.HashHelper.hexDump byte[]  src  )  [static]
 

Turn a byte array into a char array containing a printable hex representation of the bytes. Each byte in the source array contributes a pair of hex digits to the output array.

Parameters:
src the source array
Returns:
a char array containing a printable version of the source data

Definition at line 121 of file HashHelper.java.

void org.objectweb.jonas.security.realm.lib.HashHelper.smudge byte[]  pwd  )  [static]
 

Zero the contents of the specified array.

Parameters:
pwd the array to zero

Definition at line 156 of file HashHelper.java.

void org.objectweb.jonas.security.realm.lib.HashHelper.smudge char[]  pwd  )  [static]
 

Zero the contents of the specified array. Typically used to erase temporary storage that has held plaintext passwords so that we don't leave them lying around in memory.

Parameters:
pwd the array to zero

Definition at line 144 of file HashHelper.java.


Member Data Documentation

final String org.objectweb.jonas.security.realm.lib.HashHelper.DEFAULT_ALGO = "MD5" [static]
 

The default algorithm

Definition at line 63 of file HashHelper.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:07:55 2005 for JOnAS by  doxygen 1.3.9.1