nRF Connect SDK API 2.8.99
|
int modem_jwt_generate | ( | struct jwt_data *const | jwt | ) |
#include <include/modem/modem_jwt.h>
Generates a JWT using the supplied parameters. If successful, the JWT string will be stored in the supplied struct. This function will allocate memory for the JWT if the user does not provide a buffer. In that case, the user is responsible for freeing the memory by calling modem_jwt_free.
Subject and audience fields may be NULL in which case those fields are left out from generated JWT token.
If sec_tag value is given as zero, JWT is signed with the device's identity key that already exists in the modem.
[in,out] | jwt | Pointer to struct containing JWT parameters and result. |
0 | If the operation was successful. Otherwise, a (negative) error code is returned. |