aboutsummaryrefslogtreecommitdiff
path: root/crypto-pgpainless/src/test/kotlin
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-10-29 04:36:00 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2022-10-29 04:36:00 +0530
commit633cbe271460980ff18a350fb6b7864a424ec83a (patch)
treebe3560a97823f02316ad8d220c0b53ce893a99c9 /crypto-pgpainless/src/test/kotlin
parent390286f95fffdfad434f60a460fff21473fefc32 (diff)
feat(crypto-common): support passing arbitrary crypto options
Diffstat (limited to 'crypto-pgpainless/src/test/kotlin')
-rw-r--r--crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt
index 80c8dc7c..386ca72b 100644
--- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt
+++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt
@@ -41,6 +41,7 @@ class PGPainlessCryptoHandlerTest {
encryptionKey.keySet,
CryptoConstants.PLAIN_TEXT.byteInputStream(Charsets.UTF_8),
ciphertextStream,
+ PGPEncryptOptions.Builder().build(),
)
assertIs<Ok<Unit>>(encryptRes)
val plaintextStream = ByteArrayOutputStream()
@@ -50,6 +51,7 @@ class PGPainlessCryptoHandlerTest {
CryptoConstants.KEY_PASSPHRASE,
ciphertextStream.toByteArray().inputStream(),
plaintextStream,
+ PGPDecryptOptions.Builder().build(),
)
assertIs<Ok<Unit>>(decryptRes)
assertEquals(CryptoConstants.PLAIN_TEXT, plaintextStream.toString(Charsets.UTF_8))
@@ -63,6 +65,7 @@ class PGPainlessCryptoHandlerTest {
encryptionKey.keySet,
CryptoConstants.PLAIN_TEXT.byteInputStream(Charsets.UTF_8),
ciphertextStream,
+ PGPEncryptOptions.Builder().build(),
)
assertIs<Ok<Unit>>(encryptRes)
val plaintextStream = ByteArrayOutputStream()
@@ -72,6 +75,7 @@ class PGPainlessCryptoHandlerTest {
"very incorrect passphrase",
ciphertextStream.toByteArray().inputStream(),
plaintextStream,
+ PGPDecryptOptions.Builder().build(),
)
assertIs<Err<Throwable>>(result)
assertIs<IncorrectPassphraseException>(result.getError())