j_waste.crypto
Class SHA1Hash

java.lang.Object
  extended byj_waste.crypto.SHA1Hash

public class SHA1Hash
extends java.lang.Object

This class handles the computation of SHA1 hashes.

Version:
0.1
Author:
Fredrik Hultin (frehul@users.sourceforge.net)

Constructor Summary
SHA1Hash()
          Constructs a new SHA1 object.
 
Method Summary
 byte[] calculateHash()
          This method calculates the hash of the initialized values.
 void init(byte[] modulo, byte[] exponent)
          This method initializes SHA1 with the specified modulo and exponent.
 void init(java.lang.String key, boolean hex)
          This method initializes SHA1 with the specified key.
 void init(java.lang.String modulo, java.lang.String exponent)
          This method initializes SHA1 with the specified modulo and exponent.
 void update(byte[] b, int offs, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHA1Hash

public SHA1Hash()
Constructs a new SHA1 object.

Method Detail

init

public void init(java.lang.String modulo,
                 java.lang.String exponent)
This method initializes SHA1 with the specified modulo and exponent.

Parameters:
modulo - The modulo that should be included in the hash.
exponent - The exponent that should be included in the hash.

init

public void init(byte[] modulo,
                 byte[] exponent)
This method initializes SHA1 with the specified modulo and exponent.

Parameters:
modulo - The modulo that should be included in the hash.
exponent - The exponent that should be included in the hash.

update

public void update(byte[] b,
                   int offs,
                   int len)

init

public void init(java.lang.String key,
                 boolean hex)
This method initializes SHA1 with the specified key.

Parameters:
key - The key that should be included in the hash.
hex - If true then "key" is Hex decoded, otherwise not.

calculateHash

public byte[] calculateHash()
This method calculates the hash of the initialized values.

Returns:
Returns the calculated hash.