Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ext_encryption_utils.h
Go to the documentation of this file.
1 /*
2  * You may obtain a copy of the License at
3  * Copyright 2014-2016 CyberVision, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
23 #ifndef EXT_ENCRYPTION_UTILS_H_
24 #define EXT_ENCRYPTION_UTILS_H_
25 
26 #include <kaa/kaa_error.h>
27 
28 #include <stdint.h>
29 #include <stddef.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
42 
47 void kaa_deinit_session_key(void);
48 
55 void ext_get_endpoint_session_key(const uint8_t **buffer, size_t *buffer_size);
56 
65 kaa_error_t ext_encrypt_data(const uint8_t *input, size_t input_size, uint8_t *output);
66 
73 size_t ext_get_encrypted_data_size(size_t input_size);
74 
86 kaa_error_t ext_decrypt_data(const uint8_t *input, size_t input_size,
87  uint8_t *output, size_t *output_payload_size);
88 
98 kaa_error_t ext_get_encrypted_session_key(uint8_t **buffer, size_t *buffer_size,
99  const uint8_t *remote_key, size_t remote_key_size);
100 
110 kaa_error_t ext_get_signature(const uint8_t *input, size_t input_size,
111  uint8_t **output, size_t *output_size);
112 
113 #ifdef __cplusplus
114 } /* extern "C" */
115 #endif
116 
117 #endif /* EXT_ENCRYPTION_UTILS_H_ */
void ext_get_endpoint_session_key(const uint8_t **buffer, size_t *buffer_size)
Returns endpoint session key.
size_t ext_get_encrypted_data_size(size_t input_size)
Calculates the size of the encrypted data.
kaa_error_t
Definition: kaa_error.h:31
Kaa error codes.
kaa_error_t ext_encrypt_data(const uint8_t *input, size_t input_size, uint8_t *output)
Perform encryption.
kaa_error_t ext_get_encrypted_session_key(uint8_t **buffer, size_t *buffer_size, const uint8_t *remote_key, size_t remote_key_size)
Returns encrypted endpoint session key.
kaa_error_t ext_get_signature(const uint8_t *input, size_t input_size, uint8_t **output, size_t *output_size)
Signs the encrypted session key.
void kaa_deinit_session_key(void)
Performs deinitialization of the AES session key.
kaa_error_t ext_decrypt_data(const uint8_t *input, size_t input_size, uint8_t *output, size_t *output_payload_size)
Perform decryption.
kaa_error_t kaa_init_session_key(void)
Performs initialization of the AES session key.