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

◆ modem_key_mgmt_write()

int modem_key_mgmt_write ( nrf_sec_tag_t  sec_tag,
enum modem_key_mgmt_cred_type  cred_type,
const void *  buf,
size_t  len 
)

#include <include/modem/modem_key_mgmt.h>

Write or update a credential in persistent storage.

Store the credential and associate it with the given security tag, which can later be used to access it.

Note
If used when the LTE link is active, the function will return an error and the key will not be written.
Parameters
[in]sec_tagSecurity tag to associate with this credential.
[in]cred_typeThe credential type.
[in]bufBuffer containing the credential data.
[in]lenLength of the buffer.
Return values
0On success.
-EINVALInvalid parameters.
-ENOMEMNot enough memory to store the credential.
-ENOENTThe security tag sec_tag is invalid.
-EACCESAccess to credential not allowed.
-EALREADYCredential already exists (and can't be overwritten).
-EPERMNot permitted when the LTE link is active.
-ECANCELEDCanceled because voltage is low (power off warning).