Virgil IoT KIT
provision.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 
97 #ifndef VS_IOT_PROVISION_H
98 #define VS_IOT_PROVISION_H
99 
104 
105 #ifdef __cplusplus
106 namespace VirgilIoTKit {
107 extern "C" {
108 #endif
109 
121 
129 vs_provision_deinit(void);
130 
141 
156  const uint8_t *key,
157  uint16_t key_sz);
158 
169 vs_provision_verify_hl_key(const uint8_t *key_to_check, uint16_t key_size);
170 
177 const char *
179 
197  vs_key_type_e key_type,
198  vs_pubkey_dated_t **pubkey_dated,
199  uint8_t **pubkey,
200  uint16_t *pubkey_sz,
201  uint8_t **meta,
202  uint16_t *meta_sz);
203 
221  vs_pubkey_dated_t **pubkey_dated,
222  uint8_t **pubkey,
223  uint16_t *pubkey_sz,
224  uint8_t **meta,
225  uint16_t *meta_sz);
226 
227 #ifdef __cplusplus
228 } // extern "C"
229 } // namespace VirgilIoTKit
230 #endif
231 
232 #endif // VS_IOT_PROVISION_H
vs_pubkey_dated_t
Public key with date information.
Definition: provision-structs.h:209
vs_provision_get_slot_num
vs_status_e vs_provision_get_slot_num(vs_provision_element_id_e id, uint16_t *slot)
Get slot number.
vs_secmodule_impl_t
Security Module implementation.
Definition: secmodule.h:458
vs_key_type_e
vs_key_type_e
Key type.
Definition: provision-structs.h:177
vs_provision_verify_hl_key
vs_status_e vs_provision_verify_hl_key(const uint8_t *key_to_check, uint16_t key_size)
Verify high level public key.
vs_status_e
vs_status_e
Status code.
Definition: status_code.h:77
provision-structs.h
Provision interface structures.
vs_provision_cloud_url
const char * vs_provision_cloud_url(void)
Get Thing service URL.
vs_provision_search_hl_pubkey
vs_status_e vs_provision_search_hl_pubkey(vs_key_type_e key_type, vs_secmodule_keypair_type_e ec_type, const uint8_t *key, uint16_t key_sz)
Search high level public key.
vs_provision_deinit
vs_status_e vs_provision_deinit(void)
Provision destruction.
status_code.h
Status codes and macroses.
vs_provision_tl_find_next_key
vs_status_e vs_provision_tl_find_next_key(vs_provision_tl_find_ctx_t *search_ctx, vs_pubkey_dated_t **pubkey_dated, uint8_t **pubkey, uint16_t *pubkey_sz, uint8_t **meta, uint16_t *meta_sz)
Find Next key.
vs_provision_tl_find_ctx_t
Find context.
Definition: provision-structs.h:236
vs_storage_op_ctx_t
Storage element context.
Definition: storage_hal.h:221
vs_provision_element_id_e
vs_provision_element_id_e
Element ID.
Definition: provision-structs.h:164
vs_secmodule_keypair_type_e
vs_secmodule_keypair_type_e
Keypair types.
Definition: secmodule.h:76
vs_provision_tl_find_first_key
vs_status_e vs_provision_tl_find_first_key(vs_provision_tl_find_ctx_t *search_ctx, vs_key_type_e key_type, vs_pubkey_dated_t **pubkey_dated, uint8_t **pubkey, uint16_t *pubkey_sz, uint8_t **meta, uint16_t *meta_sz)
Find first key.
storage_hal.h
Storage HAL interface.
vs_provision_events_t
Container of pointers to callback functions for Provision Events.
Definition: provision-structs.h:254
vs_provision_init
vs_status_e vs_provision_init(vs_storage_op_ctx_t *tl_storage_ctx, vs_secmodule_impl_t *secmodule, vs_provision_events_t events_cb)
Provision initialization.
secmodule.h
Security Module implementations signatures.