public class MyMacSpi extends MacSpi
Constructor and Description |
---|
MyMacSpi() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
engineDoFinal()
Computes the digest of this MAC based on the data previously specified in
MacSpi.engineUpdate(byte) calls. |
protected int |
engineGetMacLength()
Returns the length of this MAC (in bytes).
|
protected void |
engineInit(Key key,
AlgorithmParameterSpec params)
Initializes this
MacSpi instance with the specified key and
algorithm parameters. |
protected void |
engineReset()
Resets this
MacSpi instance to its initial state. |
protected void |
engineUpdate(byte input)
Updates this
MacSpi instance with the specified byte. |
protected 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 . |
clone, engineUpdate
protected int engineGetMacLength()
MacSpi
engineGetMacLength
in class MacSpi
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
MacSpi
MacSpi
instance with the specified key and
algorithm parameters.engineInit
in class MacSpi
key
- the key to initialize this algorithm.params
- the parameters for this algorithm.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 void engineUpdate(byte input)
MacSpi
MacSpi
instance with the specified byte.engineUpdate
in class MacSpi
input
- the byte.protected void engineUpdate(byte[] input, int offset, int len)
MacSpi
MacSpi
instance with the data from the specified
buffer input
from the specified offset
and length len
.engineUpdate
in class MacSpi
input
- the buffer.offset
- the offset in the buffer.len
- the length of the data in the buffer.protected byte[] engineDoFinal()
MacSpi
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.
engineDoFinal
in class MacSpi
protected void engineReset()
MacSpi
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.
engineReset
in class MacSpi