Skip to content

Commit 152a1f1

Browse files
authored
[doc] Add example of 'chip-cert gen-cd' command. (#22516)
* [doc] Add example of 'chip-cert gen-cd' command. * [spell] Add CMS acronym (RFC 6552).
1 parent dc960f3 commit 152a1f1

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/.wordlist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ ClusterTestGeneration
253253
cmake
254254
CMakeLists
255255
CMD
256+
CMS
256257
CMSIS
257258
CMVH
258259
cn

src/tools/chip-cert/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [Directory Structure](#directory-structure)
99
- [<code>/src/tools/chip-cert</code>](#srctoolschip-cert)
1010
- [Usage Examples](#usage-examples)
11+
- [Building](#building)
1112
- [Operational Certificates Usage Examples](#operational-certificates-usage-examples)
1213
- [Attestation Certificates Usage Examples](#attestation-certificates-usage-examples)
1314
- [Command Reference](#command-reference)
@@ -21,6 +22,7 @@
2122
- [gen-att-cert](#gen-att-cert)
2223
- [validate-att-cert](#validate-att-cert)
2324
- [gen-cd](#gen-cd)
25+
- [gen-cd example](#gen-cd-example)
2426
- [version](#version)
2527

2628
## Introduction
@@ -57,6 +59,18 @@ Specify '--help' option for detail instructions on usage of each command:
5759
./chip-cert gen-cert --help
5860
```
5961

62+
### Building
63+
64+
The `chip-cert` tool will be built when `gn_build.sh` is run. To build just the
65+
`chip-cert` tool locally:
66+
67+
```
68+
. ./scripts/activate.sh
69+
gn gen out/host
70+
ninja -C out/host chip-cert
71+
./out/host/chip-cert help
72+
```
73+
6074
## Operational Certificates Usage Examples
6175

6276
Example command that can be used to generate CHIP root certificate and private
@@ -745,6 +759,24 @@ HELP OPTIONS
745759
Print the version and then exit.
746760
```
747761

762+
#### gen-cd example
763+
764+
An example of generating a Certificate Declaration (CD) follows:
765+
766+
```
767+
./chip-cert gen-cd -C credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem -K credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem --out cd.bin -f 1 -V FFF1 -p 8000 -d 0016 -c "ZIG0000000000000000" -l 0 -i 0 -n 0001 -t 0
768+
```
769+
770+
The binary output of the CMS signed CD is written to `cd.bin`.
771+
772+
- Replace -V FFF1 with your VID in uppercase hex with zero padding
773+
- Replace -p 8000 with your PID in uppercase hex with zero padding
774+
- Replace -d 0016 with your primary device type in uppercase hex with zero
775+
padding
776+
777+
NOTE: `dac-origin-vendor-id` and `dac-origin-product-id` are not included in
778+
this example.
779+
748780
### version
749781

750782
Displays the version of the tool and copyright information.

0 commit comments

Comments
 (0)