- java.lang.Object
-
- javax.crypto.MacSpi
-
- com.ibm.crypto.ibmjcehybrid.provider.HmacSHA256Hybrid
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class HmacSHA256Hybrid extends javax.crypto.MacSpiThis class is a facade for the HmacSHA256Hybrid Message Authentication Code (MAC) algorithm.
-
-
Constructor Summary
Constructors Constructor Description HmacSHA256Hybrid()Creates a new instance of the HmacSHA256Hybrid class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()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 intengineGetMacLength()Returns the length of the HMAC in bytes.protected voidengineInit(java.security.Key key, java.security.spec.AlgorithmParameterSpec params)Initializes this mac with a key and a set of algorithm parameters.protected voidengineReset()Resets 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.
-
-
-
Method Detail
-
engineGetMacLength
protected int engineGetMacLength()
Returns the length of the HMAC in bytes.- Specified by:
engineGetMacLengthin 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.InvalidAlgorithmParameterExceptionInitializes this mac with a key and a set of algorithm parameters.- Specified by:
engineInitin classjavax.crypto.MacSpi- Parameters:
key- the encryption keyparams- the algorithm parameters- Throws:
java.security.InvalidKeyException- if the given key is inappropriate for initializing this macjava.security.InvalidAlgorithmParameterException- if the given algorithm parameters are inappropriate for this mac
-
engineUpdate
protected void engineUpdate(byte input)
Processes the given byte.- Specified by:
engineUpdatein classjavax.crypto.MacSpi- 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 classjavax.crypto.MacSpi- 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 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:
engineResetin classjavax.crypto.MacSpi
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjavax.crypto.MacSpi
-
-