public interface ChunkedMacComputation
WARNING: Implementations of this interface are not thread-safe, so the caller must ensure correctness in case of concurrent use of an instance of this class.
| Modifier and Type | Method and Description |
|---|---|
byte[] |
computeMac()
Computes a tag for the provided data.
|
void |
update(ByteBuffer data)
Processes the next chunk of input, represented by
ByteBuffer data. |
void update(ByteBuffer data) throws GeneralSecurityException
ByteBuffer data.
In particular, reads the data.remaining() number of bytes from the provided buffer,
starting at the byte with position data.position().
Updates the inner state of the computation. Requires exclusive access.
NOTE: arbitrary slicing of data is permitted, i.e. a series of update()'s with
inputs "ab", "cd", and "ef" produces the same result as a series of
inputs "abc", "def".
IllegalStateException - if called after computeMac()GeneralSecurityException - when something went wrong with the updatebyte[] computeMac()
throws GeneralSecurityException
Requires exclusive access.
IllegalStateException - when called more than onceGeneralSecurityException - when something went wrong with the computation