1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-17 18:02:05 +01:00

Add test for PGPainless.asciiArmor(key, stream)

This commit is contained in:
Paul Schaub 2022-09-27 16:17:22 +02:00
parent 5bccc1960e
commit dac059c702
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -128,6 +128,14 @@ public class ArmorUtilsTest {
assertTrue(ascii.startsWith("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"));
}
@Test
public void testAsciiArmorToStream() throws IOException, PGPException {
PGPSecretKeyRing secretKeys = TestKeys.getEmilSecretKeyRing();
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
PGPainless.asciiArmor(secretKeys, bytes);
assertTrue(bytes.toString().startsWith("-----BEGIN PGP PRIVATE KEY BLOCK-----\n"));
}
@Test
public void testSetCustomVersionHeader() throws IOException {
ArmoredOutputStreamFactory.setVersionInfo("MyVeryFirstOpenPGPProgram 1.0");