For the latest news and information visit
The GNU Crypto project

gnu.crypto.jce.mac
Class MacAdapter

java.lang.Object
  extended by javax.crypto.MacSpi
      extended by gnu.crypto.jce.mac.MacAdapter
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
HMacHavalSpi, HMacMD2Spi, HMacMD4Spi, HMacMD5Spi, HMacRipeMD128Spi, HMacRipeMD160Spi, HMacSHA160Spi, HMacSHA256Spi, HMacSHA384Spi, HMacSHA512Spi, HMacTigerSpi, HMacWhirlpoolSpi, OMacAnubisImpl, OMacBlowfishImpl, OMacCast5Impl, OMacDESImpl, OMacImpl, OMacKhazadImpl, OMacRijndaelImpl, OMacSerpentImpl, OMacSquareImpl, OMacTripleDESImpl, OMacTwofishImpl, TMMH16Spi, UHash32Spi, UMac32Spi

 class MacAdapter
extends MacSpi
implements Cloneable

The implementation of a generic Mac adapter class to wrap GNU Crypto MAC instances.

This class defines the Service Provider Interface (SPI) for the Mac class, which provides the functionality of a message authentication code algorithm, such as the Hashed Message Authentication Code (HMAC) algorithms.

Version:
$Revision: 1.4 $

Field Summary
protected  Map attributes
          Our MAC attributes.
protected  IMac mac
          Our MAC instance.
 
Constructor Summary
protected MacAdapter(String name)
          Creates a new Mac instance for the given name.
 
Method Summary
 Object clone()
           
protected  byte[] engineDoFinal()
           
protected  int engineGetMacLength()
           
protected  void engineInit(Key key, AlgorithmParameterSpec params)
           
protected  void engineReset()
           
protected  void engineUpdate(byte b)
           
protected  void engineUpdate(byte[] in, int off, int len)
           
 
Methods inherited from class javax.crypto.MacSpi
engineUpdate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mac

protected IMac mac
Our MAC instance.


attributes

protected Map attributes
Our MAC attributes.

Constructor Detail

MacAdapter

protected MacAdapter(String name)

Creates a new Mac instance for the given name.

Parameters:
name - The name of the mac to create.
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class MacSpi
Throws:
CloneNotSupportedException

engineDoFinal

protected byte[] engineDoFinal()
Specified by:
engineDoFinal in class MacSpi

engineGetMacLength

protected int engineGetMacLength()
Specified by:
engineGetMacLength in class MacSpi

engineInit

protected void engineInit(Key key,
                          AlgorithmParameterSpec params)
                   throws InvalidKeyException,
                          InvalidAlgorithmParameterException
Specified by:
engineInit in class MacSpi
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

engineReset

protected void engineReset()
Specified by:
engineReset in class MacSpi

engineUpdate

protected void engineUpdate(byte b)
Specified by:
engineUpdate in class MacSpi

engineUpdate

protected void engineUpdate(byte[] in,
                            int off,
                            int len)
Specified by:
engineUpdate in class MacSpi

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.