#[non_exhaustive]pub enum Error {
Show 24 variants
InvalidPem(String),
UnexpectedPemLabel(String, &'static str),
InvalidPkcs8(String),
UnsupportedAlgorithm(String),
UnsupportedRsaSize(u32),
Crypto(&'static str),
KeyGeneration(&'static str),
InvalidBase64(Error),
InvalidMultibase(Error),
InvalidMultikeyPrefix,
InvalidMultikeyLength {
expected: usize,
actual: usize,
},
MissingHeader(&'static str),
InvalidHeader {
name: &'static str,
reason: String,
},
MalformedSignatureHeader(String),
VerificationFailed,
KeyResolution(String),
DigestMismatch,
UnsupportedDigestAlgorithm(String),
RequiredHeaderAbsent(String),
MissingSignatureParameter(&'static str),
TimestampMissing,
TimestampTooOld {
timestamp: DateTime<Utc>,
now: DateTime<Utc>,
},
TimestampInFuture {
timestamp: DateTime<Utc>,
now: DateTime<Utc>,
},
TimestampExpired {
expires: DateTime<Utc>,
now: DateTime<Utc>,
},
}Expand description
Enumeration of every failure mode that this crate can surface.
The enum is non-exhaustive so that additional signature schemes or cryptographic algorithms can be added in minor releases without breaking downstream code.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidPem(String)
The provided PEM document could not be parsed.
UnexpectedPemLabel(String, &'static str)
The PEM document had an unexpected -----BEGIN <LABEL>----- line.
InvalidPkcs8(String)
A PKCS#8 DER blob could not be decoded.
UnsupportedAlgorithm(String)
The key’s algorithm identifier was not supported.
UnsupportedRsaSize(u32)
The RSA key size was outside the supported range.
The bounds mirror aws-lc-rs’s
RSA_PKCS1_2048_8192_SHA256 verification profile: any modulus
width between 2048 and 8192 bits (inclusive) whose byte count is
whole (i.e. divisible by 8) is accepted.
Crypto(&'static str)
An underlying aws-lc-rs primitive failed.
KeyGeneration(&'static str)
Generation of a new key failed at the RNG layer.
InvalidBase64(Error)
A signature’s Base64 encoding was malformed.
InvalidMultibase(Error)
Multibase decoding of a FEP-521a publicKeyMultibase failed.
InvalidMultikeyPrefix
The multicodec prefix on a Multikey was unrecognised or truncated.
InvalidMultikeyLength
The raw key material following the multicodec prefix had the wrong length.
MissingHeader(&'static str)
A required HTTP header is missing.
InvalidHeader
An HTTP header’s value was not valid UTF-8 or otherwise unparseable.
Fields
MalformedSignatureHeader(String)
The Signature header’s parameter list was malformed.
VerificationFailed
The signature did not verify against the provided key.
KeyResolution(String)
The resolver closure returned an error while fetching the signer’s key.
DigestMismatch
The Digest / Content-Digest header did not match the body.
UnsupportedDigestAlgorithm(String)
The requested digest algorithm is not supported.
RequiredHeaderAbsent(String)
The signature-base string includes a header that the request does not carry.
MissingSignatureParameter(&'static str)
A signature parameter required by the standard is missing.
TimestampMissing
The signature carried no created parameter and no Date
header, and the active VerifyPolicy
requires one.
TimestampTooOld
The signature is older than the policy’s max_age.
Fields
TimestampInFuture
The signature claims to have been produced further in the future
than the policy’s max_clock_skew_future tolerance allows.
Fields
TimestampExpired
The signature’s expires parameter indicates it has lapsed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()