ostore.util
Class SHA1Verify

java.lang.Object
  |
  +--ostore.util.SHA1Verify
All Implemented Interfaces:
Cloneable, Digestible, QuickSerializable, SecureVerify

public class SHA1Verify
extends Object
implements SecureVerify

SHA1Verify is the class which stores a list of SHA1Hashes which sould be serially concatenated and hashed to produce a GUID or other verifier.

Version:
$Id: SHA1Verify.java,v 1.5 2002/04/04 05:02:48 hweather Exp $
Author:
Chris WElls

Field Summary
protected  SHA1Hash[] _hashes
          This is the array of SHA1Hashes
static int TYPE_CODE
           
 
Constructor Summary
SHA1Verify()
          Default constructor
SHA1Verify(byte[] data, int[] offset)
          Read the bytes of the value of this verifier in from the input byte array
SHA1Verify(int size)
          Initializing constructor
 
Method Summary
 void add_to_digest(SecureHashBuffer buffer)
          Specified by ostore.util.Digestible
 Object clone()
          Create a new SHA1Verify with the values of this one
 SHA1Hash[] getArray()
          This routine returns the array of hashes
 SHA1Hash getHash(int i)
          Get the i^th hash in this verifier
 int length()
          Return the length of the verification array
 void setHash(int i, SHA1Hash hash)
          Set the i^th hash in this verifier
 void to_bytes(byte[] data, int[] offset)
          Write the bytes of this verifier to the input byte array
 int type_code()
          Deprecated.  
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_CODE

public static final int TYPE_CODE

_hashes

protected SHA1Hash[] _hashes
This is the array of SHA1Hashes
Constructor Detail

SHA1Verify

public SHA1Verify()
Default constructor

SHA1Verify

public SHA1Verify(byte[] data,
                  int[] offset)
Read the bytes of the value of this verifier in from the input byte array
Parameters:
array - out of which to read the bytes of this verifier
offset - in data at which to begin reading

SHA1Verify

public SHA1Verify(int size)
Initializing constructor
Parameters:
size - is the number of hashes to store in this verifier
Method Detail

getHash

public SHA1Hash getHash(int i)
Get the i^th hash in this verifier
Parameters:
i - the index of the hash to get
Returns:
the i^th hash

setHash

public void setHash(int i,
                    SHA1Hash hash)
Set the i^th hash in this verifier
Parameters:
i - the index of the hash to set
hash - the value of the hash

getArray

public SHA1Hash[] getArray()
This routine returns the array of hashes
Returns:
the array of hashes

length

public int length()
Return the length of the verification array
Returns:
hash array length

clone

public Object clone()
             throws CloneNotSupportedException
Create a new SHA1Verify with the values of this one
Overrides:
clone in class Object
Parameters:
verify - the preexisting value of a SHA1Verify

to_bytes

public void to_bytes(byte[] data,
                     int[] offset)
Write the bytes of this verifier to the input byte array
Specified by:
to_bytes in interface QuickSerializable
Parameters:
array - into which to write the bytes of this verifier
offset - in data at which to begin writing
Returns:
number of bytes written

add_to_digest

public void add_to_digest(SecureHashBuffer buffer)
Specified by ostore.util.Digestible
Specified by:
add_to_digest in interface Digestible
Following copied from interface: ostore.util.Digestible
See Also:
SecureHashBuffer.add( byte ), SecureHashBuffer.add( byte[] ), SecureHashBuffer.add( byte[], int, int ), SecureHashBuffer.add( Digestible )

type_code

public int type_code()
Deprecated.  

Specified by ostore.util.QuickSerializable
Specified by:
type_code in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Returns:
an integer unique to this class