Skip to content

Commit 1a395b9

Browse files
feat: Add onboarding documentation for nRF91x1 self-signed certificate generation
1 parent dcaeba6 commit 1a395b9

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

ADVANCED.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ These Python scripts are designed to assist users in provisioning devices with t
99
- [Device Credentials Installer](#device-credentials-installer)
1010
- [nRF Cloud Device Onboarding](#nrf-cloud-device-onboarding)
1111
- [nRF93M1 Device Onboarding](#nrf93m1-device-onboarding)
12+
- [nRF91x1 Self-Signed Certificate Onboarding](#nrf91x1-self-signed-certificate-onboarding)
1213
- [Modem Credentials Parser](#modem-credentials-parser)
1314
- [Create Device Credentials](#create-device-credentials)
1415
- [Claim and Provision Device](#claim-and-provision-device)
@@ -101,6 +102,49 @@ Your nRF Cloud REST API key is required and can be found on your [User Account p
101102
nrf93_onboard --port /dev/ttyACM0 --api-key $API_KEY
102103
```
103104

105+
## nRF91x1 Self-Signed Certificate Onboarding
106+
107+
The `nrf91_gather_self_signed_certs` script generates a self-signed device certificate directly on an nRF91x1 device and produces an onboarding CSV row that nRF Cloud can use to register the device. Compared to the [Device Credentials Installer](#device-credentials-installer) flow, this approach does not require a local CA certificate or private key, and the device private key never leaves the modem.
108+
109+
The script:
110+
111+
1. Connects to the device over serial (or RTT) and verifies that the modem firmware is supported.
112+
2. Reads the device UUID via `AT%DEVICEUUID`.
113+
3. Switches the modem to offline mode (`AT+CFUN=4`).
114+
4. Optionally clears the target security tag.
115+
5. Runs `AT%KEYGEN=<sectag>,14,2` to generate a self-signed certificate and its attestation.
116+
6. Returns the modem to online mode (`AT+CFUN=1`).
117+
7. Prints `<deviceId>,<attestation>` to stdout and, if `--csv` is provided, appends the same pair to an onboarding CSV with headers `deviceId,selfSignedCertificateAttestation`.
118+
119+
The resulting CSV is intended for upload to the Memfault side of nRF Cloud through the web frontend. **Note**: the frontend upload flow for self-signed certificate attestations is not yet released, so the CSV cannot be onboarded today. It is **not** compatible with the [`nrf_cloud_onboard`](#nrf-cloud-device-onboarding) script.
120+
121+
### Limitations
122+
123+
- Only supported on **nRF91x1** devices (nRF9151 / nRF9161). nRF9160 is not supported.
124+
- Requires modem firmware **>= 2.0.2**.
125+
- The device must be configured to use its **internal UUID** as the nRF Cloud client ID (`CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y`). The script emits the UUID read from `AT%DEVICEUUID` as the `deviceId`; if the device connects to nRF Cloud under a different ID (for example, `nrf-<IMEI>`), the onboarded entry will not match the device and the connection will be refused.
126+
- Requires AT command support (AT Host or AT Shell). The TLS Credentials Shell mode (`--cmd-type tls_cred_shell`) is not supported, since the flow issues raw AT commands.
127+
- If the security tag is already populated, generation fails — re-run with `-c`/`--clear-sectag` to delete the existing credentials first.
128+
129+
### Examples
130+
131+
#### Gather a single device, print to stdout
132+
```
133+
nrf91_gather_self_signed_certs --port /dev/ttyACM0
134+
```
135+
136+
#### Append the result to an onboarding CSV
137+
```
138+
nrf91_gather_self_signed_certs --port /dev/ttyACM0 --csv onboard.csv
139+
```
140+
141+
Run the command again for each device to accumulate rows. Use `-o`/`--overwrite` to start a new file instead of appending, or `--keep` to preserve existing rows when a device ID is already present.
142+
143+
#### Use a non-default security tag and clear it first
144+
```
145+
nrf91_gather_self_signed_certs --port /dev/ttyACM0 --sectag 12345 -c
146+
```
147+
104148
## Modem Credentials Parser
105149

106150
The script above, `device_credentials_installer` makes use of this script, `modem_credentials_parser`, so if you use the former, you do not need to also follow the directions below. If `device_credentials_installer` does not meet your needs, you can use `modem_credentials_parser` directly to take advantage of additional options.

0 commit comments

Comments
 (0)