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

◆ app_jwt_generate()

int app_jwt_generate ( struct app_jwt_data *const jwt)

#include <include/app_jwt.h>

Generate a JWT using the supplied parameters. If successful, the JWT string will be stored in the supplied struct. You are responsible for providing a valid pointer to store the JWT.

Subject, audience, token ID and issuer fields may be NULL in which case those fields are left out from generated JWT token.

All fields will be truncated to 64 characters, you should always provide null terminated strings.

The API does not verify the time source validity, it is up to the caller to make sure that the system has access to a valid time source, otherwise "iat" field will contain an arbitrary timestamp.

Parameters
[in,out]jwtPointer to struct containing JWT parameters and result.
Return values
0If the operation was successful.
-errnoNegative errno for other failures.