From a24d02052f8844497d26274b65abae05148cd86b Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 18 May 2023 13:10:53 +0530 Subject: refactor: add missing docs and add explicit `NoKeysProvidedException` --- crypto-common/src/main/kotlin/app/passwordstore/crypto/KeyManager.kt | 3 --- .../src/main/kotlin/app/passwordstore/crypto/errors/CryptoException.kt | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crypto-common') 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 { * 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) -- cgit v1.2.3