mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-17 18:02:05 +01:00
When testing support for RFC4880 profile, use RSA keys
This commit is contained in:
parent
ea9b0d68fb
commit
1b7157a548
1 changed files with 13 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue