pub struct CertificateChain<'a> { /* private fields */ }Expand description
A chain of Matter certificates, ordered from leaf to topmost
intermediate. The root itself is supplied separately via
TrustedRoots.
Implementations§
Source§impl<'a> CertificateChain<'a>
impl<'a> CertificateChain<'a>
Sourcepub fn new(certs: &'a [MatterCertificate]) -> Self
pub fn new(certs: &'a [MatterCertificate]) -> Self
Wrap a slice of certs as a chain.
Empty slices are accepted here — Self::validate is what
rejects them (with Error::UntrustedRoot).
Sourcepub fn validate(&self, roots: &TrustedRoots, at: MatterTime) -> Result<()>
pub fn validate(&self, roots: &TrustedRoots, at: MatterTime) -> Result<()>
Validate the chain against roots at the moment at.
Returns Ok(()) iff every per-cert check passes AND the topmost
cert anchors against at least one entry in roots.
§Errors
Returns the most-specific Error variant identifying which check
failed; for per-cert failures the variant carries cert_index
(0 = leaf). Error::UntrustedRoot is returned for empty chains,
no matching anchor, or anchor signature failure.
Error::MissingKeyCertSign is returned when a non-leaf CA cert
lacks the keyCertSign KeyUsage bit, and Error::LeafIsCa when
the end-entity leaf asserts basic_constraints.is_ca = true.
Returns any error MatterCertificate::to_x509_tbs_der returns for
the top certificate.
Trait Implementations§
Source§impl<'a> Clone for CertificateChain<'a>
impl<'a> Clone for CertificateChain<'a>
Source§fn clone(&self) -> CertificateChain<'a>
fn clone(&self) -> CertificateChain<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more