#[non_exhaustive]pub enum CertChainError {
NoTrustAnchors,
CertificateExpired {
subject: String,
not_after: String,
},
AllTrustAnchorsExpired {
issuer: String,
},
SignatureVerification {
subject: String,
},
PathLenViolated {
intermediate_count: usize,
path_len: u8,
},
NotACa {
subject: String,
},
Cycle {
subject: String,
},
NoMatchingIssuer {
issuer: String,
},
TooDeep,
Other(String),
}Expand description
Structured failure reason for certificate chain validation.
Returned inside SmimeError::CertChain. Callers can match on this enum
to distinguish specific failure modes (e.g. expired certificate vs. missing
trust anchor) without parsing error strings.
§Compatibility stubs
Two variants — AllTrustAnchorsExpired and PathLenViolated — are marked
#[deprecated] and are never emitted by the current validator. They
exist solely so that serialized data produced by older versions of this crate
can be deserialized without error. New code should not match on them; see
each variant’s deprecation message for the current equivalent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoTrustAnchors
No trust anchors were provided.
CertificateExpired
Certificate validity period does not contain the check time.
Fields
AllTrustAnchorsExpired
match CertificateExpired instead
All trust anchors matching the issuer DN are outside their validity period.
Present only for deserialization compatibility with data produced by older versions
of this crate; never emitted by the current validator. Match CertChainError::TooDeep
or CertChainError::CertificateExpired for the equivalent current failure modes.
Fields
SignatureVerification
Certificate signature does not match the issuer’s public key.
PathLenViolated
never produced by the current pkix-chain-based validator; match TooDeep instead
A pathLen constraint in a CA certificate was violated.
Present only for deserialization compatibility with data produced by older versions
of this crate; never emitted by the current validator. Match
CertChainError::TooDeep for the equivalent current failure mode.
Fields
NotACa
An intermediate certificate lacks the CA flag (BasicConstraints.cA = false).
Cycle
The certificate chain contains a cycle (A signed by B, B signed by A).
NoMatchingIssuer
No trust anchor or intermediate certificate matches the issuer DN.
TooDeep
Certificate chain exceeds the maximum allowed depth.
Other(String)
Other chain validation error (DER encoding failures, etc.).
Trait Implementations§
Source§impl Clone for CertChainError
impl Clone for CertChainError
Source§fn clone(&self) -> CertChainError
fn clone(&self) -> CertChainError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CertChainError
impl Debug for CertChainError
Source§impl<'de> Deserialize<'de> for CertChainError
impl<'de> Deserialize<'de> for CertChainError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CertChainError
impl Display for CertChainError
impl Eq for CertChainError
Source§impl PartialEq for CertChainError
impl PartialEq for CertChainError
Source§fn eq(&self, other: &CertChainError) -> bool
fn eq(&self, other: &CertChainError) -> bool
self and other values to be equal, and is used by ==.