Package netscape.security.provider
Class SHA
- java.lang.Object
-
- java.security.MessageDigestSpi
-
- netscape.security.provider.SHA
-
- All Implemented Interfaces:
java.lang.Cloneable
public class SHA extends java.security.MessageDigestSpi implements java.lang.CloneableThis class implements the Secure Hash Algorithm (SHA) developed by the National Institute of Standards and Technology along with the National Security Agency. This is the updated version of SHA fip-180 as superseded by fip-180-1.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.
- Version:
- 1.30 97/12/10
- Author:
- Roger Riggs, Benjamin Renaud
-
-
Constructor Summary
Constructors Constructor Description SHA()Creates a new SHA object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()byte[]engineDigest()Computes the final hash and returns the final value as a byte[20] array.intengineDigest(byte[] hashvalue, int offset, int len)Computes the final hash and returns the final value as a byte[20] array.protected intengineGetDigestLength()Return the length of the digest in bytesvoidengineReset()Resets the buffers and hash value to start a new hash.voidengineUpdate(byte b)voidengineUpdate(byte[] b, int off, int len)Update a buffer.voidinit()Resets the buffers and hash value to start a new hash.
-
-
-
Method Detail
-
engineGetDigestLength
protected int engineGetDigestLength()
Return the length of the digest in bytes- Overrides:
engineGetDigestLengthin classjava.security.MessageDigestSpi
-
engineUpdate
public void engineUpdate(byte b)
- Specified by:
engineUpdatein classjava.security.MessageDigestSpi
-
engineUpdate
public void engineUpdate(byte[] b, int off, int len)Update a buffer.- Specified by:
engineUpdatein classjava.security.MessageDigestSpi- Parameters:
b- the data to be updated.off- the start offset in the datalen- the number of bytes to be updated.
-
init
public void init()
Resets the buffers and hash value to start a new hash.
-
engineReset
public void engineReset()
Resets the buffers and hash value to start a new hash.- Specified by:
engineResetin classjava.security.MessageDigestSpi
-
engineDigest
public byte[] engineDigest()
Computes the final hash and returns the final value as a byte[20] array. The object is reset to be ready for further use, as specified in the JavaSecurity MessageDigest specification.- Specified by:
engineDigestin classjava.security.MessageDigestSpi
-
engineDigest
public int engineDigest(byte[] hashvalue, int offset, int len) throws java.security.DigestExceptionComputes the final hash and returns the final value as a byte[20] array. The object is reset to be ready for further use, as specified in the JavaSecurity MessageDigest specification.- Overrides:
engineDigestin classjava.security.MessageDigestSpi- Throws:
java.security.DigestException
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.security.MessageDigestSpi
-
-