You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.




org.mozilla.jss.crypto
Class JSSMessageDigest

java.lang.Object
  extended by org.mozilla.jss.crypto.JSSMessageDigest
Direct Known Subclasses:
PK11MessageDigest

Deprecated. Use the JCA interface instead (MessageDigest)

public abstract class JSSMessageDigest
extends java.lang.Object

A class for performing message digesting (hashing) and MAC operations.


Constructor Summary
JSSMessageDigest()
          Deprecated.  
 
Method Summary
 byte[] digest()
          Deprecated. Completes digestion.
 byte[] digest(byte[] input)
          Deprecated. Provides final data to the digest, then completes it and returns the output.
abstract  int digest(byte[] buf, int offset, int len)
          Deprecated. Completes digesting, storing the result into the provided array.
abstract  DigestAlgorithm getAlgorithm()
          Deprecated. Returns the algorithm that this digest uses.
 int getOutputSize()
          Deprecated. Returns the length of the digest created by this digest's digest algorithm.
abstract  void initHMAC(SymmetricKey key)
          Deprecated. Initializes an HMAC digest with the given symmetric key.
abstract  void reset()
          Deprecated. Resets this digest for further use.
 void update(byte input)
          Deprecated. Updates the digest with a single byte of input.
 void update(byte[] input)
          Deprecated. Updates the digest with an array.
abstract  void update(byte[] input, int offset, int len)
          Deprecated. Updates the digest with a portion of an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSSMessageDigest

public JSSMessageDigest()
Deprecated. 
Method Detail

initHMAC

public abstract void initHMAC(SymmetricKey key)
                       throws java.security.DigestException,
                              java.security.InvalidKeyException
Deprecated. 
Initializes an HMAC digest with the given symmetric key. This also has the effect of resetting the digest.

Throws:
java.security.DigestException - If this algorithm is not an HMAC algorithm.
java.security.InvalidKeyException - If the given key is not valid.

update

public void update(byte input)
            throws java.security.DigestException
Deprecated. 
Updates the digest with a single byte of input.

Throws:
java.security.DigestException

update

public abstract void update(byte[] input,
                            int offset,
                            int len)
                     throws java.security.DigestException
Deprecated. 
Updates the digest with a portion of an array.

Parameters:
input - An array from which to update the digest.
offset - The index in the array at which to start digesting.
len - The number of bytes to digest.
Throws:
java.security.DigestException - If an error occurs while digesting.

update

public void update(byte[] input)
            throws java.security.DigestException
Deprecated. 
Updates the digest with an array.

Parameters:
input - An array to feed to the digest.
Throws:
java.security.DigestException - If an error occurs while digesting.

digest

public byte[] digest()
              throws java.security.DigestException
Deprecated. 
Completes digestion.

Parameters:
If - an error occurs while digesting.
Returns:
The, ahem, output of the digest operation.
Throws:
java.security.DigestException

digest

public abstract int digest(byte[] buf,
                           int offset,
                           int len)
                    throws java.security.DigestException
Deprecated. 
Completes digesting, storing the result into the provided array.

Parameters:
buf - The buffer in which to place the digest output.
offset - The offset in the buffer at which to store the output.
len - The amount of space available in the buffer for the digest output.
Returns:
The number of bytes actually stored into buf.
Throws:
java.security.DigestException - If the provided space is too small for the digest, or an error occurs with the digest.

digest

public byte[] digest(byte[] input)
              throws java.security.DigestException
Deprecated. 
Provides final data to the digest, then completes it and returns the output.

Parameters:
input - The digest's last meal.
Returns:
The completed digest.
Throws:
java.security.DigestException - If an error occurs while digesting.

reset

public abstract void reset()
                    throws java.security.DigestException
Deprecated. 
Resets this digest for further use. This clears all input and output streams. If this is an HMAC digest, the HMAC key is not cleared.

Throws:
java.security.DigestException

getAlgorithm

public abstract DigestAlgorithm getAlgorithm()
Deprecated. 
Returns the algorithm that this digest uses.


getOutputSize

public int getOutputSize()
Deprecated. 
Returns the length of the digest created by this digest's digest algorithm.

Returns:
The size in bytes of the output of this digest.