Skip to main content

CdSigningRoots

Struct CdSigningRoots 

Source
pub struct CdSigningRoots { /* private fields */ }
Expand description

Trusted CSA Certification Declaration signing roots.

Built from production roots via Self::from_cert_der (X.509 CD signing certificates, as published by the CSA DCL) or Self::from_pem (bare SubjectPublicKeyInfo PEMs), or seeded with the bundled synthetic CSA-test root via Self::with_example_device_roots.

Internally stores each trusted root as a SEC1-uncompressed P-256 public key (65 bytes: 0x04 || X || Y) so signature verification can call ring::signature::UnparsedPublicKey directly without re-parsing.

Implementations§

Source§

impl CdSigningRoots

Source

pub fn with_example_device_roots() -> Self

Build a trust store seeded with the CD signing roots that verify CSA test / example devices and the hermetic loopback:

  • the bundled synthetic root — its private half signs the loopback and fixture CDs the verifier tests consume;
  • chip’s real test CD signing authority; and
  • CSA production “CD Signing Key 001” — the key that signs the VID=0xFFF1 CD every CONFIG_EXAMPLE_DAC_PROVIDER device serves, including the esp-matter ESP32-C6. (chip’s own DefaultDeviceAttestationVerifier trusts the test and production keys; trusting only the test key rejects the C6, which cost a live commission to learn — see chip_cd_vector.rs.)

This verifies test / dev / example devices — not the full set of CSA production-certified products, which may present CDs signed by other CSA production keys. A commissioner for arbitrary certified devices loads the whole CSA root set via Self::from_cert_der / Self::from_pem (e.g. matter_controller::AttestationTrust::from_dirs).

Each bundled root is a compile-time constant; one that fails to parse is skipped rather than panicking, and the verifier then rejects any CD that needed it with AttestationError::CertificationDeclarationSignatureInvalid.

Source

pub fn from_pem(pems: &[&[u8]]) -> Result<Self, AttestationError>

Build a trust store from PEM-encoded P-256 SubjectPublicKeyInfo blobs (one per trusted CSA signing root).

§Errors

Returns AttestationError::CertificationDeclarationMalformed if any input fails to parse. An empty slice returns an empty trust store.

Source

pub fn from_cert_der(certs: &[&[u8]]) -> Result<Self, AttestationError>

Build a trust store from X.509 certificate DER blobs (one per trusted CSA CD signing root), extracting each certificate’s P-256 subject public key.

This is the ingestion path for real-world CD signing roots: the CSA Distributed Compliance Ledger — and the connectedhomeip credentials/production/cd-certs/ mirror of it — publish the roots as X.509 certificates, not as the bare SubjectPublicKeyInfo PEMs that Self::from_pem consumes. There are several distinct CSA CD signing keys, so a real commissioner typically loads the whole directory.

The certificate is treated purely as a trust anchor: only its subject public key is extracted. No signature, validity-window, or chain checks are performed — the operator vouches for the roots by supplying them (exactly as Self::from_pem trusts the keys it is given).

§Errors

Returns AttestationError::CertificationDeclarationMalformed if any input fails to parse as an X.509 certificate, or does not carry a 65-byte SEC1-uncompressed P-256 public key.

Source

pub fn len(&self) -> usize

Number of trusted roots in the store.

Source

pub fn is_empty(&self) -> bool

Returns true if no trusted roots have been loaded.

Trait Implementations§

Source§

impl Clone for CdSigningRoots

Source§

fn clone(&self) -> CdSigningRoots

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CdSigningRoots

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.