Class java.crypt.SHA
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.crypt.SHA

java.lang.Object
   |
   +----java.crypt.MessageDigest
           |
           +----java.crypt.SHA

public final class SHA
extends MessageDigest
This class implements the SHA message digest.

The native code SHA implementation used by the class was developed by Peter C. Gutmann from the implementation in Bruce Schneiers "Applied Cryptography".

Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/) All rights reserved.


Variable Index

 o HASH_LENGTH
This is the length of the final hash (in bytes).

Constructor Index

 o SHA()
The public constructor.

Method Index

 o addToDigest(byte[], int, int)
Add data to the message digest (calls the native code).
 o digest()
Returns the digest of the data added and resets the digest.
 o length()
Return length of the hash (in bytes).
 o reset()
Initialise (reset) the message digest.

Variables

 o HASH_LENGTH
  public final static int HASH_LENGTH
This is the length of the final hash (in bytes).

Constructors

 o SHA
  public SHA()
The public constructor.

Methods

 o length
  public int length()
Return length of the hash (in bytes).
Returns:
The length of the hash.
Overrides:
length in class MessageDigest
See Also:
HASH_LENGTH
 o reset
  public void reset()
Initialise (reset) the message digest.
Overrides:
reset in class MessageDigest
 o digest
  public byte[] digest()
Returns the digest of the data added and resets the digest.
Returns:
the digest of all the data added to the message digest.
Overrides:
digest in class MessageDigest
 o addToDigest
  protected void addToDigest(byte data[],
                             int offset,
                             int length)
Add data to the message digest (calls the native code).
Parameters:
data - The data to be added.
offset - The start of the data in the array.
length - The amount of data to add.
Overrides:
addToDigest in class MessageDigest

All Packages  Class Hierarchy  This Package  Previous  Next  Index