|
Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
JSON Web Token (JWT) More...
Data Structures | |
| struct | jwt_builder |
| JWT data tracking. More... | |
Functions | |
| int | jwt_init_builder (struct jwt_builder *builder, char *buffer, size_t buffer_size) |
| Initialize the JWT builder. | |
| int | jwt_add_payload (struct jwt_builder *builder, int32_t exp, int32_t iat, const char *aud) |
| add JWT primary payload. | |
| int | jwt_sign (struct jwt_builder *builder, const char *der_key, size_t der_key_len) |
| Sign the JWT token. | |
| static size_t | jwt_payload_len (struct jwt_builder *builder) |
JSON Web Token (JWT)
| int jwt_add_payload | ( | struct jwt_builder * | builder, |
| int32_t | exp, | ||
| int32_t | iat, | ||
| const char * | aud | ||
| ) |
#include <include/zephyr/data/jwt.h>
add JWT primary payload.
| int jwt_init_builder | ( | struct jwt_builder * | builder, |
| char * | buffer, | ||
| size_t | buffer_size | ||
| ) |
#include <include/zephyr/data/jwt.h>
Initialize the JWT builder.
Initialize the given JWT builder for the creation of a fresh token. The buffer size should at least be as long as JWT_BUILDER_MAX_SIZE returns.
| builder | The builder to initialize. |
| buffer | The buffer to write the token to. |
| buffer_size | The size of this buffer. The token will be NULL terminated, which needs to be allowed for in this size. |
| 0 | Success |
| -ENOSPC | Buffer is insufficient to initialize |
|
inlinestatic |
#include <include/zephyr/data/jwt.h>
| int jwt_sign | ( | struct jwt_builder * | builder, |
| const char * | der_key, | ||
| size_t | der_key_len | ||
| ) |
#include <include/zephyr/data/jwt.h>
Sign the JWT token.