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

Rework ASCII armor API

This commit is contained in:
Paul Schaub 2025-05-07 14:06:34 +02:00
parent 165ea8ae76
commit d477203a77
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
7 changed files with 65 additions and 19 deletions

View file

@ -113,10 +113,11 @@ public class CanonicalizedDataEncryptionTest {
@BeforeAll
public static void readKeys() throws IOException {
secretKeys = PGPainless.getInstance().readKey().parseKey(KEY);
PGPainless api = PGPainless.getInstance();
secretKeys = api.readKey().parseKey(KEY);
publicKeys = secretKeys.toCertificate();
// CHECKSTYLE:OFF
System.out.println(PGPainless.asciiArmor(secretKeys));
System.out.println(api.toAsciiArmor(secretKeys));
// CHECKSTYLE:ON
}

View file

@ -599,7 +599,7 @@ class KeyRingReaderTest {
public void testReadKeyRingWithArmoredPublicKey() throws IOException {
OpenPGPKey secretKeys = api.generateKey().modernKeyRing("Alice <alice@pgpainless.org>");
OpenPGPCertificate publicKeys = secretKeys.toCertificate();
String armored = PGPainless.asciiArmor(publicKeys);
String armored = api.toAsciiArmor(publicKeys);
PGPKeyRing keyRing = PGPainless.readKeyRing()
.keyRing(armored);

View file

@ -132,7 +132,7 @@ public class ArmorUtilsTest {
@Test
public void signatureToAsciiArmoredString() {
String SIG = "-----BEGIN PGP SIGNATURE-----\n" +
"Version: PGPainless\n" +
"Comment: 4F66 5C4D C2C4 660B C642 5E41 5736 E693 1ACF 370C\n" +
"\n" +
"iHUEARMKAB0WIQRPZlxNwsRmC8ZCXkFXNuaTGs83DAUCYJ/x5gAKCRBXNuaTGs83\n" +
"DFRwAP9/4wMvV3WcX59Clo7mkRce6iwW3VBdiN+yMu3tjmHB2wD/RfE28Q1v4+eo\n" +