#[non_exhaustive]pub struct PolicyTreeNode {
pub depth: usize,
pub valid_policy: ObjectIdentifier,
pub expected_policy_set: Vec<ObjectIdentifier>,
pub qualifiers: Vec<PolicyQualifierInfo>,
pub parent_policies: Vec<ObjectIdentifier>,
}Expand description
A node of the final policy graph, exposed for post-validation qualifier
extraction on ValidatedPath::valid_policy_tree.
Policy processing uses the RFC 9618 valid_policy_graph in place of the
RFC 5280 §6.1.2(a) valid_policy_tree: there is at most one node per
(depth, valid_policy), and a node that the RFC 5280 tree would copy
once per parent appears once, listing every parent in
parent_policies. The set of valid policies is
the same (RFC 9618 §3); the graph’s size stays linear in the size of the
path’s policy extensions, where the tree can grow exponentially.
This is the public mirror of an internal node type, kept separate so the internal representation is not part of the public API surface.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.depth: usizeDepth at which this node appears in the tree.
0 is the synthetic anyPolicy root sentinel (always present
while the tree is alive; carries no qualifiers). 1 is the
trust-anchor-adjacent CA. n is the leaf.
valid_policy: ObjectIdentifierThe policy OID this node represents.
May be id-ce-certificatePolicies-anyPolicy (2.5.29.32.0) for
nodes that survived an anyPolicy expansion or were not yet
materialized into specific policies.
expected_policy_set: Vec<ObjectIdentifier>Set of policies in the next certificate that are consistent with
this node, per RFC 5280 §6.1.2(a) expected_policy_set.
Initialized to {valid_policy} and updated by PolicyMappings
extensions during the walk.
qualifiers: Vec<PolicyQualifierInfo>Policy qualifiers attached to this node, in the upstream
PolicyQualifierInfo form: a (policy_qualifier_id, qualifier)
pair where qualifier is a raw der::Any. Decoding is left to
the caller because the x509-cert 0.2.5 UserNotice type has
an upstream typo on notice_ref — pass-through avoids the
buggy decoder. The two standard qualifier IDs are
id-qt-cps (1.3.6.1.5.5.7.2.1, qualifier is a CPSuri /
IA5String) and id-qt-unotice (1.3.6.1.5.5.7.2.2, qualifier
is a UserNotice).
parent_policies: Vec<ObjectIdentifier>valid_policy of each parent node at depth - 1 (nodes are unique
per depth, so the OID identifies the parent). Empty for the depth-0
root. A node’s parents are either exactly [anyPolicy] or a set of
specific policies.
Trait Implementations§
Source§impl Clone for PolicyTreeNode
impl Clone for PolicyTreeNode
Source§impl Debug for PolicyTreeNode
impl Debug for PolicyTreeNode
Source§impl<'de> Deserialize<'de> for PolicyTreeNode
Available on crate feature serde only.
impl<'de> Deserialize<'de> for PolicyTreeNode
serde only.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 PolicyTreeNode
Source§impl PartialEq for PolicyTreeNode
impl PartialEq for PolicyTreeNode
Source§impl Serialize for PolicyTreeNode
Available on crate feature serde only.
impl Serialize for PolicyTreeNode
serde only.