Class ClearsignedMessageUtil


  • public final class ClearsignedMessageUtil
    extends java.lang.Object
    Utility class to deal with cleartext-signed messages. Based on Bouncycastle's ClearSignedFileProcessor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.bouncycastle.openpgp.PGPSignatureList detachSignaturesFromInbandClearsignedMessage​(java.io.InputStream clearsignedInputStream, java.io.OutputStream messageOutputStream)
      Dearmor a clearsigned message, detach the inband signatures and write the plaintext message to the provided messageOutputStream.
      static int readInputLine​(java.io.ByteArrayOutputStream bOut, int lookAhead, java.io.InputStream fIn)  
      static int readInputLine​(java.io.ByteArrayOutputStream bOut, java.io.InputStream fIn)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • detachSignaturesFromInbandClearsignedMessage

        public static org.bouncycastle.openpgp.PGPSignatureList detachSignaturesFromInbandClearsignedMessage​(java.io.InputStream clearsignedInputStream,
                                                                                                             java.io.OutputStream messageOutputStream)
                                                                                                      throws java.io.IOException,
                                                                                                             WrongConsumingMethodException
        Dearmor a clearsigned message, detach the inband signatures and write the plaintext message to the provided messageOutputStream.
        Parameters:
        clearsignedInputStream - input stream containing a clearsigned message
        messageOutputStream - output stream to which the dearmored message shall be written
        Returns:
        signatures
        Throws:
        java.io.IOException - if the message is not clearsigned or some other IO error happens
        WrongConsumingMethodException
      • readInputLine

        public static int readInputLine​(java.io.ByteArrayOutputStream bOut,
                                        java.io.InputStream fIn)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readInputLine

        public static int readInputLine​(java.io.ByteArrayOutputStream bOut,
                                        int lookAhead,
                                        java.io.InputStream fIn)
                                 throws java.io.IOException
        Throws:
        java.io.IOException