EDGESEC
0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
|
File containing the definition of crypt service configuration utilities. More...
#include <sqlite3.h>
#include <utarray.h>
#include "crypt_config.h"
#include "../utils/allocs.h"
#include "../utils/attributes.h"
#include "../utils/os.h"
Go to the source code of this file.
Data Structures | |
struct | crypt_pair |
crypt context structure definition More... | |
Macros | |
#define | MAIN_CRYPT_KEY_ID "main" |
#define | __must_free_crypt_service __must_check |
Functions | |
void | free_crypt_service (struct crypt_context *ctx) |
Frees the crypt context. More... | |
__must_free_crypt_service struct crypt_context * | load_crypt_service (const char *crypt_db_path, const char *key_id, uint8_t *user_secret, int user_secret_size) |
Load the crypt service. More... | |
struct crypt_pair * | get_crypt_pair (struct crypt_context *ctx, const char *key) |
Retrieves a key/value pair from the crypt. More... | |
int | put_crypt_pair (struct crypt_context *ctx, struct crypt_pair *pair) |
Inserts a key/value pair into the crypt. More... | |
void | free_crypt_pair (struct crypt_pair *pair) |
Frees the crypt pair. More... | |
File containing the definition of crypt service configuration utilities.
#define __must_free_crypt_service __must_check |
#define MAIN_CRYPT_KEY_ID "main" |
void free_crypt_pair | ( | struct crypt_pair * | pair | ) |
Frees the crypt pair.
pair | The crypt pair |
void free_crypt_service | ( | struct crypt_context * | ctx | ) |
Frees the crypt context.
ctx | The crypt context |
struct crypt_pair* get_crypt_pair | ( | struct crypt_context * | ctx, |
const char * | key | ||
) |
Retrieves a key/value pair from the crypt.
ctx | The crypt context |
key | The key string |
__must_free_crypt_service struct crypt_context* load_crypt_service | ( | const char * | crypt_db_path, |
const char * | key_id, | ||
uint8_t * | user_secret, | ||
int | user_secret_size | ||
) |
Load the crypt service.
crypt_db_path | The crypt db path | |
key_id | The crypt secrets key id | |
[in,out] | user_secret | The user secret. If creating a new key, the user secret will be loaded from this variable. If loading an existing key, the existing key will be writen to the buffer. |
user_secret_size | The user secret size, if zero use the hardware secure element |
free_crypt_service()
to deallocate. int put_crypt_pair | ( | struct crypt_context * | ctx, |
struct crypt_pair * | pair | ||
) |
Inserts a key/value pair into the crypt.
ctx | The crypt context |
pair | The key/value pair |