diff --git a/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java b/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java index e204866c..8c700120 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java +++ b/pgpainless-core/src/test/java/org/pgpainless/util/TestUtils.java @@ -15,12 +15,17 @@ */ package org.pgpainless.util; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.Iterator; import java.util.Random; +import org.bouncycastle.bcpg.BCPGInputStream; +import org.bouncycastle.bcpg.MarkerPacket; + public class TestUtils { public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; @@ -49,4 +54,11 @@ public class TestUtils { } return sb.toString(); } + + public static MarkerPacket getMarkerPacket() throws IOException { + BCPGInputStream pgpIn = new BCPGInputStream(new ByteArrayInputStream("PGP".getBytes(StandardCharsets.UTF_8))); + MarkerPacket markerPacket = new MarkerPacket(pgpIn); + pgpIn.close(); + return markerPacket; + } }