![]() |
nRF Connect SDK API 3.4.99
|
| int nrf_cloud_credentials_key_generate | ( | uint32_t | sec_tag | ) |
#include <include/net/nrf_cloud_credentials_keygen.h>
Generate the device private key on-device for the given sec tag.
Creates a persistent, non-exportable ECC P-256 key pair in PSA secure key storage and registers it with the TLS credentials module as an opaque key (TLS_CREDENTIAL_PRIVATE_KEY_PSA). The private key never leaves the device.
| sec_tag | The security tag the key is associated with. |
| 0 | If successful. |
| -EALREADY | If a key already exists for the sec tag. Delete it first. |
| -ENOTSUP | If a key is already registered for a different sec tag. Only one on-device key sec tag is supported at a time. |