From 883c819536170b6c6bb98b3b2ffee09490258a62 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 18 Mar 2021 21:33:39 +0100 Subject: [PATCH] GenerateKeyTest: Print public key instead of secret key --- .../java/org/pgpainless/key/generation/GenerateKeyTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyTest.java index 9bc3dcdd..affeac68 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/generation/GenerateKeyTest.java @@ -48,15 +48,15 @@ public class GenerateKeyTest { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ArmoredOutputStream armor = ArmoredOutputStreamFactory.get(bytes); - secretKeys.encode(armor); + publicKeys.encode(armor); armor.close(); - String publicKey = new String(bytes.toByteArray()); + String publicKey = bytes.toString(); bytes = new ByteArrayOutputStream(); armor = ArmoredOutputStreamFactory.get(bytes); secretKeys.encode(armor); armor.close(); - String privateKey = new String(bytes.toByteArray()); + String privateKey = bytes.toString(); LOGGER.log(Level.INFO, String.format("Generated random fresh EC key ring.\n" + "User-ID: %s\n" +