|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--iaik.utils.MacOutputStream
A stream implementation for MACing the data written to an output stream. This is similar to the java.security.DigestOutputStream.
MacInputStream
,
java.security.DigestOutputStream
Field Summary | |
protected Mac |
macEngine_
The MAC engine to use for MACing the data. |
protected boolean |
macingActive_
Indicates, if this objects sends data written to this stream to the Mac engine. |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
MacOutputStream(OutputStream stream,
Mac macEngine)
Creates a MAC output stream, using the specified output stream and MAC engine. |
Method Summary | |
Mac |
getMac()
Get the MAC engine used for MACing the data. |
void |
on(boolean macingActive)
Turns the MACing on or off. |
void |
setMac(Mac macEngine)
Set the MAC engine to use for MACing the data. |
String |
toString()
Returns a string representation of this MAC output stream. |
void |
write(byte[] dataByteArray,
int offset,
int length)
This methods updates the MAC, if the MACing is active. |
void |
write(int dataByte)
This methods updates the MAC, if the MACing is active. |
Methods inherited from class java.io.FilterOutputStream |
close, flush, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean macingActive_
protected Mac macEngine_
Constructor Detail |
public MacOutputStream(OutputStream stream, Mac macEngine)
stream
- The output stream to write the data though.macEngine
- The MAC engine to use for MACing the data.Method Detail |
public Mac getMac()
public void setMac(Mac macEngine)
macEngine
- The MAC engine to use for MACing the data.public void write(int dataByte) throws IOException
write
in class FilterOutputStream
dataByte
- A single data byte.IOException
- If writing to the underlaying stream fails.public void write(byte[] dataByteArray, int offset, int length) throws IOException
write
in class FilterOutputStream
dataByteArray
- The array containing the data bytes.offset
- The offset in the data byte array to start reading the data
bytes.length
- The number of bytes to read the array starting from offset.IOException
- If writing to the underlaying stream fails.public void on(boolean macingActive)
macingActive
- True, to MAC all data before writing to the underlying
stream.public String toString()
toString
in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |