Hi,
We are using NCS v3.0.2 on nRF5340+nRF7002.
We have an error when doing matter commissioning using our own generated CD, PAA, PAI, DAC and factory data, see error below:
>>pairing ble-wifi 1 myssid mypassword 12345678 3840 --paa-trust-store-path /var/paa-root-certs/
...
...
[1773905166.510] [9714:9716] [-] Unable to find PAA, err: src/credentials/attestation_verifier/DeviceAttestationVerifier.h:252: CHIP Error 0x0000004A: CA certificate not found, PAI's AKID: 60:98:39:11:8F:E4:03:6E:D3:BD:78:46:F3:0C:9B:D6:A9:1E:36:27
[1773905166.510] [9714:9716] [CTL] Error on commissioning step 'AttestationVerification': 'src/controller/CHIPDeviceController.cpp:1334: CHIP Error 0x00000020: Failed Device Attestation'
What we have done:
Generate Certification Declaration CD:
chip-cert gen-cd \
--key credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem \
--cert credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem \
--out CD.der \
--format-version 1 \
--vendor-id 0x<OURVID> \
--product-id 0x<OURPID> \
--device-type-id 0xA \
--certificate-id ZIG20142ZB330003-24 \
--security-level 0 \
--security-info 0 \
--certification-type 1 \
--version-number 0x2694
convert CD to bytes:
cat CD.der | xxd -i
CD bytes to file chip_project_config.h
We also generate PAA, PAI, DAC using the commands:
chip-cert gen-att-cert \
--type a \
--subject-cn "ourCompany PAA CN" \
--subject-vid 0x<OURVID> \
--valid-from "2025-06-28 14:23:43" \
--lifetime 7305 \
--out-key Chip-PAA-Key.pem \
--out Chip-PAA-Cert.pem
chip-cert gen-att-cert \
--type i \
--subject-cn "ourCompany PAI CN" \
--subject-vid 0x<OURVID> \
--valid-from "2025-06-28 14:23:43" \
--lifetime 7305 \
--ca-key Chip-PAA-Key.pem \
--ca-cert Chip-PAA-Cert.pem \
--out-key Chip-PAI-Key.pem \
--out Chip-PAI-Cert.pem
chip-cert gen-att-cert \
--type d \
--subject-cn "ourCompany DAC 01" \
--subject-vid 0x<OURVID> \
--subject-pid 0x1 \
--valid-from "2025-06-28 14:23:43" \
--lifetime 7305 \
--ca-key Chip-PAI-Key.pem \
--ca-cert Chip-PAI-Cert.pem \
--out-key Chip-DAC-Key.pem \
--out Chip-DAC-Cert.pem
chip-cert validate-att-cert --dac Chip-DAC-Cert.pem --pai Chip-PAI-Cert.pem --paa Chip-PAA-Cert.pem
openssl x509 -in Chip-PAI-Cert.pem -outform DER -out Chip-PAI-Cert.der
openssl x509 -in Chip-DAC-Cert.pem -outform DER -out Chip-DAC-Cert.der
openssl ec -in Chip-DAC-Key.pem -outform DER -out Chip-DAC-Key.der
Then we generate the factory data:
python scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py \
...
...
--dac_cert "Chip-DAC-Cert.der" \
--dac_key "Chip-DAC-Key.der" \
--pai_cert "Chip-PAI-Cert.der" \
....
....
--enable_key 00112233445566778899AABBCCDDEEFF \
--include_passcode \
--overwrite --generate_onboarding
Then we write this factory data to factory_data partition using nrfutil
Questions:
1. in matter commisioing command, we appended the flag --paa-trust-store-path /var/paa-root-certs/ and we copied the PAA certificate to /var/paa-root-certs but from the error logs " Unable to find PAA," and "CA certificate not found", what might be the reason why is this?
note: when using --bypass-attestation-verifier true, the matter commissioning is successful
2. Is the way we write the CD to chip_project_config.h correct? and also how is CD being used in the application? there is not much documentaion related to this and the examples such as matter_weather_station
Thanks.
Regards,