Package org.conscrypt
Class OpenSSLMac
java.lang.Object
javax.crypto.MacSpi
org.conscrypt.OpenSSLMac
- Direct Known Subclasses:
OpenSSLMac.HmacMD5,OpenSSLMac.HmacSHA1,OpenSSLMac.HmacSHA256,OpenSSLMac.HmacSHA384,OpenSSLMac.HmacSHA512
public abstract class OpenSSLMac extends MacSpi
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOpenSSLMac.HmacMD5static classOpenSSLMac.HmacSHA1static classOpenSSLMac.HmacSHA256static classOpenSSLMac.HmacSHA384static classOpenSSLMac.HmacSHA512 -
Method Summary
Modifier and Type Method Description protected byte[]engineDoFinal()Computes the digest of this MAC based on the data previously specified inMacSpi.engineUpdate(byte)calls.protected intengineGetMacLength()Returns the length of this MAC (in bytes).protected voidengineInit(Key key, AlgorithmParameterSpec params)Initializes thisMacSpiinstance with the specified key and algorithm parameters.protected voidengineReset()Resets thisMacSpiinstance to its initial state.protected voidengineUpdate(byte input)Updates thisMacSpiinstance with the specified byte.protected voidengineUpdate(byte[] input, int offset, int len)Updates thisMacSpiinstance with the data from the specified bufferinputfrom the specifiedoffsetand lengthlen.Methods inherited from class javax.crypto.MacSpi
clone, engineUpdate
-
Method Details
-
engineGetMacLength
protected int engineGetMacLength()Description copied from class:MacSpiReturns the length of this MAC (in bytes).- Specified by:
engineGetMacLengthin classMacSpi- Returns:
- the length of this MAC (in bytes).
-
engineInit
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterExceptionDescription copied from class:MacSpiInitializes thisMacSpiinstance with the specified key and algorithm parameters.- Specified by:
engineInitin classMacSpi- Parameters:
key- the key to initialize this algorithm.params- the parameters for this algorithm.- Throws:
InvalidKeyException- if the specified key cannot be used to initialize this algorithm, or it isnull.InvalidAlgorithmParameterException- if the specified parameters cannot be used to initialize this algorithm.
-
engineUpdate
protected void engineUpdate(byte input)Description copied from class:MacSpiUpdates thisMacSpiinstance with the specified byte.- Specified by:
engineUpdatein classMacSpi- Parameters:
input- the byte.
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len)Description copied from class:MacSpiUpdates thisMacSpiinstance with the data from the specified bufferinputfrom the specifiedoffsetand lengthlen.- Specified by:
engineUpdatein classMacSpi- Parameters:
input- the buffer.offset- the offset in the buffer.len- the length of the data in the buffer.
-
engineDoFinal
protected byte[] engineDoFinal()Description copied from class:MacSpiComputes the digest of this MAC based on the data previously specified inMacSpi.engineUpdate(byte)calls.This
MacSpiinstance is reverted to its initial state and can be used to start the next MAC computation with the same parameters or initialized with different parameters.- Specified by:
engineDoFinalin classMacSpi- Returns:
- the generated digest.
-
engineReset
protected void engineReset()Description copied from class:MacSpiResets thisMacSpiinstance to its initial state.This
MacSpiinstance is reverted to its initial state and can be used to start the next MAC computation with the same parameters or initialized with different parameters.- Specified by:
engineResetin classMacSpi
-