#[non_exhaustive]pub struct FabricConfig {
pub fabric_id: u64,
pub rcac_id: u64,
pub commissioner_node_id: u64,
pub validity: (MatterTime, MatterTime),
pub issue_icac: bool,
}Expand description
Inputs for creating a new fabric.
#[non_exhaustive]: future fabric-creation knobs (e.g. an explicit IPK or
an ICAC tier) can be added without a semver break. Construct via
FabricConfig::new from outside this crate.
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.fabric_id: u64Matter fabric identifier (spec §6.2.1).
rcac_id: u64RCAC subject DN’s rcac-id value.
commissioner_node_id: u64The stable node ID the controller takes on this fabric.
validity: (MatterTime, MatterTime)(not_before, not_after) validity for the RCAC and commissioner NOC.
Pass a real wall-clock not_before — e.g.
MatterTime::from_unix_secs(current_unix_time), typically backdated a
little (an hour is plenty) to tolerate device clock skew. Use
MatterTime::NO_EXPIRY for not_after if the fabric should not
expire.
MatterController::create_fabric
validates this window and returns
crate::Error::InvalidFabricValidity rather than letting a bad one
reach a device. Four ways to get it wrong:
not_beforeat the Matter epoch (MatterTime(0), equivalentlyMatterTime::from_unix_secs(0)) — the reporter’s failure in issue #111. The cause is a signature mismatch, not a validity policy: chip’sChipEpochToASN1Time(connectedhomeip/src/credentials/CHIPCert.cpp) maps epoch 0 to the X.509 sentinel99991231235959Zfor bothnotBeforeandnotAfter, so a device rebuilding the X.509 TBS from our TLV certificate hashes99991231235959Zwhere we signed20000101000000Zand the signature check fails. chip’s own comment: such certificates “are not usable with this code” and “attempted installation of such certficates will fail during commissioning” — surfacing as an opaqueIM status 0x85rejection ofAddTrustedRootCertificatedeep in commissioning.not_beforefar in the future — most often a millisecond timestamp handed toMatterTime::from_unix_secs, which saturates toMatterTime(u32::MAX)(≈ year 2136). This one is worse than a rejection:ValidateChipRCACdeliberately does not check RCAC validity times (CHIPCert.cpp), soAddTrustedRootCertificatesucceeds and the fabric half-commissions, then every CASE session fails withkNotYetValid.- An already-expired window — the symmetric twin of the one above,
most often a
(not_before, not_after)pair copied from an older document. The ordering check passes andnot_beforeis in the past, so only a comparison against the clock catches it; the sameValidateChipRCACexemption means the expired root installs and CASE then fails withkExpired. - A units mistake in
not_after—from_unix_secsclamps any pre-2000 Unix time toMatterTime(0), andMatterTime(0)isMatterTime::NO_EXPIRY, so such a mistake silently yields “never expires” — the opposite of the intent — and cannot be rejected here.
issue_icac: boolWhen true, create_fabric mints an intermediate CA (ICAC) under
the RCAC and signs the commissioner NOC (and, later, all NOCs
issued on this fabric) under the ICAC instead of directly under the
RCAC. Defaults to false (the flat RCAC->NOC path) via
FabricConfig::new.
Implementations§
Source§impl FabricConfig
impl FabricConfig
Sourcepub fn new(
fabric_id: u64,
rcac_id: u64,
commissioner_node_id: u64,
validity: (MatterTime, MatterTime),
) -> Self
pub fn new( fabric_id: u64, rcac_id: u64, commissioner_node_id: u64, validity: (MatterTime, MatterTime), ) -> Self
Construct a fabric configuration.
This is the supported construction path now that FabricConfig is
#[non_exhaustive]; the public fields remain readable/writable in
place. See FabricConfig::validity for what to pass as validity —
in particular, a real wall-clock not_before, not the Matter epoch.
Trait Implementations§
Source§impl Clone for FabricConfig
impl Clone for FabricConfig
Source§fn clone(&self) -> FabricConfig
fn clone(&self) -> FabricConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more