Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
ext_encryption_utils.h File Reference

External interface for encryption. More...

#include <kaa/kaa_error.h>
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Functions

kaa_error_t kaa_init_session_key (void)
 Performs initialization of the AES session key. More...
 
void kaa_deinit_session_key (void)
 Performs deinitialization of the AES session key. More...
 
void ext_get_endpoint_session_key (const uint8_t **buffer, size_t *buffer_size)
 Returns endpoint session key. More...
 
kaa_error_t ext_encrypt_data (const uint8_t *input, size_t input_size, uint8_t *output)
 Perform encryption. More...
 
size_t ext_get_encrypted_data_size (size_t input_size)
 Calculates the size of the encrypted data. More...
 
kaa_error_t ext_decrypt_data (const uint8_t *input, size_t input_size, uint8_t *output, size_t *output_payload_size)
 Perform decryption. More...
 
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. More...
 
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. More...
 

Detailed Description

External interface for encryption.

Function Documentation

kaa_error_t ext_decrypt_data ( const uint8_t *  input,
size_t  input_size,
uint8_t *  output,
size_t *  output_payload_size 
)

Perform decryption.

Parameters
[in]inputThe pointer to data to be decrypted.
[in]input_sizeThe size of the input buffer.
[out]output_payload_sizeThe size of the payload data.
[out]outputThe buffer which contains decrypted data will be filled in.
Note
The output buffer is assumed to be at least as long as input_size.
kaa_error_t ext_encrypt_data ( const uint8_t *  input,
size_t  input_size,
uint8_t *  output 
)

Perform encryption.

Parameters
[in]inputThe pointer to data to be encrypted.
[in]input_sizeThe size of the input buffer.
[out]outputThe pointer which will be initialized with buffer containing enctypted data.
size_t ext_get_encrypted_data_size ( size_t  input_size)

Calculates the size of the encrypted data.

Parameters
[in]input_sizeThe size of the plaintext.
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.

Parameters
[out]bufferPointer to buffer which should be filled with encrypted session key.
[out]buffer_sizePointer to buffer's size.
[in]remote_keyRemote public key which will be used to encrypt session key.
[in]remote_key_sizeRemote public key's size.
void ext_get_endpoint_session_key ( const uint8_t **  buffer,
size_t *  buffer_size 
)

Returns endpoint session key.

Parameters
[out]bufferPointer to buffer which should be filled with session key.
[out]buffer_sizePointer to buffer size, which will be initialized with key size.
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.

Parameters
[in]inputThe input data to be signed.
[in]input_sizeThe size of the input data.
[out]outputThe pointer which will be initialized with signed key.
[out]output_sizeThe length of signed key.
void kaa_deinit_session_key ( void  )

Performs deinitialization of the AES session key.

kaa_error_t kaa_init_session_key ( void  )

Performs initialization of the AES session key.

This key is required in case encryption is enabled.