Package org.kuali.rice.ksb.security
Class SignatureSigningOutputStream
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
org.kuali.rice.ksb.security.SignatureSigningOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class SignatureSigningOutputStream
extends javax.servlet.ServletOutputStream
An OutputStream which decorates another OutputStream with a wrapper that digitally
signs the data when the OutputStream is closed. Since this class does not know where
the resulting digital signature will reside, a DigitalSigner will be invoked to
execute the actual signing of the message (i.e. put it in a header).
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
ConstructorsConstructorDescriptionSignatureSigningOutputStream(DigitalSigner signer, OutputStream wrappedOutputStream, boolean delayWrite) Constructs a SignatureSigningOutputStream with the given DigitalSigner and underlying OutputStream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisReady()voidsetWriteListener(javax.servlet.WriteListener writeListener) voidwrite(int data) Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, printlnMethods inherited from class java.io.OutputStream
flush, nullOutputStream, write, write
-
Constructor Details
-
SignatureSigningOutputStream
public SignatureSigningOutputStream(DigitalSigner signer, OutputStream wrappedOutputStream, boolean delayWrite) Constructs a SignatureSigningOutputStream with the given DigitalSigner and underlying OutputStream. If true, the delayWrite boolean indicates that the stream should store all data internally until the stream is closed, at which point it should forward all data to the wrapped OutputStream. If delayWrite is false, then the data will be forwarded immediately.
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
isReady
public boolean isReady()- Specified by:
isReadyin classjavax.servlet.ServletOutputStream
-
setWriteListener
public void setWriteListener(javax.servlet.WriteListener writeListener) - Specified by:
setWriteListenerin classjavax.servlet.ServletOutputStream
-