org.bouncycastle.crypto.macs

Class HMac

Implemented Interfaces:
Mac

public class HMac
extends java.lang.Object
implements Mac

HMAC implementation based on RFC2104 H(K XOR opad, H(K XOR ipad, text))

Constructor Summary

HMac(Digest digest)
Base constructor for one of the standard digest algorithms that the byteLength of the algorithm is know for.

Method Summary

int
doFinal(byte[] out, int outOff)
String
getAlgorithmName()
int
getMacSize()
Digest
getUnderlyingDigest()
void
init(CipherParameters params)
void
reset()
Reset the mac generator.
void
update(byte in)
void
update(byte[] in, int inOff, int len)

Constructor Details

HMac

public HMac(Digest digest)
Base constructor for one of the standard digest algorithms that the byteLength of the algorithm is know for.
Parameters:
digest - the digest.

Method Details

doFinal

public int doFinal(byte[] out,
                   int outOff)
Specified by:
doFinal in interface Mac

getAlgorithmName

public String getAlgorithmName()
Specified by:
getAlgorithmName in interface Mac

getMacSize

public int getMacSize()
Specified by:
getMacSize in interface Mac

getUnderlyingDigest

public Digest getUnderlyingDigest()

init

public void init(CipherParameters params)
Specified by:
init in interface Mac

reset

public void reset()
Reset the mac generator.
Specified by:
reset in interface Mac

update

public void update(byte in)
Specified by:
update in interface Mac

update

public void update(byte[] in,
                   int inOff,
                   int len)
Specified by:
update in interface Mac