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
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)
Methods inherited from class javax.servlet.ServletOutputStream |
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delayWrite
private boolean delayWrite
signer
private DigitalSigner signer
bufferedDataHoldingStream
private BufferedOutputStream bufferedDataHoldingStream
dataHoldingStream
private ByteArrayOutputStream dataHoldingStream
wrappedOutputStream
private OutputStream wrappedOutputStream
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.
write
public void write(int data)
throws IOException
- Specified by:
write
in class OutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class OutputStream
- Throws:
IOException
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.