|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--java.io.FilterInputStream | +--iaik.utils.MacInputStream
A stream implementation for MACing the data read from an input stream. This is similar to the java.security.DigestInputStream.
MacOutputStream
,
DigestInputStream
Field Summary | |
protected Mac |
macEngine_
The MAC engine to use for MACing the data. |
protected boolean |
macingActive_
Indicates, if this objects sends data read from this stream to the Mac engine. |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
MacInputStream(InputStream stream,
Mac macEngine)
Creates a MAC input stream, using the specified input 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. |
int |
read()
This methods reads a byte fom the underlying stream and upadtes the MAC with this data, if the MACing is active. |
int |
read(byte[] dataByteArray,
int offset,
int length)
This methods reads data bytes fom the underlying stream and upadtes the MAC with this data, if the MACing is active. |
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. |
Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, read, reset, skip |
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 MacInputStream(InputStream stream, Mac macEngine)
stream
- The input stream to read the data from.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 int read() throws IOException
read
in class FilterInputStream
IOException
- If reading from the underlaying stream fails.public int read(byte[] dataByteArray, int offset, int length) throws IOException
read
in class FilterInputStream
dataByteArray
- The array receiving the new data bytes.offset
- The offset in the data byte array to start writing the data
bytes.length
- The maximum number of bytes to read the stream.IOException
- If reading from 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 |