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
//! Commissioning: getting a device onto a fabric (Core ch. 5).
//!
//! The sequence of §2.8 is: discover the device, prove possession of its passcode with
//! PASE ([`crate::sc`]), check it is a genuine certified device, give it an operational
//! identity and a network, then talk to it over CASE. This module is the first and last
//! steps — everything that is *about* commissioning rather than about security.
//!
//! It holds four pieces: the **onboarding payload** — the QR code and manual pairing code
//! that carry a device's passcode from its label to a commissioner — the
//! [**fail-safe**](failsafe), the transaction that makes every commissioning write
//! recoverable; the [**commissioning window**](window), the node state three clusters share;
//! and [**PASE admission**](admission), §5.5's three rules on which `PBKDFParamRequest` a
//! commissionee may answer at all.
//!
//! ```
//! use matter_kit::commissioning::{
//! CustomFlow, DiscoveryCapabilities, OnboardingPayload, Passcode,
//! };
//! use matter_kit::msg::VendorId;
//!
//! let payload = OnboardingPayload::new(
//! VendorId(0xFFF1),
//! 0x8001,
//! 3840,
//! Passcode::new(20_202_021)?,
//! DiscoveryCapabilities::ON_IP_NETWORK,
//! CustomFlow::Standard,
//! )?;
//!
//! let qr = payload.to_qr()?; // MT:…
//! let manual = payload.to_manual_code(false)?; // eleven digits
//! assert_eq!(OnboardingPayload::from_qr(&qr)?, payload);
//! assert_eq!(manual.len(), 11);
//! # Ok::<(), matter_kit::Error>(())
//! ```
/// The commissioner's side needs [`attestation`](crate::attestation) to check a device's DAC
/// and [`ca`](crate::ca) to issue it a NOC, both of which are cryptography.
pub use ;
pub use ;
pub use ;
pub use ;