1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 10:49:39 +02:00

SOP : Do not armor already-armored data.

This commit is contained in:
Paul Schaub 2022-11-11 13:18:22 +01:00
parent 2d6f9738ec
commit 48005da7f3
2 changed files with 18 additions and 2 deletions

View file

@ -29,7 +29,9 @@ public class ArmorTest {
@Test
public void armor() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
byte[] data = PGPainless.generateKeyRing().modernKeyRing("Alice").getEncoded();
byte[] knownGoodArmor = ArmorUtils.toAsciiArmoredString(data).getBytes(StandardCharsets.UTF_8);
byte[] knownGoodArmor = ArmorUtils.toAsciiArmoredString(data)
.replace("Version: PGPainless\n", "") // armor command does not add version anymore
.getBytes(StandardCharsets.UTF_8);
byte[] armored = new SOPImpl()
.armor()
.data(data)