#[non_exhaustive]pub enum Error {
Show 13 variants
MalformedEnvelope(String),
NonCanonicalBase64 {
field: &'static str,
},
NoSignatures,
ThresholdNotMet {
accepted: usize,
threshold: usize,
},
ZeroThreshold,
DuplicateKeyId {
key_id: String,
},
DuplicateKeyIdentity {
first: usize,
second: usize,
},
UnidentifiedKey {
index: usize,
},
UnidentifiedKeyIdentity {
index: usize,
},
EmptyPayloadType,
TooManySignatures {
got: usize,
cap: usize,
},
Signing(String),
InvalidKey(String),
}Expand description
Errors from envelope, threshold and key validation, or a signing backend.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MalformedEnvelope(String)
The envelope was not well-formed JSON, or a required member was absent.
NonCanonicalBase64
payload or a sig was not canonical RFC 4648 base64 in either the
standard or the URL-safe alphabet.
NoSignatures
signatures was present but empty. The envelope schema requires at
least one signature, so an empty list can never be satisfied.
ThresholdNotMet
Fewer than threshold distinct trusted keys produced a valid signature.
Fields
ZeroThreshold
A threshold of zero was requested. Zero would verify an envelope with no valid signature at all.
DuplicateKeyId
Two supplied keys reported the same identifier, so a threshold cannot count them apart. The count is over distinct keys, and a set that cannot be counted is refused rather than counted wrongly.
DuplicateKeyIdentity
Two verifier entries refer to the same verification key under different identifiers. Counting both would let one signature satisfy a threshold.
Fields
UnidentifiedKey
A threshold above one was requested with a key that reports no identifier. Anonymous keys cannot be told apart, so the same key supplied twice would satisfy a 2-of-n on its own.
UnidentifiedKeyIdentity
A key set cannot prove distinct keys when one verifier reports only a caller-chosen label instead of a stable key identity.
EmptyPayloadType
payloadType was present but empty. An empty type binds nothing, and the
whole purpose of the pre-authentication encoding is to bind the type.
TooManySignatures
The envelope carries more signature entries than crate::MAX_SIGNATURES.
Signing(String)
The signer could not produce a signature.
InvalidKey(String)
A key could not be constructed from the supplied bytes.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()