#include <include/net/nrf_cloud.h>
Generate a JWT to be used with nRF Cloud's REST API. This library's configured values for client id and sec tag (NRF_CLOUD_SEC_TAG) will be used for generating the JWT.
- Parameters
-
| [in] | time_valid_s | How long (seconds) the JWT will be valid. Maximum duration specified by NRF_CLOUD_JWT_VALID_TIME_S_MAX. If zero, NRF_CLOUD_JWT_VALID_TIME_S_DEF will be used. |
| [in,out] | jwt_buf | Buffer to hold the JWT. |
| [in] | jwt_buf_sz | Size of the buffer (recommended size >= 600 bytes). |
- Return values
-
| 0 | JWT generated successfully. |
| -ETIME | Modem does not have valid date/time, JWT not generated. |
- Returns
- A negative value indicates an error.