Open wreyford opened 3 months ago
I haven't worked with the secure element on ESP32, but the functions referenced in this issue appear to be implemented by https://github.com/espressif/esp_secure_cert_mgr Perhaps check documentation there, first.
Otherwise, additional Espressif documentation for ESP-IDF 5.2 can be found here: https://docs.espressif.com/projects/esp-idf/en/v5.2.2/esp32s3/api-reference
@wreyford, were you able to try out @cookpate's suggestion?
Hi @wreyford , Did you successfully combine the two examples? I have the same problem now.
I have managed to provision a device using fleet provisioning
Amazon Web Services IoT MQTT (Fleet Provisioning With CSR) Example
I'm using ESP-IDF 5.2 ESP32S3-F16-R8I have for now stored the certificate and private key (obtained during fleet provisioning) in the nvs storage partition:
storage,data,nvs,,0x4000,,
The example disconnects, then reconnects, so all is fine.
Now I'm trying to implement MQTT for publish of data to the IoT Hub, using the
main/demo_tasks/temp_sub_pub_and_led_control_demo
the network context differs from the one used in fleet provisioning.
I wish to use the more refined approach used in the temp_sub_pub_and_led_control_demo for our MQTT telemetry (publish) framework.
To set up the NetworkContext, it uses:
The examples use the certificate and private key stored in esp_secure_cert_manager partition, (thus a different approach to storing in storage nvs partition as keypair values written by pcks11 module in the fleet provisioning example).:
esp_secure_cert, 0x3F, , 0xD000, 0x2000, encrypted
I need to retrieve the client certificate from the pcks11 module, also the private key using their respective labels, and then I need to populate xNetworkContext with them, as in this example:
How can I read the certificate into xNetworkContext.pcClientCert from the nvs partition using pkcs11 module? I'm trying to get this to work, so we can migrate our application to AWS. I'm building out the framework as I go.
As an alternative later see below.
(I have a ATECC608B TRUST CUSTOM chip on the same custom PCB. It is not utilized at this moment. I could possibly write the Private Key and Client key obtained during fleet provisioning to the trust custom chip at runtime, and then use it for the examples, but have no idea how to do that. )