iaik.security.mac
Class HMacMd5

java.lang.Object
  |
  +--javax.crypto.MacSpi
        |
        +--iaik.security.mac.HMac
              |
              +--iaik.security.mac.HMacMd5

public class HMacMd5
extends HMac

This class implements the HMAC(Keyed-Hashing for Message Authentication) algorithm as defined in RFC 2104 with MD5 as message digest algorithm.

This class only instantiates the super HMac class and specifies Md5 as hash algorithm to be used.

An application wishing to perform a MAC computation, at first has to create a MAC object by instantiating the MAC class through a proper getInstance factory method thereby specifying the MAC algorithm to be used. Calculating a HMAC based on the Md5 hash algorithm, may be initiated as follows:

 MAC md5_HMAC = MAC.getInstance("HMAC/MD5");
 

After properly initializing the MAC object with one entity´s secret key, the data to be processed is applied by one (or more) calls to the update methods. The MAC computation is concluded by using doFinal. If the data can be processed without calling any update method, doFinal can be called immediately after initializing the MAC object:

 md5_HMAC.init(secret_key);
 byte[] mac_data = md5_HMAC.doFinal(data);
 

After the MAC finally has been calculated, the MAC object automatically is reset for being able to be used for further MAC computations, either by using the same secret key again, or using a new key by properly re-initializing this MAC object.

Version:
File Revision 13
See Also:
HMac, HMacSha, Md5

Constructor Summary
HMacMd5()
          Default constructor.
 
Methods inherited from class iaik.security.mac.HMac
engineDoFinal, engineGetMacLength, engineInit, engineReset, engineUpdate, engineUpdate
 
Methods inherited from class javax.crypto.MacSpi
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HMacMd5

public HMacMd5()
        throws NoSuchAlgorithmException
Default constructor. This constructor only calls the constructor of super HMac class thereby specifying Md5 as hash function to be used.
Throws:
NoSuchAlgorithmException - if there is no implementation for MD5

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK