#[non_exhaustive]pub enum X509Error {
EmptyChain,
ChainTooLong {
length: usize,
max: usize,
},
InvalidCertificate {
index: usize,
source: Box<dyn Error + Send + Sync>,
},
InvalidPem(String),
SelfSigned,
InvalidTime(i64),
PathValidation(Box<dyn Error + Send + Sync>),
TrustAnchorNotCa {
index: usize,
},
KeyUsage,
UnsupportedKey(String),
InvalidKey(String),
}x509 only.Expand description
Why an x5c chain yields no key.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyChain
The chain holds no certificate.
ChainTooLong
The chain holds more certificates than X509Resolver::MAX_CHAIN_LENGTH.
InvalidCertificate
A certificate does not decode.
Fields
InvalidPem(String)
The PEM text does not hold certificates.
SelfSigned
The first certificate is self-issued: its subject is its issuer, as in a self-signed certificate. HAIP forbids it, and a certificate is not a trust anchor because a token carries it.
InvalidTime(i64)
The validation time is before the Unix epoch.
PathValidation(Box<dyn Error + Send + Sync>)
No path from the first certificate to a trust anchor validates: an unknown issuer, a wrong signature, an expired certificate, a CA constraint. The source says which.
TrustAnchorNotCa
A trust anchor is not a CA certificate, or its keyUsage lacks keyCertSign.
KeyUsage
The first certificate has a keyUsage extension that does not allow signing a token:
it has neither digitalSignature nor nonRepudiation, or asserts keyCertSign.
UnsupportedKey(String)
The first certificate’s key is of a kind no JWS algorithm of this crate uses.
InvalidKey(String)
The first certificate’s key does not decode.
Trait Implementations§
Source§impl Error for X509Error
impl Error for X509Error
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()