All Packages Class Hierarchy This Package Previous Next Index
Class is.logi.crypto.io.SignStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FilterOutputStream
|
+----is.logi.crypto.io.SignStream
- public class SignStream
- extends FilterOutputStream
This OutputStream signs everything written to it using the specified
HashState and SignatureKey.
- Author:
- Logi Ragnarsson
(logir@hi.is)
- See Also:
- VerifyStream
-
SignStream(OutputStream, int, SignatureKey, HashState)
- Creates a new SignStream.
-
close()
- Closes this output stream and releases any system resources associated
with this stream.
-
flush()
- Flushes this output stream and forces any buffered output bytes to
be written out to the stream.
-
write(byte[], int, int)
- Writes
len
bytes from the specified byte array starting
at offset off
to this output stream.
-
write(int)
- Writes the specified byte to this output stream.
SignStream
public SignStream(OutputStream out,
int blockSize,
SignatureKey key,
HashState fs)
- Creates a new SignStream. It passes
everything written to it through
fs
and after each
approximately blockSize
bytes it inserts a signature of the
fingerprint into the underlying stream. It then writes the data to
out
.
If key
is null the fingerprints will be written unsigned
to the underlying stream.
write
public synchronized void write(int b) throws IOException
- Writes the specified byte to this output stream.
- Overrides:
- write in class FilterOutputStream
write
public synchronized void write(byte buf[],
int off,
int len) throws IOException
- Writes
len
bytes from the specified byte array starting
at offset off
to this output stream.
- Throws: IOException
- if there is a problem iwth the underlying stream
or the key fails to sign the fingerprint.
- Overrides:
- write in class FilterOutputStream
flush
public synchronized void flush() throws IOException
- Flushes this output stream and forces any buffered output bytes to
be written out to the stream.
- Overrides:
- flush in class FilterOutputStream
close
public synchronized void close() throws IOException
- Closes this output stream and releases any system resources associated
with this stream.
- Throws: IOException
- if there is a problem with the underlying stream
or the key fails to sign the fingerprint.
- Overrides:
- close in class FilterOutputStream
All Packages Class Hierarchy This Package Previous Next Index