com.mindbright.security.mac
Class HMAC

java.lang.Object
  extended bycom.mindbright.jce.crypto.MacSpi
      extended bycom.mindbright.security.mac.HMAC
Direct Known Subclasses:
HMACMD5, HMACRIPEMD160, HMACSHA1

public class HMAC
extends MacSpi

Class implementing message authentication through keyed hashing (referred to as HMAC) described in rfc2104


Field Summary
protected  int blockSize
           
protected  int hashLength
           
protected  MessageDigest inner
           
protected  MessageDigest innerClone
           
protected  byte[] innerHash
           
protected  byte[] k_ipad
           
protected  byte[] k_opad
           
protected  int macLength
           
protected  MessageDigest outer
           
protected  MessageDigest outerClone
           
protected  byte[] outerHash
           
 
Constructor Summary
protected HMAC(java.lang.String hashAlgorithm)
           
 
Method Summary
protected  byte[] engineDoFinal()
           
protected  int engineGetMacLength()
           
protected  void engineInit(Key key, AlgorithmParameterSpec params)
           
protected  void engineReset()
           
protected  void engineUpdate(byte input)
           
protected  void engineUpdate(byte[] input, int offset, int len)
           
 
Methods inherited from class com.mindbright.jce.crypto.MacSpi
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

macLength

protected int macLength

hashLength

protected int hashLength

blockSize

protected int blockSize

k_ipad

protected byte[] k_ipad

k_opad

protected byte[] k_opad

innerHash

protected byte[] innerHash

outerHash

protected byte[] outerHash

inner

protected MessageDigest inner

outer

protected MessageDigest outer

innerClone

protected MessageDigest innerClone

outerClone

protected MessageDigest outerClone
Constructor Detail

HMAC

protected HMAC(java.lang.String hashAlgorithm)
Method Detail

engineDoFinal

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

engineGetMacLength

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

engineInit

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

engineReset

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

engineUpdate

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

engineUpdate

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