![]() |
nRF Connect SDK API 3.4.99
|
| int nrf_cloud_credentials_pubkey_get | ( | uint32_t | sec_tag, |
| uint8_t * | out, | ||
| size_t | out_size, | ||
| size_t * | out_len ) |
#include <include/net/nrf_cloud_credentials_keygen.h>
Export the public key of the on-device key pair.
The private key is non-exportable; only the public key is returned. Host tooling can compare it against the public key in the installed device certificate to verify that the on-device key matches the certificate.
The public key is exported in SEC1 uncompressed point format (0x04 || X || Y), which is 65 bytes for an ECC P-256 key.
The
CONFIG_NRF_CLOUD_CREDENTIALS_KEYGEN_VERIFY
Kconfig must be enabled to make this API functional.
| sec_tag | The security tag whose key is exported. |
| out | Destination buffer for the public key. |
| out_size | Size of out in bytes. |
| out_len | On success, set to the number of bytes written to out. |
| 0 | If successful. |
| -ENOTSUP | If CONFIG_NRF_CLOUD_CREDENTIALS_KEYGEN_VERIFY is disabled. |