use snafu::Snafu;
use crate::error::Error;
#[non_exhaustive]
#[derive(Debug, Snafu)]
pub enum DecryptError {
#[snafu(display("no matching key"))]
NoMatchingKey,
#[snafu(transparent)]
Other {
source: Error,
},
}
impl DecryptError {
#[must_use]
pub fn is_retryable(&self) -> bool {
match self {
DecryptError::NoMatchingKey => false,
DecryptError::Other { source } => source.is_retryable(),
}
}
}
#[non_exhaustive]
#[derive(Debug, Snafu)]
pub enum UnsealError {
#[snafu(display("invalid bundle"))]
InvalidBundle,
#[snafu(display("authentication failed"))]
AuthenticationFailed,
}