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.