public class SHA
extends java.security.MessageDigestSpi
implements java.lang.Cloneable
It implement JavaSecurity MessageDigest, and can be used by in the Java Security framework, as a pluggable implementation, as a filter for the digest stream classes.
| Constructor and Description |
|---|
SHA()
Creates a new SHA object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
byte[] |
engineDigest()
Computes the final hash and returns the final value as a
byte[20] array.
|
int |
engineDigest(byte[] hashvalue,
int offset,
int len)
Computes the final hash and returns the final value as a
byte[20] array.
|
protected int |
engineGetDigestLength()
Return the length of the digest in bytes
|
void |
engineReset()
Resets the buffers and hash value to start a new hash.
|
void |
engineUpdate(byte b) |
void |
engineUpdate(byte[] b,
int off,
int len)
Update a buffer.
|
void |
init()
Resets the buffers and hash value to start a new hash.
|
protected int engineGetDigestLength()
engineGetDigestLength in class java.security.MessageDigestSpipublic void engineUpdate(byte b)
engineUpdate in class java.security.MessageDigestSpipublic void engineUpdate(byte[] b,
int off,
int len)
engineUpdate in class java.security.MessageDigestSpib - the data to be updated.off - the start offset in the datalen - the number of bytes to be updated.public void init()
public void engineReset()
engineReset in class java.security.MessageDigestSpipublic byte[] engineDigest()
engineDigest in class java.security.MessageDigestSpipublic int engineDigest(byte[] hashvalue,
int offset,
int len)
throws java.security.DigestException
engineDigest in class java.security.MessageDigestSpijava.security.DigestExceptionpublic java.lang.Object clone()
clone in class java.security.MessageDigestSpi