pub enum CryptoError {
InvalidKek,
UnknownKekId,
SealFailed,
OpenFailed,
}Expand description
What can go wrong sealing or opening a secret.
Deliberately coarse: a caller must not be able to tell why an open failed (wrong key, tampered ciphertext, wrong tenant), because that distinction is an oracle. The operator gets detail through logs, not through this type.
Variants§
InvalidKek
The configured key material was not a valid KEK.
UnknownKekId
No KEK is configured for the kek_id this ciphertext was sealed under.
SealFailed
Sealing failed (RNG or AEAD failure).
OpenFailed
Opening failed: wrong key, tampered ciphertext, or a binding mismatch (the ciphertext belongs to a different namespace/provider).
Trait Implementations§
Source§impl Clone for CryptoError
impl Clone for CryptoError
impl Copy for CryptoError
Source§impl Debug for CryptoError
impl Debug for CryptoError
Source§impl Display for CryptoError
Hand-written rather than derived: this crate carries no thiserror
dependency, and these messages are deliberately uniform about why an open
failed.
impl Display for CryptoError
Hand-written rather than derived: this crate carries no thiserror
dependency, and these messages are deliberately uniform about why an open
failed.
impl Eq for CryptoError
Source§impl Error for CryptoError
impl Error for CryptoError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for CryptoError
impl PartialEq for CryptoError
impl StructuralPartialEq for CryptoError
Auto Trait Implementations§
impl Freeze for CryptoError
impl RefUnwindSafe for CryptoError
impl Send for CryptoError
impl Sync for CryptoError
impl Unpin for CryptoError
impl UnsafeUnpin for CryptoError
impl UnwindSafe for CryptoError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more