Mac class.
All the abstract methods in this class must be implemented by each
cryptographic service provider who wishes to supply the implementation
of a particular MAC algorithm.
Implementations are free to implement the Cloneable interface.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: a clone if the implementation is cloneable.Overrides java. Returns a clone if the implementation is cloneable. |
| protected abstract byte[] | Returns: the MAC result.Completes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was initialized with. |
| protected abstract int | |
| protected abstract void | engineInit(Key
the (secret) key. key, AlgorithmParameterSpec the algorithm parameters. params)Initializes the MAC with the given (secret) key and algorithm parameters. |
| protected abstract void | engineReset()
Resets the MAC for further use, maintaining the secret key that the MAC was initialized with. |
| protected abstract void | |
| protected abstract void | engineUpdate(byte[]
the input buffer. input, int the offset in offset, int input where the input starts.the number of bytes to process. len)Processes the first |
| protected void | engineUpdate(ByteBuffer
the ByteBuffer input)Processes |
| MacSpi | back to summary |
|---|---|
| public MacSpi() Constructor for subclasses to call. | |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. Returns a clone if the implementation is cloneable.
| |
| engineDoFinal | back to summary |
|---|---|
| protected abstract byte[] engineDoFinal() Completes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was initialized with.
| |
| engineGetMacLength | back to summary |
|---|---|
| protected abstract int engineGetMacLength() Returns the length of the MAC in bytes.
| |
| engineInit | back to summary |
|---|---|
| protected abstract void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes the MAC with the given (secret) key and algorithm parameters.
| |
| engineReset | back to summary |
|---|---|
| protected abstract void engineReset() Resets the MAC for further use, maintaining the secret key that the MAC was initialized with. | |
| engineUpdate | back to summary |
|---|---|
| protected abstract void engineUpdate(byte input) Processes the given byte.
| |
| engineUpdate | back to summary |
|---|---|
| protected abstract void engineUpdate(byte[] input, int offset, int len) Processes the first
| |
| engineUpdate | back to summary |
|---|---|
| protected void engineUpdate(ByteBuffer input) Processes Subclasses should consider overriding this method if they can process ByteBuffers more efficiently than byte arrays.
| |