diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2022-07-15 00:53:48 +0530 |
|---|---|---|
| committer | Harsh Shandilya <me@msfjarvis.dev> | 2022-07-15 01:13:47 +0530 |
| commit | 549ee790d3e52bc62565ddf92e6a556e98b5195e (patch) | |
| tree | d5758e5eb80093704e683c8da926838e18182588 /crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/errors | |
| parent | 010c6e227c9cc27f4d01bc912311f977b2aeb3a7 (diff) | |
| download | HardenedPass-549ee790d3e52bc62565ddf92e6a556e98b5195e.tar.gz HardenedPass-549ee790d3e52bc62565ddf92e6a556e98b5195e.zip | |
all: re-do package structure yet again
Diffstat (limited to 'crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/errors')
| -rw-r--r-- | crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/errors/CryptoException.kt | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/errors/CryptoException.kt b/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/errors/CryptoException.kt deleted file mode 100644 index b795bbf1..00000000 --- a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/errors/CryptoException.kt +++ /dev/null @@ -1,44 +0,0 @@ -package dev.msfjarvis.aps.crypto.errors - -import dev.msfjarvis.aps.crypto.KeyManager - -public sealed class CryptoException(message: String? = null, cause: Throwable? = null) : - Exception(message, cause) - -/** Sealed exception types for [KeyManager]. */ -public sealed class KeyManagerException(message: String? = null) : CryptoException(message) - -/** Store contains no keys. */ -public object NoKeysAvailableException : KeyManagerException("No keys were found") - -/** Key directory does not exist or cannot be accessed. */ -public object KeyDirectoryUnavailableException : - KeyManagerException("Key directory does not exist") - -/** Failed to delete given key. */ -public object KeyDeletionFailedException : KeyManagerException("Couldn't delete the key file") - -/** Failed to parse the key as a known type. */ -public object InvalidKeyException : - KeyManagerException("Given key cannot be parsed as a known key type") - -/** No key matching `keyId` could be found. */ -public class KeyNotFoundException(keyId: String) : - KeyManagerException("No key found with id: $keyId") - -/** Attempting to add another key for `keyId` without requesting a replace. */ -public class KeyAlreadyExistsException(keyId: String) : - KeyManagerException("Pre-existing key was found for $keyId") - -/** Sealed exception types for [dev.msfjarvis.aps.crypto.CryptoHandler]. */ -public sealed class CryptoHandlerException(message: String? = null, cause: Throwable? = null) : - CryptoException(message, cause) - -/** The passphrase provided for decryption was incorrect. */ -public class IncorrectPassphraseException(cause: Throwable) : CryptoHandlerException(null, cause) - -/** No keys were provided for encryption. */ -public class NoKeysProvided(message: String?) : CryptoHandlerException(message, null) - -/** An unexpected error that cannot be mapped to a known type. */ -public class UnknownError(cause: Throwable) : CryptoHandlerException(null, cause) |
