When testing support for RFC4880 profile, use RSA keys

This commit is contained in:
Paul Schaub 2023-06-12 14:41:32 +02:00
parent ea9b0d68fb
commit 1b7157a548
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 13 additions and 2 deletions

View File

@ -556,14 +556,25 @@ public class EncryptDecryptRoundTripTest {
@Test
public void encryptWithSupportedProfileTest() throws IOException {
byte[] key = sop.generateKey()
.profile("rfc4880")
.userId("Alice <alice@pgpainless.org>")
.generate()
.getBytes();
byte[] cert = sop.extractCert()
.key(key)
.getBytes();
byte[] encrypted = sop.encrypt()
.profile("rfc4880")
.withCert(bobCert)
.withCert(cert)
.plaintext(message)
.getBytes();
ByteArrayAndResult<DecryptionResult> bytesAndResult = sop.decrypt()
.withKey(bobKey)
.withKey(key)
.ciphertext(encrypted)
.toByteArrayAndResult();