aboutsummaryrefslogtreecommitdiff
path: root/crypto-pgpainless
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-10-29 04:36:34 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2022-10-29 04:37:04 +0530
commit538ddbfd95af31de2b3ad7d0f9de0cefd91befae (patch)
treec531f0374528bdecad2a7afb3118d6c34a5ff9c2 /crypto-pgpainless
parentb4c9115365ecbdac2127f7b68d8b46ca1975f1da (diff)
feat(app): wire in ASCII armor toggle
Diffstat (limited to 'crypto-pgpainless')
-rw-r--r--crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt b/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt
index 91c17004..e1084dec 100644
--- a/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt
+++ b/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt
@@ -83,7 +83,9 @@ public class PGPainlessCryptoHandler @Inject constructor() :
require(publicKeyRings.isNotEmpty()) { "No public keys to encrypt message to" }
val publicKeyRingCollection = PGPPublicKeyRingCollection(publicKeyRings)
val encryptionOptions = EncryptionOptions().addRecipients(publicKeyRingCollection)
- val producerOptions = ProducerOptions.encrypt(encryptionOptions).setAsciiArmor(false)
+ val producerOptions =
+ ProducerOptions.encrypt(encryptionOptions)
+ .setAsciiArmor(options.isOptionEnabled(PGPEncryptOptions.ASCII_ARMOR))
val encryptor =
PGPainless.encryptAndOrSign().onOutputStream(outputStream).withOptions(producerOptions)
plaintextStream.copyTo(encryptor)