1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

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

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();