Virgil IoT KIT
tl_structs.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2020 Virgil Security, Inc.
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // (1) Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // (2) Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in
14 // the documentation and/or other materials provided with the
15 // distribution.
16 //
17 // (3) Neither the name of the copyright holder nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
22 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 // IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 // POSSIBILITY OF SUCH DAMAGE.
32 //
33 // Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
34 
39 #ifndef TL_STRUCTS_H
40 #define TL_STRUCTS_H
41 
42 #include <stdint.h>
43 #include <stdbool.h>
45 
46 #ifdef __cplusplus
47 namespace VirgilIoTKit {
48 extern "C" {
49 #endif
50 
52 typedef enum {
58 
59 typedef size_t vs_tl_key_handle;
60 
62 typedef struct __attribute__((__packed__)) {
63  uint32_t tl_size;
65  uint16_t pub_keys_count;
66  uint8_t signatures_count;
68 
70 typedef struct __attribute__((__packed__)) {
71  uint8_t tl_type;
72  uint8_t signatures[];
74 
75 typedef enum {
82 
83 typedef struct vs_tl_element_info_s {
85  int index;
86 } vs_tl_element_info_t;
87 
88 #ifdef __cplusplus
89 } // extern "C"
90 } // namespace VirgilIoTKit
91 #endif
92 
93 #endif // TL_STRUCTS_H
vs_tl_header_t::signatures_count
uint8_t signatures_count
Signatures amount.
Definition: tl_structs.h:66
vs_tl_key_handle
size_t vs_tl_key_handle
Definition: tl_structs.h:59
VS_TL_ELEMENT_TLH
@ VS_TL_ELEMENT_TLH
Definition: tl_structs.h:77
vs_file_version_t
File version information.
Definition: provision-structs.h:216
provision.h
Provision interface.
TL_STORAGE_TYPE_STATIC
@ TL_STORAGE_TYPE_STATIC
Default Trust List backup for restoring it in case of provision error.
Definition: tl_structs.h:53
vs_tl_element_e
vs_tl_element_e
Definition: tl_structs.h:75
vs_tl_storage_t
vs_tl_storage_t
Trust List storage types.
Definition: tl_structs.h:52
TL_STORAGE_TYPE_DYNAMIC
@ TL_STORAGE_TYPE_DYNAMIC
Trust List during the provision process.
Definition: tl_structs.h:54
vs_tl_element_info_s::id
vs_tl_element_e id
Definition: tl_structs.h:84
vs_tl_element_info_s::index
int index
Definition: tl_structs.h:85
TL_STORAGE_TYPE_TMP
@ TL_STORAGE_TYPE_TMP
Trust list that is loading.
Definition: tl_structs.h:55
vs_tl_header_t
Trust List header.
Definition: tl_structs.h:62
VS_TL_ELEMENT_TLC
@ VS_TL_ELEMENT_TLC
Definition: tl_structs.h:78
vs_tl_header_t::version
vs_file_version_t version
Version.
Definition: tl_structs.h:64
vs_tl_header_t::tl_size
uint32_t tl_size
Trust List size = header + public keys + footer.
Definition: tl_structs.h:63
VS_TL_ELEMENT_TLF
@ VS_TL_ELEMENT_TLF
Definition: tl_structs.h:79
VS_TL_ELEMENT_MIN
@ VS_TL_ELEMENT_MIN
Definition: tl_structs.h:76
vs_tl_header_t::pub_keys_count
uint16_t pub_keys_count
Public keys amount.
Definition: tl_structs.h:65
VS_TL_ELEMENT_MAX
@ VS_TL_ELEMENT_MAX
Definition: tl_structs.h:80
vs_tl_element_info_s
Definition: tl_structs.h:83