Skip to content

Most visited

Recently visited

navigation
Added in API level 1

MacSpi

public abstract class MacSpi
extends Object

java.lang.Object
   ↳ javax.crypto.MacSpi


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.

Inherited methods

From class java.lang.Object

Public constructors

MacSpi

Added in API level 1
MacSpi ()

Creates a new MacSpi instance.

Public methods

clone

Added in API level 1
Object clone ()

Clones this MacSpi instance.

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

Protected methods

engineDoFinal

Added in API level 1
byte[] engineDoFinal ()

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
byte[] the generated digest.

engineGetMacLength

Added in API level 1
int engineGetMacLength ()

Returns the length of this MAC (in bytes).

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

engineInit

Added in API level 1
void engineInit (Key key, 
                AlgorithmParameterSpec params)

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

Parameters
key Key: the key to initialize this algorithm.
params AlgorithmParameterSpec: 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.

engineReset

Added in API level 1
void engineReset ()

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.

engineUpdate

Added in API level 1
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.

Parameters
input byte: the buffer.
offset int: the offset in the buffer.
len int: the length of the data in the buffer.

engineUpdate

Added in API level 1
void engineUpdate (byte input)

Updates this MacSpi instance with the specified byte.

Parameters
input byte: the byte.

engineUpdate

Added in API level 1
void engineUpdate (ByteBuffer input)

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

Parameters
input ByteBuffer: the buffer.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.