to top
Android APIs
public abstract class

MacSpi

extends Object
java.lang.Object
   ↳ javax.crypto.MacSpi

Class Overview

The Service-Provider Interface (SPI) definition for the Mac class.

See Also

Summary

Public Constructors
MacSpi()
Creates a new MacSpi instance.
Public Methods
Object clone()
Clones this MacSpi instance.
Protected Methods
abstract byte[] engineDoFinal()
Computes the digest of this MAC based on the data previously specified in engineUpdate(byte) calls.
abstract int engineGetMacLength()
Returns the length of this MAC (in bytes).
abstract void engineInit(Key key, AlgorithmParameterSpec params)
Initializes this MacSpi instance with the specified key and algorithm parameters.
abstract void engineReset()
Resets this MacSpi instance to its initial state.
abstract void engineUpdate(byte[] input, int offset, int len)
Updates this MacSpi instance with the data from the specified buffer input from the specified offset and length len.
abstract void engineUpdate(byte input)
Updates this MacSpi instance with the specified byte.
void engineUpdate(ByteBuffer input)
Updates this MacSpi instance with the data from the specified buffer, starting at position(), including the next remaining() bytes.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MacSpi ()

Added in API level 1

Creates a new MacSpi instance.

Public Methods

public Object clone ()

Added in API level 1

Clones this MacSpi instance.

Returns
  • the cloned instance.
Throws
CloneNotSupportedException if cloning is not supported.

Protected Methods

protected abstract byte[] engineDoFinal ()

Added in API level 1

Computes the digest of this MAC based on the data previously specified in 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.

Returns
  • the generated digest.

protected abstract int engineGetMacLength ()

Added in API level 1

Returns the length of this MAC (in bytes).

Returns
  • the length of this MAC (in bytes).

protected abstract void engineInit (Key key, AlgorithmParameterSpec params)

Added in API level 1

Initializes this MacSpi instance with the specified key and algorithm parameters.

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.

protected abstract void engineReset ()

Added in API level 1

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.

protected abstract void engineUpdate (byte[] input, int offset, int len)

Added in API level 1

Updates this MacSpi instance with the data from the specified buffer input from the specified offset and length len.

Parameters
input the buffer.
offset the offset in the buffer.
len the length of the data in the buffer.

protected abstract void engineUpdate (byte input)

Added in API level 1

Updates this MacSpi instance with the specified byte.

Parameters
input the byte.

protected void engineUpdate (ByteBuffer input)

Added in API level 1

Updates this MacSpi instance with the data from the specified buffer, starting at position(), including the next remaining() bytes.

Parameters
input the buffer.