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 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

      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 AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException
    • isReady

      public boolean isReady()
      Specified by:
      isReady in class javax.servlet.ServletOutputStream
    • setWriteListener

      public void setWriteListener(javax.servlet.WriteListener writeListener)
      Specified by:
      setWriteListener in class javax.servlet.ServletOutputStream