All Packages Class Hierarchy This Package Previous Next Index
Class is.logi.crypto.io.VerifyStream
java.lang.Object
|
+----java.io.InputStream
|
+----java.io.FilterInputStream
|
+----is.logi.crypto.io.VerifyStream
- public class VerifyStream
- extends FilterInputStream
This InputStream reads the stream generated by a SignStream and verifies
the embedded signatures. It will not pass any data through until that data
has been verified.
- Author:
- Logi Ragnarsson
(logir@hi.is)
- See Also:
- SignStream
-
VerifyStream(InputStream, int, SignatureKey, HashState)
- Create a new VerifyStream object.
-
available()
-
Returns the number of bytes that can be read from this input stream
without blocking.
-
markSupported()
-
Returns false.
-
read()
- Reads the next byte of data from this input stream.
-
read(byte[], int, int)
- Reads up to len bytes of data from this input stream into an array of
bytes.
-
skip(long)
- Skips over and discards n bytes of data from the input stream.
VerifyStream
public VerifyStream(InputStream in,
int blockSize,
SignatureKey key,
HashState fs)
- Create a new VerifyStream object. It matches the SignStream object
with the same
blockSize
and fs
and with the
key that matches key
- Throws: IOException
- if problems arise with the underlying InputStream.
- See Also:
- SignStream
read
public synchronized int read() throws IOException
- Reads the next byte of data from this input stream. The value
byte is returned as an int in the range 0 to 255. If no byte is
available because the end of the stream has been reached, the
value -1 is returned. This method blocks until input data is
available, the end of the stream is detected, or an exception
is thrown.
- Overrides:
- read in class FilterInputStream
read
public synchronized int read(byte b[],
int off,
int len) throws IOException
- Reads up to len bytes of data from this input stream into an array of
bytes. This method blocks until some input is available.
The actual number of bytes read is returned or -1 if the end of the
stream is reached.
- Overrides:
- read in class FilterInputStream
skip
public synchronized long skip(long n) throws IOException
- Skips over and discards n bytes of data from the input stream. The
skip method may, for a variety of reasons, end up skipping over some
smaller number of bytes, possibly 0. The actual number of bytes
skipped is returned.
- Overrides:
- skip in class FilterInputStream
available
public int available() throws IOException
- Returns the number of bytes that can be read from this input stream
without blocking.
- Overrides:
- available in class FilterInputStream
markSupported
public boolean markSupported()
- Returns false. (This could be implemented, but I've never seen it
used. Mail me if you want it!)
- Overrides:
- markSupported in class FilterInputStream
All Packages Class Hierarchy This Package Previous Next Index