11 #ifndef CRYPT_SERVICE_H
12 #define CRYPT_SERVICE_H
19 #include "../utils/allocs.h"
20 #include "../utils/attributes.h"
21 #include "../utils/os.h"
22 #define MAIN_CRYPT_KEY_ID "main"
47 #define __must_free_crypt_service \
48 __attribute__((malloc(free_crypt_service, 1))) __must_check
50 #define __must_free_crypt_service __must_check
68 uint8_t *user_secret,
int user_secret_size);
File containing the definition of crypt configuration structure.
void free_crypt_service(struct crypt_context *ctx)
Frees the crypt context.
Definition: crypt_service.c:37
void free_crypt_pair(struct crypt_pair *pair)
Frees the crypt pair.
Definition: crypt_service.c:417
int put_crypt_pair(struct crypt_context *ctx, struct crypt_pair *pair)
Inserts a key/value pair into the crypt.
Definition: crypt_service.c:501
__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.
Definition: crypt_service.c:246
struct crypt_pair * get_crypt_pair(struct crypt_context *ctx, const char *key)
Retrieves a key/value pair from the crypt.
Definition: crypt_service.c:426
#define __must_free_crypt_service
Definition: crypt_service.h:50
crypt context structure definition
Definition: crypt_config.h:25
char key_id[MAX_KEY_ID_SIZE]
Definition: crypt_config.h:28
crypt context structure definition
Definition: crypt_service.h:28
uint8_t * value
Definition: crypt_service.h:30
const char * key
Definition: crypt_service.h:29
ssize_t value_size
Definition: crypt_service.h:31