|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SecureHash is the interface used to represent classes which are secure hashes An example is the SHA1 hash
Method Summary | |
byte[] |
bytes()
Returns the bytes contained in this hash |
void |
calculate(byte[] bytes,
SecureVerify verify)
This routine calculates the root hash for a given object and its slice of its verification tree (basically, this routine does what verify does, but instead of comparing the last hash to this hash and returning the result, it sets this hash's value to the last hash's value) |
void |
calculate(QuickSerializable qs,
SecureVerify verify)
This routine calculates the root hash for a given object and its slice of its verification tree (basically, this routine does what verify does, but instead of comparing the last hash to this hash and returning the result, it sets this hash's value to the last hash's value) |
Object |
clone()
This is the clone routine for Fragment. |
boolean |
equals(Object o)
Compares this SecureHash with another hash, and returns true iff they are the same type of hash and have the same byte representation |
String |
fullString()
Converts all bytes of this SecureHash to a human-readable String |
void |
hash(byte[] bytes)
Hashes over the input bytes |
SecureVerify[] |
hash(byte[][] array)
Creates a hierarchical hash over an array of byte arrays, and returns an array of SecureVerifiers, the i^th element of which contains the hashes along the tree of hashes to the root hash for the i^th byte array in the input array; This hash is set to the value of that root. |
void |
hash(byte[] bytes,
int offset,
int len)
Hashes over the input bytes, starting at offset, going for len |
void |
hash(Digestible o)
Hashes over a Digestible object |
SecureVerify[] |
hash(QuickSerializable[] array)
Creates a hierarchical hash over an array of objects, and returns an array of SecureVerifiers, the i^th element of which contains the hashes along the tree of hashes to the root hash for the i^th byte array in the input array; This hash is set to the value of that root. |
void |
hash(String str)
Hashes over the bytes of the input String |
int |
hashCode()
Calculates a Java hash code for this SecureHash object (typically by taking its lower order bytes) |
boolean |
isNull()
Determines if this SecureHash is a NULL hash or not. |
SecureHash |
nullHash()
Returns the implementation's NULL hash (typically all zeroes). |
int |
size()
Return the number of bytes used in the representation of this hash (for example, SHA1 uses 20 bytes) |
String |
toString()
Converts a few bytes of this SecureHash to a human-readable String |
boolean |
verify(byte[] bytes)
Verifies that the input bytes hash to this hash value |
boolean |
verify(byte[] bytes,
int offset,
int len)
Verifies that the input bytes hash to this hash value |
boolean |
verify(byte[] bytes,
SecureVerify verify)
Verifies that the input byte array, coupled with the input verification information, hashes to this hash's value |
boolean |
verify(Digestible o)
Verifies a Digestible object |
boolean |
verify(QuickSerializable o,
SecureVerify verify)
Verifies that the input object, coupled with the input verification information, hashes to this hash's value |
boolean |
verify(String str)
Verifies the input String |
Methods inherited from interface java.lang.Comparable |
compareTo |
Methods inherited from interface ostore.util.Digestible |
add_to_digest |
Methods inherited from interface ostore.util.QuickSerializable |
to_bytes, type_code |
Method Detail |
public int size()
public boolean isNull()
public SecureHash nullHash()
public byte[] bytes()
public boolean equals(Object o)
equals
in class Object
o
- the object with which to compare this SecureHashpublic int hashCode()
hashCode
in class Object
public void hash(byte[] bytes, int offset, int len)
bytes
- byte array over which to hashoffset
- offset in bytes[] at which to begin hashinglen
- number of bytes over which to hashpublic void hash(byte[] bytes)
bytes
- byte array over which to hashpublic void hash(Digestible o)
o
- the object over which to hashpublic void hash(String str)
str
- the String over which to hashpublic SecureVerify[] hash(byte[][] array)
array
- array of byte arrayspublic SecureVerify[] hash(QuickSerializable[] array)
array
- array of byte arrayspublic boolean verify(byte[] bytes, int offset, int len)
bytes
- byte array containing the bytes to verifyoffset
- offset in bytes[] at which to begin hashinglen
- number of bytes over which to hashpublic boolean verify(byte[] bytes)
bytes
- byte array to verifypublic boolean verify(Digestible o)
o
- the object over which to hashpublic boolean verify(String str)
str
- the String to verifypublic boolean verify(byte[] bytes, SecureVerify verify)
bytes
- bytes to verifyverify
- verification information to use to verify bytespublic boolean verify(QuickSerializable o, SecureVerify verify)
o
- object to verifyverify
- verification information to use to verify bytespublic void calculate(byte[] bytes, SecureVerify verify)
bytes
- bytes to calc a root hash forverify
- verification information to use in the calculationpublic void calculate(QuickSerializable qs, SecureVerify verify)
qs
- object to calc a root hash forverify
- verification information to use in the calculationpublic String toString()
toString
in class Object
public String fullString()
public Object clone() throws CloneNotSupportedException
clone
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |