diff --git a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java index 0d6cfa7e..afef1388 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/encryption_signing/EncryptDecryptTest.java @@ -41,6 +41,7 @@ import org.pgpainless.algorithm.PublicKeyAlgorithm; import org.pgpainless.algorithm.SymmetricKeyAlgorithm; import org.pgpainless.decryption_verification.DecryptionStream; import org.pgpainless.decryption_verification.OpenPgpMetadata; +import org.pgpainless.key.TestKeys; import org.pgpainless.key.collection.PGPKeyRing; import org.pgpainless.key.generation.KeySpec; import org.pgpainless.key.generation.type.ElGamal_GENERAL; @@ -65,10 +66,6 @@ public class EncryptDecryptTest { "Unfold the imagined happiness that both\n" + "Receive in either by this dear encounter."; - public EncryptDecryptTest() { - LOGGER.log(Level.INFO, "Plain Length: " + testMessage.getBytes(UTF8).length); - } - @Ignore @Test public void freshKeysRsaToElGamalTest() @@ -122,6 +119,14 @@ public class EncryptDecryptTest { encryptDecryptForSecretKeyRings(sender, recipient); } + @Test + public void existingRsaKeysTest() throws IOException, PGPException { + PGPKeyRing sender = new PGPKeyRing(TestKeys.getJulietPublicKeyRing(), TestKeys.getJulietSecretKeyRing()); + PGPKeyRing recipient = new PGPKeyRing(TestKeys.getRomeoPublicKeyRing(), TestKeys.getRomeoSecretKeyRing()); + + encryptDecryptForSecretKeyRings(sender, recipient); + } + private void encryptDecryptForSecretKeyRings(PGPKeyRing sender, PGPKeyRing recipient) throws PGPException, IOException { PGPSecretKeyRing recipientSec = recipient.getSecretKeys(); @@ -146,10 +151,6 @@ public class EncryptDecryptTest { encryptor.close(); byte[] encryptedSecretMessage = envelope.toByteArray(); - LOGGER.log(Level.INFO, "Sender: " + PublicKeyAlgorithm.fromId(senderPub.getPublicKey().getAlgorithm()) + - " Receiver: " + PublicKeyAlgorithm.fromId(recipientPub.getPublicKey().getAlgorithm()) + - " Encrypted Length: " + encryptedSecretMessage.length); - OpenPgpMetadata encryptionResult = encryptor.getResult(); assertFalse(encryptionResult.getSignatureKeyIDs().isEmpty());