summaryrefslogtreecommitdiff
path: root/crypto-common/src/main
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2023-05-18 13:10:53 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2023-05-18 13:10:57 +0530
commita24d02052f8844497d26274b65abae05148cd86b (patch)
tree2f8220993f9c682f6eb9e97b21e834b61eee7183 /crypto-common/src/main
parent6b0e4feed683ec63ed55ed7828c70f6b95078858 (diff)
refactor: add missing docs and add explicit `NoKeysProvidedException`
Diffstat (limited to 'crypto-common/src/main')
-rw-r--r--crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt3
-rw-r--r--crypto-common/src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt3
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)