wickr-crypto-c

storage.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 storage_h
23 #define storage_h
24
25 #include <stdlib.h>
26 #include "buffer.h"
27 #include "crypto_engine.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
48 struct wickr_storage_keys {
49 wickr_cipher_key_t *local;
50 wickr_cipher_key_t *remote;
51 };
52
53 typedef struct wickr_storage_keys wickr_storage_keys_t;
54
65 wickr_storage_keys_t *wickr_storage_keys_create(wickr_cipher_key_t *local, wickr_cipher_key_t *remote);
66
76 wickr_storage_keys_t *wickr_storage_keys_copy(const wickr_storage_keys_t *source);
77
87 wickr_storage_keys_t *wickr_storage_keys_create_from_buffer(const wickr_buffer_t *buffer);
88
99 wickr_buffer_t *wickr_storage_keys_serialize(const wickr_storage_keys_t *keys);
100
109 void wickr_storage_keys_destroy(wickr_storage_keys_t **keys);
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif /* storage_h */
wickr_storage_keys_serialize
wickr_buffer_t * wickr_storage_keys_serialize(const wickr_storage_keys_t *keys)
wickr_storage_keys_destroy
void wickr_storage_keys_destroy(wickr_storage_keys_t **keys)
wickr_storage_keys_create
wickr_storage_keys_t * wickr_storage_keys_create(wickr_cipher_key_t *local, wickr_cipher_key_t *remote)
wickr_storage_keys_copy
wickr_storage_keys_t * wickr_storage_keys_copy(const wickr_storage_keys_t *source)
wickr_storage_keys_create_from_buffer
wickr_storage_keys_t * wickr_storage_keys_create_from_buffer(const wickr_buffer_t *buffer)
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_storage_keys
Key's used for the client to encrypt data meant for itself, and not for other clients.
Definition: storage.h:48
wickr_storage_keys::remote
wickr_cipher_key_t * remote
Definition: storage.h:50
wickr_storage_keys::local
wickr_cipher_key_t * local
Definition: storage.h:49