1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

Add getMarkerPacket() test method

This commit is contained in:
Paul Schaub 2021-07-10 11:47:45 +02:00
parent be4962c531
commit 0330d3cfa3

View file

@ -15,12 +15,17 @@
*/ */
package org.pgpainless.util; package org.pgpainless.util;
import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.Iterator; import java.util.Iterator;
import java.util.Random; import java.util.Random;
import org.bouncycastle.bcpg.BCPGInputStream;
import org.bouncycastle.bcpg.MarkerPacket;
public class TestUtils { public class TestUtils {
public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
@ -49,4 +54,11 @@ public class TestUtils {
} }
return sb.toString(); 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;
}
} }