All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.hi.logir.cryptonite.SignStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----is.hi.logir.cryptonite.SignStream

public class SignStream
extends FilterOutputStream
This OutputStream signs everything written to it using the specified FingerprintState and SignatureKey.

Author:
Logi Ragnarsson (logir@hi.is)
See Also:
VerifyStream

Constructor Index

 o SignStream(OutputStream, int, SignatureKey, FingerprintState)
Creates a new SignStream with out as its underlying stream.

Method Index

 o close()
 o flush()
Flushes this output stream and forces any buffered output bytes to be written out to the stream.
 o write(byte[], int, int)
Writes len bytes from the specified byte array starting at offset off to this output stream.
 o write(int)
Writes the specified byte to this output stream.

Constructors

 o SignStream
 public SignStream(OutputStream out,
                   int blockSize,
                   SignatureKey key,
                   FingerprintState fs)
Creates a new SignStream with out as its underlying stream. 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.

If key is null the fingerprints will be written unsigned to the underlying stream.

Methods

 o write
 public synchronized void write(int b) throws IOException
Writes the specified byte to this output stream.

Overrides:
write in class FilterOutputStream
 o 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
 o flush
 public synchronized void flush() throws IOException
Flushes this output stream and forces any buffered output bytes to be written out to the stream. If the number of bytes written is not a multiple of the plainBlockSize of the Key used for encryption, up to one byte less than a whole block of garbage may be appended to the data when flush is called.

Overrides:
flush in class FilterOutputStream
 o close
 public synchronized void close() throws IOException
Throws: IOException
if there is a problem iwth 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