1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//! Matter commissioning state machine.
//!
//! This is Milestone 6 of the `matter-rust` roadmap. The crate is currently
//! shipping in phases:
//!
//! - **M6.1:** setup payload codec — see [`setup`].
//! - **M6.2.1:** typed attestation cert wrappers ([`Dac`], [`Pai`],
//! [`Paa`]) and [`PaaTrustStore`] — see [`attestation`].
//! - **M6.2.2 (current):** [`verify_chain`] — `rustls-webpki` path
//! validation with `KeyUsage::client_auth()`, plus a Matter
//! VID/PID equality overlay. Six new [`AttestationError`] variants.
//! - **M6.2.3:** `verify_attestation_response` + matter.js
//! byte-parity capture.
//! - **M6.2.4–M6.2.6:** see [`attestation`].
//! - **M6.3:** Node Operational Certificate issuance — see [`noc`].
//! - **M6.4.2:** attestation on-wire flow + off-wire
//! `AttestationVerification`. State machine drives
//! `SendPaiCertRequest` → `SendDacCertRequest` →
//! `SendAttestationRequest` → `AttestationVerification`, chaining
//! M6.2's `verify_chain` + `verify_attestation_response` + the
//! `extract_attestation_elements_fields` helper.
//! - **M6.4.3:** CD verification wired into
//! `AttestationVerification`. The state machine now calls
//! `verify_certification_declaration` against
//! [`attestation::CdSigningRoots`] and advances past attestation on
//! a valid CD; `CommissionerConfig` gains a `cd_signing_roots`
//! reference.
//! - **M6.4.4:** CSR + NOC issuance flow. State machine
//! drives `SendOpCertSigningRequest` → `ValidateCsr` →
//! `GenerateNocChain` → `SendTrustedRootCert` → `SendNoc`, then
//! advances to `Stage::ReadNetworkCommissioningInfo` (M6.5.2 expands
//! the network subgraph). Integrates M6.3's
//! `verify_csr_response` + `issue_noc` + the `OpCreds`
//! `AddTrustedRoot` / `AddNOC` encoders.
//! - **M6.4.5:** PASE→CASE handoff + `CommissioningComplete`.
//! The state machine drives end-to-end from `SecurePairing` through
//! `Action::Done(CommissionedFabric)` on canned responses plus a
//! mock `on_case_established()` callback. New public API
//! `Commissioner::on_case_established` for the M6.6 driver's CASE
//! handshake success signal; `Expectation::CaseFailed` for the
//! failure path.
//! - **M6.4 (complete):** commissioning state machine. End-to-end
//! cursor from `SecurePairing` through
//! `Action::Done(CommissionedFabric)` on canned responses + a
//! mock CASE-established callback. matter.js byte-parity gate
//! infrastructure shipped — see [`state_machine`] for the API.
//! - **M6.5 (current):** Wi-Fi network commissioning. Expands the
//! `NetworkCommissioning` no-op slot into the real Wi-Fi sub-cursor
//! (`ReadNetworkCommissioningInfo` → `NetworkSetup` →
//! `FailsafeBeforeNetworkEnable` → `NetworkEnable`; the generic stages
//! also carry the M9-C2 Thread provisioning path). Ethernet-only
//! devices skip the Wi-Fi sub-cursor entirely; Thread-only devices
//! fail fast with a typed `NetworkFeatureUnsupported` error. New
//! `RemediationHint` enum surfaces actionable categories for
//! `NetworkRejected`. Failsafe-expiry now derives from
//! `BasicCommissioningInfo` (was hardcoded 60s in M6.4). Optional
//! `tracing` feature instruments every dispatch arm.
//! - **M6.6.1 (current):** Interaction Model framing — see [`im`].
//! `build_invoke_request` / `parse_invoke_response`,
//! `build_read_request` / `parse_report_data`. Pure codec over
//! `matter-codec`; the wire-I/O driver follows in M6.6.2+.
//! - **M6.6 (next-next):** Tokio driver + first real-device
//! commission. Wires the M6.4 state machine into `matter-transport`'s
//! session layer + drives `matter-crypto`'s SIGMA-I CASE handshake.
//!
//! ## Quick-start (M6.1 only)
//!
//! ```
//! use matter_commissioning::setup::{parse_qr, parse_manual_code};
//! # fn run() -> Result<(), matter_commissioning::setup::Error> {
//! let from_qr = parse_qr("MT:Y.K90AFN00KA0648G00")?;
//! let from_manual = parse_manual_code("11693312331")?;
//! assert_eq!(from_qr.vendor_id, Some(0xFFF1));
//! assert_eq!(from_manual.passcode.as_u32(), 20_202_021);
//! # Ok(())
//! # }
//! # let _ = run;
//! ```
//!
//! Replace the QR string + manual code above with values captured for
//! your own devices via `cargo xtask capture-setup` if you change the
//! fixture set.
//!
//! ## Optional `tracing` feature
//!
//! Enable the `tracing` crate feature to get per-method spans on
//! `Commissioner::poll`, `Commissioner::on_response`, and
//! `Commissioner::on_case_established`. Span fields (`stage`,
//! `expectation`) align best-effort with matter.js's log-event format
//! so operators can grep across both implementations. Compatibility
//! is not guaranteed across matter.js minor versions.
/// Lowercase-hex rendering for `tracing` debug dumps of wire bytes.
pub
/// Interaction Model message framing — re-exported from [`matter_interaction`]
/// (lifted out of this crate in M7.1; all `im::` paths are unchanged).
pub use matter_interaction as im;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use TestStateSeeds;
pub use ;
pub use ;