pub enum SealError {
Locked,
Custody(KeyError),
UnknownVersion(u8),
UnknownKey(String),
Crypto(EncryptionError),
}Expand description
Why sealing or opening a host’s app-data failed.
Sealing can only fail before the cipher runs — the store has no master key
to seal under. Opening adds the failures a stored payload can carry: a
version this build does not read, a generation this keyring holds no key
for, or an AEAD rejection (a wrong aad, a tampered or truncated payload).
Variants§
Locked
Custody unlocked no keyring: the store is locked, or a master key was
never established. The app-data counterpart of the sync engine’s
master-key gate — unlock returning None is refused here, never
treated as an empty keyring to seal under.
Custody(KeyError)
Custody could not produce the keyring — a wrong passphrase, an
unreadable backing store. Distinct from Self::Locked, which is a
legitimate absence rather than a failure.
UnknownVersion(u8)
The payload’s leading version byte is not one this build seals or reads.
UnknownKey(String)
The payload names a key (by fingerprint) this keyring does not hold: the keyring predates the payload, or the payload was sealed under a foreign one.
Crypto(EncryptionError)
The AEAD rejected the payload — a wrong aad, or a tampered or
truncated ciphertext. Surfaced as it happened, never masked.
Trait Implementations§
Source§impl Error for SealError
impl Error for SealError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<EncryptionError> for SealError
impl From<EncryptionError> for SealError
Source§fn from(source: EncryptionError) -> SealError
fn from(source: EncryptionError) -> SealError
Auto Trait Implementations§
impl Freeze for SealError
impl !RefUnwindSafe for SealError
impl Send for SealError
impl Sync for SealError
impl Unpin for SealError
impl UnsafeUnpin for SealError
impl !UnwindSafe for SealError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more