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.
   
  -   HASH_LENGTH HASH_LENGTH
-  This is the length of the final hash (in bytes).
   
  -   SHA() SHA()
-  The public constructor.
   
  -   addToDigest(byte[], int, int) addToDigest(byte[], int, int)
-  Add data to the message digest (calls the native code).
  
-   digest() digest()
-  Returns the digest of the data added and resets the digest.
  
-   length() length()
-  Return length of the hash (in bytes).
  
-   reset() reset()
-  Initialise (reset) the message digest.
   
 HASH_LENGTH
HASH_LENGTH
  public final static int HASH_LENGTH
  -  This is the length of the final hash (in bytes).
   
 SHA
SHA
  public SHA()
  -  The public constructor.
   
 length
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
  
 
 reset
reset
  public void reset()
  -  Initialise (reset) the message digest.
  
    -  Overrides:
    
-  reset in class MessageDigest
  
 
 digest
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
  
 
 addToDigest
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