gnu.crypto.mac

Class HMac

public class HMac extends BaseMac implements Cloneable

The implementation of the HMAC (Keyed-Hash Message Authentication Code).

HMAC can be used in combination with any iterated cryptographic hash function. HMAC also uses a secret key for calculation and verification of the message authentication values. The main goals behind this construction are

References:

  1. RFC 2104HMAC: Keyed-Hashing for Message Authentication.
    H. Krawczyk, M. Bellare, and R. Canetti.

Version: $Revision: 1.10 $

Field Summary
protected intblockSize
protected byte[]ipad
protected IMessageDigestipadHash
protected intmacSize
protected IMessageDigestopadHash
static StringUSE_WITH_PKCS5_V2
Constructor Summary
protected HMac(IMessageDigest underlyingHash)

Trivial constructor for use by concrete subclasses.

Method Summary
byte[]digest()
voidinit(Map attributes)
voidreset()
booleanselfTest()

Field Detail

blockSize

protected int blockSize

ipad

protected byte[] ipad

ipadHash

protected IMessageDigest ipadHash

macSize

protected int macSize

opadHash

protected IMessageDigest opadHash

USE_WITH_PKCS5_V2

public static final String USE_WITH_PKCS5_V2

Constructor Detail

HMac

protected HMac(IMessageDigest underlyingHash)

Trivial constructor for use by concrete subclasses.

Parameters: underlyingHash the underlying hash algorithm instance.

Method Detail

digest

public byte[] digest()

init

public void init(Map attributes)

reset

public void reset()

selfTest

public boolean selfTest()
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.