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
  • Method Details

    • engineGetMacLength

      protected int engineGetMacLength()
      Description copied from class: MacSpi
      Returns the length of this MAC (in bytes).
      Specified by:
      engineGetMacLength in class MacSpi
      Returns:
      the length of this MAC (in bytes).
    • engineInit

      protected void engineInit​(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
      Description copied from class: MacSpi
      Initializes this MacSpi instance with the specified key and algorithm parameters.
      Specified by:
      engineInit in class MacSpi
      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 is null.
      InvalidAlgorithmParameterException - if the specified parameters cannot be used to initialize this algorithm.
    • engineUpdate

      protected void engineUpdate​(byte input)
      Description copied from class: MacSpi
      Updates this MacSpi instance with the specified byte.
      Specified by:
      engineUpdate in class MacSpi
      Parameters:
      input - the byte.
    • engineUpdate

      protected void engineUpdate​(byte[] input, int offset, int len)
      Description copied from class: MacSpi
      Updates this MacSpi instance with the data from the specified buffer input from the specified offset and length len.
      Specified by:
      engineUpdate in class MacSpi
      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: MacSpi
      Computes the digest of this MAC based on the data previously specified in MacSpi.engineUpdate(byte) calls.

      This MacSpi instance 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:
      engineDoFinal in class MacSpi
      Returns:
      the generated digest.
    • engineReset

      protected void engineReset()
      Description copied from class: MacSpi
      Resets this MacSpi instance to its initial state.

      This MacSpi instance 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:
      engineReset in class MacSpi