Class HmacMD2
java.lang.Object
javax.crypto.MacSpi
com.ibm.crypto.hdwrCCA.provider.HmacMD2
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected byte[]Completes the HMAC computation and resets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.protected intReturns the length of the HMAC in bytes.protected voidengineInit(Key key, AlgorithmParameterSpec params) Initializes the HMAC with the given secret key and algorithm parameters.protected voidResets the HMAC for further use, maintaining the secret key that the HMAC was initialized with.protected voidengineUpdate(byte input) Processes the given byte.protected voidengineUpdate(byte[] input, int offset, int len) Processes the firstlenbytes ininput, starting atoffset.Methods inherited from class MacSpi
engineUpdate
-
Constructor Details
-
HmacMD2
public HmacMD2()Standard constructor, creates a new HmacMD2 instance. Verify the JCE framework in the constructor.- Throws:
SecurityException- if fails to verify the JCE framework.
-
-
Method Details
-
engineGetMacLength
protected int engineGetMacLength()Returns the length of the HMAC in bytes.- Specified by:
engineGetMacLengthin classMacSpi- Returns:
- the HMAC length in bytes.
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes the HMAC with the given secret key and algorithm parameters.- Specified by:
engineInitin classMacSpi- Parameters:
key- the secret key, must be a RAW formatSecretKeyparams- the algorithm parameters. This parameter is ignored- Throws:
InvalidKeyException- if the given key is inappropriate for initializing this MAC.InvalidAlgorithmParameterException- if the given algorithm parameters are inappropriate for this MAC. This should not occur, since theparamsparameter is currently ignored.
-
engineUpdate
protected void engineUpdate(byte input) Processes the given byte.- Specified by:
engineUpdatein classMacSpi- Parameters:
input- the input byte to be processed.
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len) Processes the firstlenbytes ininput, starting atoffset.- Specified by:
engineUpdatein classMacSpi- Parameters:
input- the input buffer.offset- the offset ininputwhere 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:
engineDoFinalin classMacSpi- 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:
engineResetin classMacSpi
-
clone
-