diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2024-05-27 20:59:20 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-27 15:29:20 +0000 |
commit | 0f9540a645ef66f3cf67294f75ba2c5d9d80078e (patch) | |
tree | 1f6e94f6565de5ee147b1fdcd694343cc6004d20 /crypto/common/src/main/kotlin/app | |
parent | 1877c6ab5a987e08797b13e4dc619294d03d4c02 (diff) |
feat(pgpainless): add detection for passphrase-less messages (#3069)
* WIP: feat(pgpainless): add detection for passphrase-less messages
* refactor: test keys instead of the message
This makes more logical sense
Diffstat (limited to 'crypto/common/src/main/kotlin/app')
-rw-r--r-- | crypto/common/src/main/kotlin/app/passwordstore/crypto/CryptoHandler.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/common/src/main/kotlin/app/passwordstore/crypto/CryptoHandler.kt b/crypto/common/src/main/kotlin/app/passwordstore/crypto/CryptoHandler.kt index 898cf058..c823342b 100644 --- a/crypto/common/src/main/kotlin/app/passwordstore/crypto/CryptoHandler.kt +++ b/crypto/common/src/main/kotlin/app/passwordstore/crypto/CryptoHandler.kt @@ -41,4 +41,9 @@ public interface CryptoHandler<Key, EncOpts : CryptoOptions, DecryptOpts : Crypt /** Given a [fileName], return whether this instance can handle it. */ public fun canHandle(fileName: String): Boolean + + /** + * Inspects the given [keys] and returns `false` if none of them require a passphrase to decrypt. + */ + public fun isPassphraseProtected(keys: List<Key>): Boolean } |