AXL Software

com.theorem.radserver3.radutil
Class MD4Provider

Object
  extended byMessageDigestSpi
      extended byMessageDigest
          extended byMD4Provider
All Implemented Interfaces:
Cloneable

public class MD4Provider
extends MessageDigest
implements Cloneable

Message Digest for MD4, fallback for no MD at all in the PRNG.


Method Summary
 Object clone()
          Returns a clone if the implementation is cloneable.
 byte[] digest()
          Completes the hash computation by performing final operations such as padding.
 byte[] digest(byte[] input)
          Performs a final update on the digest using the specified array of bytes, then completes the digest computation.
 int digest(byte[] input, int offset, int len)
          Completes the hash computation by performing final operations such as padding.
static MessageDigest getInstance(String algorithm)
          Generates a MessageDigest object that implements the specified digest algorithm.
static MessageDigest getInstance(String algorithm, String provider)
          Generates a MessageDigest object implementing the specified algorithm, as supplied from the specified provider, if such an algorithm is available from the provider.
static boolean isEqual(byte[] digesta, byte[] digestb)
          Compares two digests for equality.
 void reset()
          Resets the digest for further use.
 String toString()
          Returns a string representation of this message digest object.
 void update(byte input)
          Updates the digest using the specified byte.
 void update(byte[] input)
          Updates the digest using the specified array of bytes
 void update(byte[] input, int offset, int len)
          Updates the digest using the specified array of bytes, starting at the specified offset.
 
Methods inherited from class MessageDigest
getAlgorithm, getDigestLength, getInstance, getProvider
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

clone

public Object clone()
                       throws CloneNotSupportedException
Returns a clone if the implementation is cloneable. In reality it returns a new instance. Never throws CloneNotSupportedException.

Throws:
CloneNotSupportedException

digest

public byte[] digest()
Completes the hash computation by performing final operations such as padding. The digest is reset after this call is made.


digest

public byte[] digest(byte[] input)
Performs a final update on the digest using the specified array of bytes, then completes the digest computation. That is, this method first calls update(input), passing the input array to the update method, then calls digest().


digest

public int digest(byte[] input,
                  int offset,
                  int len)
           throws DigestException
Completes the hash computation by performing final operations such as padding. The digest is reset after this call is made.

Throws:
DigestException

getInstance

public static MessageDigest getInstance(String algorithm)
                                               throws NoSuchAlgorithmException
Generates a MessageDigest object that implements the specified digest algorithm.

In fact it creates a new MessageDigest.

Throws:
NoSuchAlgorithmException

getInstance

public static MessageDigest getInstance(String algorithm,
                                        String provider)
                                               throws NoSuchAlgorithmException,
                                                      NoSuchProviderException
Generates a MessageDigest object implementing the specified algorithm, as supplied from the specified provider, if such an algorithm is available from the provider.

In fact it creates a new MessageDigest.

Throws:
NoSuchAlgorithmException
NoSuchProviderException

isEqual

public static boolean isEqual(byte[] digesta,
                              byte[] digestb)
Compares two digests for equality. Does a simple byte compare.


reset

public void reset()
Resets the digest for further use.


toString

public String toString()
Returns a string representation of this message digest object.


update

public void update(byte input)
Updates the digest using the specified byte.


update

public void update(byte[] input)
Updates the digest using the specified array of bytes


update

public void update(byte[] input,
                   int offset,
                   int len)
Updates the digest using the specified array of bytes, starting at the specified offset.


AXL Software

Submit a bug report or feature request

Copyright 1998-2010 AXL Software PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.