mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-23 03:17:58 +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
|
@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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue