diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-05-18 13:10:53 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-05-18 13:10:57 +0530 |
commit | a24d02052f8844497d26274b65abae05148cd86b (patch) | |
tree | 2f8220993f9c682f6eb9e97b21e834b61eee7183 /crypto-common | |
parent | 6b0e4feed683ec63ed55ed7828c70f6b95078858 (diff) |
refactor: add missing docs and add explicit `NoKeysProvidedException`
Diffstat (limited to 'crypto-common')
-rw-r--r-- | crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt | 3 | ||||
-rw-r--r-- | crypto-common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt b/crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt index cb3df75e..c9db3734 100644 --- a/crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt +++ b/crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt @@ -38,7 +38,4 @@ public interface KeyManager<Key, KeyIdentifier> { * as an identifier for the cryptographic identity tied to this key. */ public suspend fun getKeyId(key: Key): KeyIdentifier? - - /** Given a [fileName], return whether this instance can handle it. */ - public fun canHandle(fileName: String): Boolean } diff --git a/crypto-common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt b/crypto-common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt index cb8980bd..6d752964 100644 --- a/crypto-common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt +++ b/crypto-common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt @@ -37,5 +37,8 @@ public sealed class CryptoHandlerException(message: String? = null, cause: Throw /** The passphrase provided for decryption was incorrect. */ public class IncorrectPassphraseException(cause: Throwable) : CryptoHandlerException(null, cause) +/** No keys were passed to the encrypt/decrypt operation. */ +public object NoKeysProvidedException : CryptoHandlerException(null, null) + /** An unexpected error that cannot be mapped to a known type. */ public class UnknownError(cause: Throwable) : CryptoHandlerException(null, cause) |