1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-08 13:21:09 +01:00

Rework OpenPGPInputStream to rely on BCPGInputStream for packet parsing

This commit is contained in:
Paul Schaub 2025-05-06 00:07:27 +02:00
parent 0c4a305432
commit 7463ada774
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 117 additions and 213 deletions

View file

@ -20,6 +20,7 @@ import org.bouncycastle.bcpg.CompressionAlgorithmTags;
import org.bouncycastle.openpgp.PGPCompressedDataGenerator;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.api.OpenPGPKey;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.io.Streams;
import org.junit.jupiter.api.Test;
import org.pgpainless.PGPainless;
@ -41,7 +42,8 @@ public class OpenPgpInputStreamTest {
OpenPgpInputStream openPgpInputStream = new OpenPgpInputStream(randomIn);
assertFalse(openPgpInputStream.isAsciiArmored());
assertFalse(openPgpInputStream.isLikelyOpenPgpMessage());
assertFalse(openPgpInputStream.isLikelyOpenPgpMessage(),
Hex.toHexString(randomBytes, 0, 150));
ByteArrayOutputStream out = new ByteArrayOutputStream();
Streams.pipeAll(openPgpInputStream, out);