pub struct CertRef<'a>(/* private fields */);Implementations§
Source§impl<'a> CertRef<'a>
impl<'a> CertRef<'a>
pub const fn new(tlv: TLVElement<'a>) -> CertRef<'a>
pub fn pubkey(&self) -> Result<&[u8], Error>
pub fn get_node_id(&self) -> Result<u64, Error>
pub fn get_cat_ids(&self, output: &mut [u32]) -> Result<(), Error>
pub fn get_fabric_id(&self) -> Result<u64, Error>
Sourcepub fn get_ca_id(&self) -> Result<u64, Error>
pub fn get_ca_id(&self) -> Result<u64, Error>
Subject CA-ID — the RootCaId of an RCAC or the IcaId of an
ICAC. Matter-issued RCACs always carry exactly one RootCaId
in their subject DN; ICACs always carry exactly one IcaId
(spec). Returns the first matching value; errors out if
neither tag is present.
Sourcepub fn basic_constraints_path_len(&self) -> Result<Option<u8>, Error>
pub fn basic_constraints_path_len(&self) -> Result<Option<u8>, Error>
BasicConstraints.pathLenConstraint, or None if absent (either the
extension itself is missing or the field is omitted).
Exposed for the AddTrustedRootCertificate flow, which the Matter spec
requires to additionally reject an RCAC whose pathLenConstraint is
greater than 1 (see CHIP’s ValidateChipRCAC).
Sourcepub fn is_self_signed(&self) -> Result<bool, Error>
pub fn is_self_signed(&self) -> Result<bool, Error>
Whether this certificate is self-signed (its AuthorityKeyId matches
its SubjectKeyId). Matter-issued RCACs are always self-signed; an
ICAC or NOC must not be (Matter Core spec).
pub fn as_asn1(&self, buf: &mut [u8]) -> Result<usize, Error>
Sourcepub fn verify_chain_start<C>(
&'a self,
crypto: C,
utc_time: UtcTime,
) -> CertVerifier<'a, C>where
C: Crypto,
pub fn verify_chain_start<C>(
&'a self,
crypto: C,
utc_time: UtcTime,
) -> CertVerifier<'a, C>where
C: Crypto,
Start a chain verification of this certificate.
Every cert added to the chain (the leaf here, intermediates via
CertVerifier::add_cert, and the self-signed root via
CertVerifier::finalise) is checked against lkg_utc_secs
for its NotBefore / NotAfter validity window, per Matter
Core spec which mandates use of the Last-Known-Good UTC
Time when no live trusted real-time-clock value is available.
Callers snapshot the value from
[crate::Matter::last_known_utc_time] (Matter-epoch seconds).
Trait Implementations§
impl<'a> Eq for CertRef<'a>
Source§impl<'a> FromTLV<'a> for CertRef<'a>
impl<'a> FromTLV<'a> for CertRef<'a>
Source§fn from_tlv(element: &TLVElement<'a>) -> Result<CertRef<'a>, Error>
fn from_tlv(element: &TLVElement<'a>) -> Result<CertRef<'a>, Error>
Source§fn init_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
fn init_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
Source§fn nullable_from_tlv(element: &TLVElement<'a>) -> Result<Self, Error>
fn nullable_from_tlv(element: &TLVElement<'a>) -> Result<Self, Error>
Source§fn init_nullable_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
fn init_nullable_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
impl<'a> StructuralPartialEq for CertRef<'a>
Source§impl<'a> ToTLV for CertRef<'a>
impl<'a> ToTLV for CertRef<'a>
Source§fn to_tlv<W>(&self, tag: &TLVTag, tw: W) -> Result<(), Error>where
W: TLVWrite,
fn to_tlv<W>(&self, tag: &TLVTag, tw: W) -> Result<(), Error>where
W: TLVWrite,
Source§fn tlv_iter(&self, tag: TLVTag) -> impl Iterator<Item = Result<TLV<'_>, Error>>
fn tlv_iter(&self, tag: TLVTag) -> impl Iterator<Item = Result<TLV<'_>, Error>>
TLV instances by potentially borrowing
data from the type.Auto Trait Implementations§
impl<'a> Freeze for CertRef<'a>
impl<'a> RefUnwindSafe for CertRef<'a>
impl<'a> Send for CertRef<'a>
impl<'a> Sync for CertRef<'a>
impl<'a> Unpin for CertRef<'a>
impl<'a> UnsafeUnpin for CertRef<'a>
impl<'a> UnwindSafe for CertRef<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more