All Packages Class Hierarchy This Package Previous Next Index
Class is.logi.crypto.hash.HashState
java.lang.Object
|
+----is.logi.crypto.Crypto
|
+----is.logi.crypto.hash.HashState
- public abstract class HashState
- extends Crypto
An object of this class holds the status of a fingerprint still being
calculated.
A fingerprint state object can be repeatedly updated with data. At
any time a Fingerprint object can be requested for the data that has
then been added to the fingerprint state.
- Author:
- Logi Ragnarsson (logir@hi.is)
- See Also:
- SHA1State, Fingerprint, Signature
-
HashState()
-
-
blockSize()
- Return the number of bytes needed to make a valid hash.
-
calculate()
- Return a fingerprint for the curret state, without
destroying the state.
-
create(String)
- Create a HashState object for the named fingerprint
algorithm.
-
getName()
- Return the name of the algorithm used by this HashState object.
-
hashSize()
- Returns the size of a fingerprint in bytes.
-
reset()
- Reset the state.
-
update(byte[])
- Update the fingerprint state with the bytes from
buf
.
-
update(byte[], int, int)
- Update the fingerprint state with the bytes from
buf[offset, offset+length-1]
.
-
update(String)
- Update the fingerprint state with the characters from
s
.
HashState
public HashState()
create
public static HashState create(String algorithm) throws InvalidCDSException
- Create a HashState object for the named fingerprint
algorithm.
- Throws: InvalidCDSException
- if a HashState object for the
named algorithm could not be created.
getName
public abstract String getName()
- Return the name of the algorithm used by this HashState object.
reset
public abstract void reset()
- Reset the state.
update
public abstract void update(byte buf[],
int offset,
int length)
- Update the fingerprint state with the bytes from
buf[offset, offset+length-1]
.
update
public void update(byte buf[])
- Update the fingerprint state with the bytes from
buf
.
update
public void update(String s)
- Update the fingerprint state with the characters from
s
.
calculate
public abstract Fingerprint calculate()
- Return a fingerprint for the curret state, without
destroying the state.
blockSize
public abstract int blockSize()
- Return the number of bytes needed to make a valid hash. If a multiple
of this number of bytes is hashed, no padding is needed. If no such
value exists, returns 0.
hashSize
public abstract int hashSize()
- Returns the size of a fingerprint in bytes.
All Packages Class Hierarchy This Package Previous Next Index