nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
modem_attest_token.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_ATTEST_TOKEN_H__
8#define MODEM_ATTEST_TOKEN_H__
9
10#include <zephyr/types.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
28 char *attest;
30 size_t attest_sz;
31
33 char *cose;
35 size_t cose_sz;
36};
37
45
52
53#define NRF_UUID_BYTE_SZ 16
54#define NRF_DEVICE_UUID_SZ NRF_UUID_BYTE_SZ
55#define NRF_MODEM_FW_UUID_SZ NRF_UUID_BYTE_SZ
56#define NRF_ATTEST_NONCE_SZ 16
57
58/* UUID v4 format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
59#define NRF_UUID_V4_STR_LEN ((NRF_UUID_BYTE_SZ * 2) + 4)
60#define NRF_DEVICE_UUID_STR_LEN NRF_UUID_V4_STR_LEN
61#define NRF_MODEM_FW_UUID_STR_LEN NRF_UUID_V4_STR_LEN
62
72
77
82
97
104
114int modem_attest_token_parse(struct nrf_attestation_token const *const token_in,
115 struct nrf_attestation_data *const data_out);
116
130 struct nrf_modem_fw_uuid *mfw);
131
134#ifdef __cplusplus
135}
136#endif
137
138#endif /* MODEM_ATTEST_TOKEN_H__ */
int modem_attest_token_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 ...
#define NRF_DEVICE_UUID_SZ
Definition modem_attest_token.h:54
#define NRF_MODEM_FW_UUID_SZ
Definition modem_attest_token.h:55
int modem_attest_token_parse(struct nrf_attestation_token const *const token_in, struct nrf_attestation_data *const data_out)
Parses attestation token.
nrf_id_srvc_msg_type
Definition modem_attest_token.h:38
@ NRF_ID_SRVC_MSG_TYPE_PUB_KEY_V2
Definition modem_attest_token.h:42
@ NRF_ID_SRVC_MSG_TYPE_ID_V1
Definition modem_attest_token.h:40
@ NRF_ID_SRVC_MSG_TYPE_PROV_RESP_V1
Definition modem_attest_token.h:41
@ NRF_ID_SRVC_MSG_TYPE_CSR_V2
Definition modem_attest_token.h:43
@ NRF_ID_SRVC_MSG_TYPE_INVALID
Definition modem_attest_token.h:39
void modem_attest_token_free(struct nrf_attestation_token *const token)
Frees the memory allocated by modem_attest_token_get.
#define NRF_DEVICE_UUID_STR_LEN
Definition modem_attest_token.h:60
nrf_device_type
Definition modem_attest_token.h:46
@ NRF_DEVICE_TYPE_INVALID
Definition modem_attest_token.h:47
@ NRF_DEVICE_TYPE_9160_SIBA
Definition modem_attest_token.h:49
@ NRF_DEVICE_TYPE_9160_SIAA
Definition modem_attest_token.h:48
@ NRF_DEVICE_TYPE_9160_SICA
Definition modem_attest_token.h:50
#define NRF_MODEM_FW_UUID_STR_LEN
Definition modem_attest_token.h:61
int modem_attest_token_get(struct nrf_attestation_token *const token)
Gets the device attestation token from the modem. If successful, the base64url attestation string and...
#define NRF_ATTEST_NONCE_SZ
Definition modem_attest_token.h:56
enum nrf_id_srvc_msg_type msg_type
Definition modem_attest_token.h:65
enum nrf_device_type dev_type
Definition modem_attest_token.h:66
char nonce[16]
Definition modem_attest_token.h:70
char fw_uuid[16]
Definition modem_attest_token.h:69
char device_uuid[16]
Definition modem_attest_token.h:68
Parsed attestation token data.
Definition modem_attest_token.h:64
char * attest
Definition modem_attest_token.h:28
size_t attest_sz
Definition modem_attest_token.h:30
size_t cose_sz
Definition modem_attest_token.h:35
char * cose
Definition modem_attest_token.h:33
Base64url attestation and COSE strings.
Definition modem_attest_token.h:26
char str[((16 *2)+4)+1]
Definition modem_attest_token.h:75
Device UUID string (UUID v4 format)
Definition modem_attest_token.h:74
char str[((16 *2)+4)+1]
Definition modem_attest_token.h:80
Modem firmware UUID string (UUID v4 format)
Definition modem_attest_token.h:79