#[derive(Debug, thiserror::Error)]
pub enum CryptoError {
#[error("no master key found in the OS credential store")]
KeyNotFound,
#[error("master key in credential store has invalid length (expected 32 bytes)")]
KeyCorrupted,
#[error("OS credential manager is unavailable: {0}")]
KeyringUnavailable(String),
#[error("encryption failed")]
EncryptionFailed,
#[error("decryption failed: ciphertext is invalid or key is wrong")]
DecryptionFailed,
#[error("nonce must be exactly 12 bytes")]
InvalidNonce,
}