#[non_exhaustive]pub enum Error {
NoPathFound,
DepthExceeded,
BudgetExceeded,
#[non_exhaustive] NoValidPath {
tried: usize,
last_error: String,
},
}Expand description
Errors returned by path building.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoPathFound
No valid path from the target certificate to any trust anchor was found.
DepthExceeded
A topologically valid path exists but requires more intermediates than
the configured maximum (see PathBuilderConfig::max_depth, default
DEFAULT_MAX_DEPTH).
BudgetExceeded
The internal DFS node-visit budget was exhausted.
This guards against adversarial certificate pools that would otherwise
cause exponential search time. The DFS and the depth probe each start
with a fresh budget of PathBuilderConfig::dfs_budget node visits.
#[non_exhaustive]NoValidPath
build_first_valid_path exhausted build_path_candidates without
finding a candidate that pkix_path::validate_path accepted.
At least one topologically valid chain was found by the path builder,
but every chain was rejected by the verifier or the validation policy
(e.g., mixed-signature-algorithm cross-signed pools where the DFS
candidate order picks an algorithm the SignatureVerifier does not
dispatch; cross-cert chains where one issuer is expired at the
validation time; etc.).
tried is the count of candidate chains rejected; it is always
>= 1 for this variant (zero-yield exhaustion is reported as
Error::NoPathFound instead, matching build_path’s contract).
last_error is the pkix_path::Error::Display rendering of the
last candidate’s validation failure. It is carried as a String
rather than a pkix_path::Error so Error retains its Hash
derive (the upstream error enum does not implement Hash). Callers
that need to programmatically match on the inner error should iterate
build_path_candidates directly and call pkix_path::validate_path
per candidate themselves.
Fields
This variant is marked as non-exhaustive
last_error: StringDisplay rendering of the last pkix_path::Error observed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
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>,
impl Eq for Error
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.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()