From 538ddbfd95af31de2b3ad7d0f9de0cefd91befae Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 29 Oct 2022 04:36:34 +0530 Subject: feat(app): wire in ASCII armor toggle --- .../main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto-pgpainless') 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) -- cgit v1.2.3