java.lang.Object
javax.crypto.MacSpi
com.ibm.crypto.ibmjcehybrid.provider.HmacSHA224Hybrid
- All Implemented Interfaces:
Cloneable
This class is a facade for the HmacSHA224Hybrid
Message Authentication Code (MAC) algorithm.
-
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 int
Returns the length of the HMAC in bytes.protected void
engineInit
(Key key, AlgorithmParameterSpec params) Initializes this mac with a key and a set of algorithm parameters.protected void
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
.Methods inherited from class javax.crypto.MacSpi
engineUpdate
-
Constructor Details
-
HmacSHA224Hybrid
public HmacSHA224Hybrid()Creates a new instance of the HmacSHA224Hybrid class.
-
-
Method Details
-
engineGetMacLength
protected int engineGetMacLength()Returns the length of the HMAC in bytes.- Specified by:
engineGetMacLength
in classMacSpi
- Returns:
- the HMAC length in bytes.
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes this mac with a key and a set of algorithm parameters.- Specified by:
engineInit
in classMacSpi
- Parameters:
key
- the encryption keyparams
- the algorithm parameters- Throws:
InvalidKeyException
- if the given key is inappropriate for initializing this macInvalidAlgorithmParameterException
- if the given algorithm parameters are inappropriate for this mac
-
engineUpdate
protected void engineUpdate(byte input) Processes the given byte.- Specified by:
engineUpdate
in classMacSpi
- 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 classMacSpi
- 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 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:
engineReset
in classMacSpi
-
clone
-