public class BaseMac extends MacSpi implements PBE
MD5, OPENSSL, PKCS12, PKCS5S1, PKCS5S1_UTF8, PKCS5S2, PKCS5S2_UTF8, SHA1, SHA256| Modifier | Constructor and Description |
|---|---|
protected |
BaseMac(Mac macEngine) |
protected |
BaseMac(Mac macEngine,
int pbeType,
int pbeHash,
int keySize) |
| 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, engineUpdateprotected BaseMac(Mac macEngine)
protected BaseMac(Mac macEngine, int pbeType, int pbeHash, int keySize)
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
MacSpiMacSpi instance with the specified key and
algorithm parameters.engineInit in class MacSpikey - 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 int engineGetMacLength()
MacSpiengineGetMacLength in class MacSpiprotected void engineReset()
MacSpiMacSpi 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 MacSpiprotected void engineUpdate(byte input)
MacSpiMacSpi instance with the specified byte.engineUpdate in class MacSpiinput - the byte.protected void engineUpdate(byte[] input,
int offset,
int len)
MacSpiMacSpi instance with the data from the specified
buffer input from the specified offset and length len.engineUpdate in class MacSpiinput - the buffer.offset - the offset in the buffer.len - the length of the data in the buffer.protected byte[] engineDoFinal()
MacSpiMacSpi.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