java.lang.Object
javax.crypto.MacSpi
com.ibm.crypto.hdwrCCA.provider.PBM
- All Implemented Interfaces:
Cloneable
This is an implementation of the HMAC-SHA1 algorithm.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Completes the PBM computation and resets the PBM for further use, maintaining the secret key that the PBM was initialized with.protected intReturns the length of the PBM in bytes.protected voidengineInit(Key key, AlgorithmParameterSpec params) Initializes the PBM with the given secret key and algorithm parameters.protected voidResets the PBM for further use, maintaining the secret key that the PBM 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 javax.crypto.MacSpi
clone, engineUpdate
-
Constructor Details
-
PBM
Empty constructor Verify the JCE framework in the constructor.- Throws:
NoSuchAlgorithmException- if the required cipher mode (CBC) is unavailableSecurityException- if this constructor fails to authenticate the JCE framework.
-
-
Method Details
-
engineGetMacLength
protected int engineGetMacLength()Returns the length of the PBM in bytes.- Specified by:
engineGetMacLengthin classMacSpi- Returns:
- the PBM length in bytes.
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes the PBM with the given secret key and algorithm parameters.- Specified by:
engineInitin classMacSpi- Parameters:
key- the secret key.params- the algorithm parameters.- Throws:
InvalidKeyException- if the given key is inappropriate for initializing this MAC.InvalidAlgorithmParameterException- if the given algorithm parameters are inappropriate for this MAC.
-
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 PBM computation and resets the PBM for further use, maintaining the secret key that the PBM was initialized with.- Specified by:
engineDoFinalin classMacSpi- Returns:
- the PBM result.
-
engineReset
protected void engineReset()Resets the PBM for further use, maintaining the secret key that the PBM was initialized with.- Specified by:
engineResetin classMacSpi
-