com.generationjava.security
Class Securer

java.lang.Object
  |
  +--com.generationjava.security.Securer

public class Securer
extends java.lang.Object

Utility class to make it easier to get hashed values.


Field Summary
static Constant ADLER
           
static Constant CRC
           
static Constant HASH
           
static Constant UID
           
 
Constructor Summary
Securer()
          Get a Securer for MD5.
Securer(java.lang.String algorithm)
          Get a Securer for a particular algorithm.
 
Method Summary
 java.lang.String getHash(java.lang.String input)
          Get the hash for a string in hexadecimal string form.
static Securer getSecurer(java.lang.Object algorithm)
           
 boolean hashEquals(java.lang.String hashed, java.lang.String plain)
          See if a hashed value and a plain unhashed value are equal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRC

public static Constant CRC

UID

public static Constant UID

ADLER

public static Constant ADLER

HASH

public static Constant HASH
Constructor Detail

Securer

public Securer(java.lang.String algorithm)
        throws java.security.NoSuchAlgorithmException
Get a Securer for a particular algorithm.

Throws:
java.security.NoSuchAlgorithmException - if the algorithm does not exist.

Securer

public Securer()
Get a Securer for MD5. Throws a RuntimeException if MD5 is unavailable.

Method Detail

getSecurer

public static Securer getSecurer(java.lang.Object algorithm)
                          throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException

getHash

public java.lang.String getHash(java.lang.String input)
Get the hash for a string in hexadecimal string form.

Parameters:
input - String to hash
Returns:
String hexadecimal hashed value

hashEquals

public boolean hashEquals(java.lang.String hashed,
                          java.lang.String plain)
See if a hashed value and a plain unhashed value are equal.

Parameters:
hashed - String hashed value.
plain - String unhashed value.
Returns:
boolean was the hashed value the hash of the plain text.


Copyright © 2000-2003 GenerationJava. All Rights Reserved.