Expand description
RFC 4158 certification path building for pkix_path.
Accepts an unordered collection of certificates (CertPool) and
constructs a valid ordered chain suitable for pkix_path::validate_path.
§Relationship to pkix-path
pkix-path validates a caller-ordered &[Certificate]. This crate
handles the prior step: discovering and ordering that chain from a bag
of certificates when the caller does not know the chain order in advance.
Cross-certificates and bridge CA topologies are handled here, not in
pkix-path.
§Algorithm
build_path and build_path_with_config perform a single-pass
depth-first search up to PathBuilderConfig::max_depth (default
DEFAULT_MAX_DEPTH = 10). At each step, candidates are ranked by
AKI/SKI match tier (RFC 4158 §3.2) so the most-likely issuer is tried
first. Memory is bounded to O(depth) stack frames.
Shortest-first is not guaranteed: for typical pools the first chain
found is the shortest, but adversarial pools may yield a deeper chain
first. See PathCandidates for the full enumeration contract.
§Spec references
- RFC 4158 — Internet X.509 PKI: Certification Path Building
- RFC 5280 §6.1 — the validation algorithm this crate feeds into
§no_std
This crate is no_std but requires the alloc crate. The extern crate alloc
declaration is provided automatically; you do not need to add it yourself, but
your target must supply a global allocator (e.g., #[global_allocator]).
§Limitations
- Caller supplies the candidate set.
CertPooltakes a pool of already-loaded certificates. This crate does not fetch missing intermediates fromAuthorityInfoAccessURIs; the optionalpkix-aia/pkix-aia-httpcascade handles that (tracked underPKIX-zkjb). - Output feeds
pkix-path. The validation algorithm (RFC 5280 §6.1 signature chain walk, name constraints, policy machinery, revocation) lives inpkix-pathandpkix-revocation. This crate’s job ends when it returns an ordered candidate chain. - Known residual divergence. A single bettertls path-building
corner case (
pathbuilding::tc60) is documented as a known divergence; closing it is a 1.0 release blocker tracked underPKIX-lwr9.4. Seepkix-difftest/baseline-limbo-analysis.md.
Structs§
- Cert
Pool - An unordered collection of certificates used as input to path building.
- Path
Builder Config - Tunable parameters for path building.
- Path
Candidates - Iterator over topologically-valid certification paths from a target cert through a candidate pool to one of a set of trust anchors.
Enums§
- Error
- Errors returned by path building.
Constants§
- DEFAULT_
DFS_ BUDGET - Default DFS node-visit budget per search pass.
- DEFAULT_
MAX_ DEPTH - Default maximum number of intermediate certificates considered.
Functions§
- build_
first_ valid_ path - Build a certification path that both (a) is topologically valid through
poolto one ofanchorsand (b) passespkix_path::validate_pathunderpolicyandverifier. - build_
first_ valid_ path_ with_ config - Build a verifier-validated certification path with caller-provided budget and depth tunables.
- build_
path - Build a certification path from
targetthrough certificates inpoolto one of the provided trust anchors. - build_
path_ candidates - Construct a
PathCandidatesiterator using the workspace defaults (DEFAULT_MAX_DEPTH,DEFAULT_DFS_BUDGET). - build_
path_ candidates_ with_ config - Construct a
PathCandidatesiterator with caller-provided budget and depth tunables. - build_
path_ with_ config - Build a certification path with caller-provided budget and depth tunables.
Type Aliases§
- Result
- Result alias for this crate.