Class ClearsignedMessageUtil
java.lang.Object
org.pgpainless.decryption_verification.cleartext_signatures.ClearsignedMessageUtil
Utility class to deal with cleartext-signed messages.
Based on Bouncycastle's
ClearSignedFileProcessor
.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.openpgp.PGPSignatureList
detachSignaturesFromInbandClearsignedMessage
(InputStream clearsignedInputStream, OutputStream messageOutputStream) Dearmor a clearsigned message, detach the inband signatures and write the plaintext message to the provided messageOutputStream.static int
readInputLine
(ByteArrayOutputStream bOut, int lookAhead, InputStream fIn) static int
readInputLine
(ByteArrayOutputStream bOut, InputStream fIn)
-
Method Details
-
detachSignaturesFromInbandClearsignedMessage
public static org.bouncycastle.openpgp.PGPSignatureList detachSignaturesFromInbandClearsignedMessage(InputStream clearsignedInputStream, OutputStream messageOutputStream) throws 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 messagemessageOutputStream
- output stream to which the dearmored message shall be written- Returns:
- signatures
- Throws:
IOException
- if the message is not clearsigned or some other IO error happensWrongConsumingMethodException
- in case the armored message is not cleartext signed
-
readInputLine
- Throws:
IOException
-
readInputLine
public static int readInputLine(ByteArrayOutputStream bOut, int lookAhead, InputStream fIn) throws IOException - Throws:
IOException
-