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
//! Matter protocol certificate format — parsing and serialisation.
//!
//! Implements Matter Core Specification §6.5: a TLV-encoded variant of
//! X.509 used for both attestation chains (DAC → PAI → PAA) and
//! operational chains (NOC → ICAC → RCAC).
//!
//! # Scope
//!
//! - **Parse and serialise** — [`MatterCertificate`] over the Matter TLV
//! form, byte-exact on round-trip. Distinguished names including the
//! Matter-specific OIDs ([`name`]) and the extension set
//! ([`extensions`]: basic constraints, key usage, extended key usage,
//! subject and authority key identifiers).
//! - **Public keys and signatures** — P-256 key extraction
//! ([`public_key`]) and the raw `r || s` Matter [`signature`] form.
//! - **X.509 DER conversion** — real Matter signatures are made over the
//! X.509 DER `TBSCertificate`, not over the TLV form, so
//! [`MatterCertificate::verify_signed_by`] reconstructs it. Byte parity
//! against matter.js's `asUnsignedDer()` is the correctness gate.
//! - **Chain validation** — [`CertificateChain::validate`] against
//! [`TrustedRoots`], checking time bounds, the CA bit above the leaf,
//! DN linkage, the path-length constraint, and each signature.
//! - **Issuance** — [`Builder`] constructs an [`UnsignedCertificate`], and
//! [`operational`] adds role-aware constructors that bake in the
//! extension and DN profile the spec mandates for RCAC, ICAC, and NOC.
//! Signing is a separate step, so it can happen in an HSM, an OS
//! keychain, or an offline ceremony rather than in this process.
//!
//! Cryptographic verification is delegated to `ring`. This crate
//! never implements the underlying maths.
pub use ;
pub use MatterCertificate;
pub use ;
pub use ;
pub use ;
pub use ;
pub use PublicKey;
pub use Signature;
pub use MatterTime;
/// Compile-checks the Rust examples in this crate's `README.md`.
///
/// `#[cfg(doctest)]` means the item exists only while rustdoc is collecting
/// doctests, so the README is compiled by `cargo test --doc` without being
/// duplicated into the rendered crate docs.
;