pub struct PathBuilder<'a, 'p> { /* private fields */ }Expand description
Build a VerifiedPath for an end-entity certificate from the given trust anchors.
Implementations§
Source§impl<'a, 'p: 'a> PathBuilder<'a, 'p>
impl<'a, 'p: 'a> PathBuilder<'a, 'p>
Sourcepub fn new(
intermediate_certs: &'p [CertificateDer<'p>],
revocation: Option<RevocationOptions<'a>>,
eku: &'p dyn ExtendedKeyUsageValidator,
supported_sig_algs: &'a [&'a dyn SignatureVerificationAlgorithm],
trust_anchors: &'p [TrustAnchor<'p>],
) -> Self
pub fn new( intermediate_certs: &'p [CertificateDer<'p>], revocation: Option<RevocationOptions<'a>>, eku: &'p dyn ExtendedKeyUsageValidator, supported_sig_algs: &'a [&'a dyn SignatureVerificationAlgorithm], trust_anchors: &'p [TrustAnchor<'p>], ) -> Self
Build a new PathBuilder with the given parameters.
intermediate_certsis the list of intermediate certificates to use for path building. These certificates should be sent by the peer. They are not trusted, but can be used to build a path to a trusted root.revocationprovides the revocation options to use for path building. IfNone, no revocation checks will be performed.ekuis the intended usage of the certificate, indicating what kind of usage we’re verifying the certificate for. The defaultExtendedKeyUsageValidatorimplementation isExtendedKeyUsage.supported_sig_algsis the list of signature algorithms that are trusted for use in certificate signatures; the end-entity certificate’s public key is not validated against this list.trust_anchorsis the list of root CAs to trust in the built path.
Sourcepub fn with_path_verification(
self,
verify: &'a dyn Fn(&VerifiedPath<'_>) -> Result<(), Error>,
) -> Self
pub fn with_path_verification( self, verify: &'a dyn Fn(&VerifiedPath<'_>) -> Result<(), Error>, ) -> Self
Set a path verification function to use for path building.
verify() will only be called for potentially verified paths, that is, paths that
have been verified up to the trust anchor. As such, verify() cannot be used to
verify a path that doesn’t satisfy the constraints listed above; it can only be used to
reject a path that does satisfy the aforementioned constraints. If verify() returns
an error, path building will continue in order to try other options.
By default, no additional path verification is done.
Sourcepub fn build(
&self,
end_entity: &'p EndEntityCert<'p>,
time: UnixTime,
) -> Result<VerifiedPath<'p>, Error>
pub fn build( &self, end_entity: &'p EndEntityCert<'p>, time: UnixTime, ) -> Result<VerifiedPath<'p>, Error>
Build a VerifiedPath for end_entity at the given time.
If successful, yields a VerifiedPath type that can be used to inspect a verified chain
of certificates that leads from the end_entity to one of the self.trust_anchors.