cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
db_sync.h
Go to the documentation of this file.
1
19#ifndef __CWIST_DB_SYNC_H__
20#define __CWIST_DB_SYNC_H__
21
23#include <sqlite3.h>
24#include <stddef.h>
25
26#define CWIST_DB_SYNC_DEFAULT_PORT 9877
27
29#define CWIST_DB_SYNC_OK 0
30#define CWIST_DB_SYNC_ERR_ARGS (-1)
31#define CWIST_DB_SYNC_ERR_NET (-2)
32#define CWIST_DB_SYNC_ERR_CRYPTO (-3)
33#define CWIST_DB_SYNC_ERR_MEM (-4)
34#define CWIST_DB_SYNC_ERR_PROTO (-5)
35
50int cwist_db_sync_serve(sqlite3 *db, const cwist_db_crypt_ctx_t *ctx, int port);
51
66int cwist_db_sync_pull(const char *host, int port, const cwist_db_crypt_ctx_t *ctx,
67 unsigned char **out_bytes, size_t *out_len);
68
69#endif /* __CWIST_DB_SYNC_H__ */
Two-level key hierarchy for encrypting an SQLite database blob.
int cwist_db_sync_pull(const char *host, int port, const cwist_db_crypt_ctx_t *ctx, unsigned char **out_bytes, size_t *out_len)
Pull a database from a sync server.
Definition db_sync.c:163
int cwist_db_sync_serve(sqlite3 *db, const cwist_db_crypt_ctx_t *ctx, int port)
Serve the database once: accept one connection, send the sealed blob, then close.
Definition db_sync.c:69
Caller-managed key pair.
Definition db_crypt.h:53