| java.lang.Object java.security.MessageDigestSpi sun.security.provider.SHA2
SHA2 | public class SHA2 extends MessageDigestSpi implements Cloneable(Code) | | This class implements the Secure Hash Algorithm SHA-256 developed by
the National Institute of Standards and Technology along with the
National Security Agency.
It implements java.security.MessageDigestSpi, and can be used
through Java Cryptography Architecture (JCA), as a pluggable
MessageDigest implementation.
version: 1.6 10/10/06 author: Valerie Peng |
Constructor Summary | |
public | SHA2() Creates a new SHA object. |
Method Summary | |
public Object | clone() | protected byte[] | engineDigest() Computes the final hash and returns the final value as a
byte[32] array. | protected int | engineDigest(byte[] hashvalue, int offset, int len) Computes the final hash and places the final value in the
specified array. | protected int | engineGetDigestLength() | protected void | engineReset() Resets the buffers and hash value to start a new hash. | protected void | engineUpdate(byte b) Update a byte. | protected void | engineUpdate(byte b, int off, int len) Update a buffer. |
SHA2 | public SHA2()(Code) | | Creates a new SHA object.
|
engineDigest | protected byte[] engineDigest()(Code) | | Computes the final hash and returns the final value as a
byte[32] array. The object is reset to be ready for further
use, as specified in the JavaSecurity MessageDigest
specification.
the digest |
engineDigest | protected int engineDigest(byte[] hashvalue, int offset, int len) throws DigestException(Code) | | Computes the final hash and places the final value in the
specified array. The object is reset to be ready for further
use, as specified in java.security.MessageDigest javadoc
specification.
Parameters: hashvalue - buffer to hold the digest Parameters: offset - offset for storing the digest Parameters: len - length of the buffer length of the digest in bytes |
engineGetDigestLength | protected int engineGetDigestLength()(Code) | | the length of the digest in bytes |
engineReset | protected void engineReset()(Code) | | Resets the buffers and hash value to start a new hash.
|
engineUpdate | protected void engineUpdate(byte b)(Code) | | Update a byte.
Parameters: b - the byte |
engineUpdate | protected void engineUpdate(byte b, int off, int len)(Code) | | Update a buffer.
Parameters: b - the data to be updated. Parameters: off - the start offset in the data Parameters: len - the number of bytes to be updated. |
|
|