nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches

◆ nrf_cloud_credentials_pubkey_get()

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.

Parameters
sec_tagThe security tag whose key is exported.
outDestination buffer for the public key.
out_sizeSize of out in bytes.
out_lenOn success, set to the number of bytes written to out.
Return values
0If successful.
-ENOTSUPIf CONFIG_NRF_CLOUD_CREDENTIALS_KEYGEN_VERIFY is disabled.
Returns
A negative value indicates an error.