nRF Connect SDK API 2.8.0
Loading...
Searching...
No Matches
modem_jwt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef MODEM_JWT_H__
8#define MODEM_JWT_H__
9
10#include <zephyr/types.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
31
36
38struct jwt_data {
40 unsigned int sec_tag;
45
50 uint32_t exp_delta_s;
51
53 const char *subject;
55 const char *audience;
56
62 char *jwt_buf;
64 size_t jwt_sz;
65};
66
85int modem_jwt_generate(struct jwt_data *const jwt);
86
106 struct nrf_modem_fw_uuid *mfw);
107
113void modem_jwt_free(char *const jwt_buf);
114
117#ifdef __cplusplus
118}
119#endif
120
121#endif /* MODEM_JWT_H__ */
int modem_jwt_get_uuids(struct nrf_device_uuid *dev, struct nrf_modem_fw_uuid *mfw)
Gets the device and/or modem firmware UUID from the modem and returns it as a NULL terminated string ...
int modem_jwt_generate(struct jwt_data *const jwt)
Generates a JWT using the supplied parameters. If successful, the JWT string will be stored in the su...
jwt_key_type
The type of key to be used for signing the JWT.
Definition modem_jwt.h:27
@ JWT_KEY_TYPE_ENDORSEMENT
Definition modem_jwt.h:29
@ JWT_KEY_TYPE_CLIENT_PRIV
Definition modem_jwt.h:28
jwt_alg_type
JWT signing algorithm.
Definition modem_jwt.h:33
@ JWT_ALG_TYPE_ES256
Definition modem_jwt.h:34
void modem_jwt_free(char *const jwt_buf)
Frees the JWT buffer allocated by modem_jwt_generate.
Modem attestation token and parsing.
size_t jwt_sz
Definition modem_jwt.h:64
char * jwt_buf
Definition modem_jwt.h:62
uint32_t exp_delta_s
Definition modem_jwt.h:50
const char * subject
Definition modem_jwt.h:53
const char * audience
Definition modem_jwt.h:55
unsigned int sec_tag
Definition modem_jwt.h:40
enum jwt_alg_type alg
Definition modem_jwt.h:44
enum jwt_key_type key
Definition modem_jwt.h:42
JWT parameters required for JWT generation and pointer to generated JWT.
Definition modem_jwt.h:38
Device UUID string (UUID v4 format)
Definition modem_attest_token.h:74
Modem firmware UUID string (UUID v4 format)
Definition modem_attest_token.h:79