wickr-crypto-c

root_keys.h
1 /*
2 * Copyright © 2012-2020 Wickr Inc. All rights reserved.
3 *
4 * This code is being released for EDUCATIONAL, ACADEMIC, AND CODE REVIEW PURPOSES
5 * ONLY. COMMERCIAL USE OF THE CODE IS EXPRESSLY PROHIBITED. For additional details,
6 * please see LICENSE
7 *
8 * THE CODE IS MADE AVAILABLE "AS-IS" AND WITHOUT ANY EXPRESS OR
9 * IMPLIED GUARANTEES AS TO FITNESS, MERCHANTABILITY, NON-
10 * INFRINGEMENT OR OTHERWISE. IT IS NOT BEING PROVIDED IN TRADE BUT ON
11 * A VOLUNTARY BASIS ON BEHALF OF THE AUTHOR’S PART FOR THE BENEFIT
12 * OF THE LICENSEE AND IS NOT MADE AVAILABLE FOR CONSUMER USE OR ANY
13 * OTHER USE OUTSIDE THE TERMS OF THIS LICENSE. ANYONE ACCESSING THE
14 * CODE SHOULD HAVE THE REQUISITE EXPERTISE TO SECURE THEIR SYSTEM
15 * AND DEVICES AND TO ACCESS AND USE THE CODE FOR REVIEW PURPOSES
16 * ONLY. LICENSEE BEARS THE RISK OF ACCESSING AND USING THE CODE. IN
17 * PARTICULAR, AUTHOR BEARS NO LIABILITY FOR ANY INTERFERENCE WITH OR
18 * ADVERSE EFFECT THAT MAY OCCUR AS A RESULT OF THE LICENSEE
19 * ACCESSING AND/OR USING THE CODE ON LICENSEE’S SYSTEM.
20 */
21
22 #ifndef wickr_root_keys_h
23 #define wickr_root_keys_h
24
25 #include <stdlib.h>
26 #include "buffer.h"
27 #include "eckey.h"
28 #include "crypto_engine.h"
29 #include "storage.h"
30 #include "devinfo.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
50 struct wickr_root_keys {
51 wickr_ec_key_t *node_signature_root;
52 wickr_cipher_key_t *node_storage_root;
53 wickr_cipher_key_t *remote_storage_root;
54 };
55
56 typedef struct wickr_root_keys wickr_root_keys_t;
57
68 wickr_root_keys_t *wickr_root_keys_create(wickr_ec_key_t *node_signature_root, wickr_cipher_key_t *node_storage_root,
69 wickr_cipher_key_t *remote_storage_root);
70
79 wickr_root_keys_t *wickr_root_keys_generate(const wickr_crypto_engine_t *engine);
80
90 wickr_root_keys_t *wickr_root_keys_create_from_buffer(const wickr_crypto_engine_t *engine, const wickr_buffer_t *buffer);
91
100 wickr_buffer_t *wickr_root_keys_serialize(const wickr_root_keys_t *keys);
101
111 wickr_cipher_result_t *wickr_root_keys_export(const wickr_root_keys_t *keys, const wickr_crypto_engine_t *engine, const wickr_cipher_key_t *export_key);
112
125 wickr_storage_keys_t *wickr_root_keys_localize(const wickr_root_keys_t *keys, const wickr_crypto_engine_t *engine, const wickr_dev_info_t *dev_info);
126
136 wickr_root_keys_t *wickr_root_keys_copy(const wickr_root_keys_t *source);
137
145 void wickr_root_keys_destroy(wickr_root_keys_t **keys);
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif /* wickr_root_keys_h */
wickr_root_keys_create_from_buffer
wickr_root_keys_t * wickr_root_keys_create_from_buffer(const wickr_crypto_engine_t *engine, const wickr_buffer_t *buffer)
wickr_root_keys_serialize
wickr_buffer_t * wickr_root_keys_serialize(const wickr_root_keys_t *keys)
wickr_root_keys_export
wickr_cipher_result_t * wickr_root_keys_export(const wickr_root_keys_t *keys, const wickr_crypto_engine_t *engine, const wickr_cipher_key_t *export_key)
wickr_root_keys_localize
wickr_storage_keys_t * wickr_root_keys_localize(const wickr_root_keys_t *keys, const wickr_crypto_engine_t *engine, const wickr_dev_info_t *dev_info)
wickr_root_keys_create
wickr_root_keys_t * wickr_root_keys_create(wickr_ec_key_t *node_signature_root, wickr_cipher_key_t *node_storage_root, wickr_cipher_key_t *remote_storage_root)
wickr_root_keys_generate
wickr_root_keys_t * wickr_root_keys_generate(const wickr_crypto_engine_t *engine)
wickr_root_keys_destroy
void wickr_root_keys_destroy(wickr_root_keys_t **keys)
wickr_root_keys_copy
wickr_root_keys_t * wickr_root_keys_copy(const wickr_root_keys_t *source)
wickr_buffer
Represents an array of bytes and the length of the allocation associated with those bytes.
Definition: buffer.h:51
wickr_cipher_key
Definition: cipher.h:189
wickr_cipher_result
Definition: cipher.h:97
wickr_crypto_engine
Interface to a set of cryptographic operations used throughout the library. Currently the default imp...
Definition: crypto_engine.h:53
wickr_dev_info
Device Information used to make a uniquely identifying set of data for each context running the Wickr...
Definition: devinfo.h:58
wickr_ec_key
Representation of public and private Elliptic Curve Keypair information as buffers.
Definition: eckey.h:92
wickr_root_keys
Root level crypto keys for signatures, local encryption, and remote encryption.
Definition: root_keys.h:50
wickr_root_keys::remote_storage_root
wickr_cipher_key_t * remote_storage_root
Definition: root_keys.h:53
wickr_root_keys::node_storage_root
wickr_cipher_key_t * node_storage_root
Definition: root_keys.h:52
wickr_root_keys::node_signature_root
wickr_ec_key_t * node_signature_root
Definition: root_keys.h:51
wickr_storage_keys
Key's used for the client to encrypt data meant for itself, and not for other clients.
Definition: storage.h:48