Package net.handle.hdllib
Class SignedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
net.handle.hdllib.SignedOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Objects of this class can be used to sign the contents of a stream
that can be verified by a SignedInputStream class.
Note: This is not a part of the official handle protocol specification.
This was introduced by CNRI solely for replication in the Handle.net software.
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionSignedOutputStream
(X509Certificate certificate, PrivateKey sourceKey, OutputStream out, Socket socket) SignedOutputStream
(PrivateKey sourceKey, OutputStream out) Create a stream that can verify the data read from the stream in blocks. -
Method Summary
Methods inherited from class java.io.FilterOutputStream
close, flush
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
SignedOutputStream
public SignedOutputStream(PrivateKey sourceKey, OutputStream out) throws HandleException, IOException Create a stream that can verify the data read from the stream in blocks. The caller should call the verifyBlock method at the end of every block of data that needs to be verified. verifyBlock must be called at the same position in the stream that signBlock was called in the parallel SignedOutputStream object that generated the stream.- Throws:
HandleException
IOException
-
SignedOutputStream
- Throws:
IOException
-
SignedOutputStream
public SignedOutputStream(X509Certificate certificate, PrivateKey sourceKey, OutputStream out, Socket socket) throws HandleException, IOException - Throws:
HandleException
IOException
-
-
Method Details
-
write
Write a byte to the stream.- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
signBlock
Signs the bytes written since the last signature on the stream. This should be called at the exact same point in the stream as the verifyBlock method in the SignedInputStream class.- Throws:
IOException
SignatureException
-