public class HmacCore extends MacSpi
MD algorithms, where MD can be SHA1 or MD5, etc. See RFC 2104 for spec.
It also contains the implementation classes for SHA-224, SHA-256, SHA-384, and SHA-512 HMACs.
Implementation copied from com.sun.crypto.provider.HmacCore.| Constructor and Description |
|---|
HmacCore(String messageDigestAlgorithmName,
int bl) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
engineDoFinal()
Completes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was
initialized with.
|
protected int |
engineGetMacLength()
Returns the length of the MAC in bytes.
|
protected void |
engineInit(Key key,
AlgorithmParameterSpec params)
Initializes the MAC with the given (secret) key and algorithm parameters.
|
protected void |
engineReset()
Resets the MAC for further use, maintaining the secret key that the MAC was initialized with.
|
protected void |
engineUpdate(byte input)
Processes the given byte.
|
protected void |
engineUpdate(byte[] input,
int offset,
int len)
Processes the first
len bytes in input, starting at offset inclusive. |
public HmacCore(String messageDigestAlgorithmName, int bl)
protected byte[] engineDoFinal()
MacSpiengineDoFinal in class MacSpiprotected int engineGetMacLength()
MacSpiengineGetMacLength in class MacSpiprotected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
MacSpiengineInit in class MacSpikey - the (secret) key.params - the algorithm parameters.InvalidKeyException - if the given key is inappropriate for initializing this MAC.InvalidAlgorithmParameterException - if the given algorithm parameters are inappropriate for this MAC.protected void engineReset()
MacSpiengineReset in class MacSpiprotected void engineUpdate(byte input)
MacSpiengineUpdate in class MacSpiinput - the input byte to be processed.protected void engineUpdate(byte[] input,
int offset,
int len)
MacSpilen bytes in input, starting at offset inclusive.engineUpdate in class MacSpiinput - the input buffer.offset - the offset in input where the input starts.len - the number of bytes to process.