1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-16 00:24:51 +02: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 @Test
public void encryptWithSupportedProfileTest() throws IOException { 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() byte[] encrypted = sop.encrypt()
.profile("rfc4880") .profile("rfc4880")
.withCert(bobCert) .withCert(cert)
.plaintext(message) .plaintext(message)
.getBytes(); .getBytes();
ByteArrayAndResult<DecryptionResult> bytesAndResult = sop.decrypt() ByteArrayAndResult<DecryptionResult> bytesAndResult = sop.decrypt()
.withKey(bobKey) .withKey(key)
.ciphertext(encrypted) .ciphertext(encrypted)
.toByteArrayAndResult(); .toByteArrayAndResult();