gnu.crypto.mac
public class MacOutputStream extends FilterOutputStream
A filtering output stream that computes a MAC (message authentication code) over all data written to the stream.
Version: $Revision: 1.3 $
Constructor Summary | |
---|---|
MacOutputStream(OutputStream out, IMac mac) Creates a new |
Method Summary | |
---|---|
IMac | getMac() Returns the MAC this stream is updating. |
void | on(boolean flag) Turns the digesting state on or off. |
void | setMac(IMac mac) Sets the MAC this stream is updating, which must have already been initialized. |
void | write(int b) |
void | write(byte[] buf, int off, int len) |
Creates a new MacOutputStream
. The stream is initially set
to digest data written, the mac
argument must have already
been initialized, and the mac
argument is not cloned.
Parameters: out The underlying output stream. mac The mac instance to use.
Returns the MAC this stream is updating.
Returns: The MAC.
Turns the digesting state on or off. When off, the MAC will not be updated when data is written to the stream.
Parameters: flag The new digesting state.
Sets the MAC this stream is updating, which must have already been initialized. The argument is not cloned by this method.
Parameters: mac The non-null new MAC.
Throws: NullPointerException If the argument is null.