- java.lang.Object
-
- javax.crypto.MacSpi
-
- com.ibm.crypto.hdwrCCA.provider.HmacMD2
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class HmacMD2 extends javax.crypto.MacSpi implements java.lang.Cloneable
This is an implementation of the HMAC-MD2 algorithm.
-
-
Constructor Summary
Constructors Constructor Description HmacMD2()
Standard constructor, creates a new HmacMD2 instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
protected byte[]
engineDoFinal()
Completes the HMAC computation and resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.protected int
engineGetMacLength()
Returns the length of the HMAC in bytes.protected void
engineInit(java.security.Key key, java.security.spec.AlgorithmParameterSpec params)
Initializes the HMAC with the given secret key and algorithm parameters.protected void
engineReset()
Resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.protected void
engineUpdate(byte input)
Processes the given byte.protected void
engineUpdate(byte[] input, int offset, int len)
Processes the firstlen
bytes ininput
, starting atoffset
.
-
-
-
Method Detail
-
engineGetMacLength
protected int engineGetMacLength()
Returns the length of the HMAC in bytes.- Specified by:
engineGetMacLength
in classjavax.crypto.MacSpi
- Returns:
- the HMAC length in bytes.
-
engineInit
protected void engineInit(java.security.Key key, java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
Initializes the HMAC with the given secret key and algorithm parameters.- Specified by:
engineInit
in classjavax.crypto.MacSpi
- Parameters:
key
- the secret key, must be a RAW formatSecretKey
params
- the algorithm parameters. This parameter is ignored- Throws:
java.security.InvalidKeyException
- if the given key is inappropriate for initializing this MAC.java.security.InvalidAlgorithmParameterException
- if the given algorithm parameters are inappropriate for this MAC. This should not occur, since theparams
parameter is currently ignored.
-
engineUpdate
protected void engineUpdate(byte input)
Processes the given byte.- Specified by:
engineUpdate
in classjavax.crypto.MacSpi
- Parameters:
input
- the input byte to be processed.
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len)
Processes the firstlen
bytes ininput
, starting atoffset
.- Specified by:
engineUpdate
in classjavax.crypto.MacSpi
- Parameters:
input
- the input buffer.offset
- the offset ininput
where the input starts.len
- the number of bytes to process.
-
engineDoFinal
protected byte[] engineDoFinal()
Completes the HMAC computation and resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.- Specified by:
engineDoFinal
in classjavax.crypto.MacSpi
- Returns:
- the HMAC result.
-
engineReset
protected void engineReset()
Resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.- Specified by:
engineReset
in classjavax.crypto.MacSpi
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjavax.crypto.MacSpi
-
-