From 1b7157a5482ab5f02c107ee59d45a2c6d8903331 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 12 Jun 2023 14:41:32 +0200 Subject: [PATCH] When testing support for RFC4880 profile, use RSA keys --- .../sop/EncryptDecryptRoundTripTest.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pgpainless-sop/src/test/java/org/pgpainless/sop/EncryptDecryptRoundTripTest.java b/pgpainless-sop/src/test/java/org/pgpainless/sop/EncryptDecryptRoundTripTest.java index 30305edd..ccfeaf41 100644 --- a/pgpainless-sop/src/test/java/org/pgpainless/sop/EncryptDecryptRoundTripTest.java +++ b/pgpainless-sop/src/test/java/org/pgpainless/sop/EncryptDecryptRoundTripTest.java @@ -556,14 +556,25 @@ public class EncryptDecryptRoundTripTest { @Test public void encryptWithSupportedProfileTest() throws IOException { + + byte[] key = sop.generateKey() + .profile("rfc4880") + .userId("Alice ") + .generate() + .getBytes(); + + byte[] cert = sop.extractCert() + .key(key) + .getBytes(); + byte[] encrypted = sop.encrypt() .profile("rfc4880") - .withCert(bobCert) + .withCert(cert) .plaintext(message) .getBytes(); ByteArrayAndResult bytesAndResult = sop.decrypt() - .withKey(bobKey) + .withKey(key) .ciphertext(encrypted) .toByteArrayAndResult();