pub enum SealError {
UnknownSuite(String),
MalformedEncoding(&'static str),
MalformedKey(&'static str),
OpenRefused,
SealFailed(String),
}Expand description
This crate’s own refusals — deliberately NOT APH_E codes (RFC 0008 §5:
the §11 set is closed, and names are minted by the version that can
declare them, not by a draft).
Variants§
UnknownSuite(String)
The payload names a suite this implementation does not compile. One suite, no negotiation — an unknown value is refused, never skipped.
MalformedEncoding(&'static str)
A base64url field would not decode; malformed before cryptography.
MalformedKey(&'static str)
A key was not the KEM’s serialized length/shape.
OpenRefused
AEAD open failed: the wrong key, a tampered ciphertext, or — the case the AAD exists for — a seal lifted from a different envelope. All three are indistinguishable BY DESIGN (that is what AEAD promises), so the refusal names all three rather than guessing.
SealFailed(String)
The HPKE encapsulation step itself failed (a malformed reader key surfaces here when it parses but cannot be used).
Trait Implementations§
impl Eq for SealError
Source§impl Error for SealError
impl Error for SealError
1.30.0 · 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
use the Display impl or to_string()