|
LMDB
1.0
|
Helpers for setting up encryption. More...
Data Structures | |
| struct | MDB_crypto_funcs |
| A structure for dynamically loaded crypto modules. More... | |
Typedefs | |
| typedef int( | MDB_str2key_func )(const char *passwd, MDB_val *key) |
| A function for converting a string into an encryption key. | |
| typedef MDB_crypto_funcs *( | MDB_crypto_hooks )(void) |
| The function that returns the MDB_crypto_funcs structure. | |
Functions | |
| void * | mdb_modload (const char *file, const char *symname, MDB_crypto_funcs **mcf_ptr, char **errmsg) |
| Load a dynamically loadable module. | |
| void | mdb_modunload (void *handle) |
| Unload a dynamically loaded module. | |
| void | mdb_modsetup (MDB_env *env, MDB_crypto_funcs *mcf_ptr, const char *passphrase) |
| Set an environment to use the given crypto functions. | |
Helpers for setting up encryption.
| struct MDB_crypto_funcs |
A structure for dynamically loaded crypto modules.
This is the information that the command line tools expect in order to operate on encrypted or checksummed environments.
Data Fields | |
| MDB_str2key_func * | mcf_str2key |
| MDB_enc_func * | mcf_encfunc |
| MDB_sum_func * | mcf_sumfunc |
| int | mcf_keysize |
| int | mcf_esumsize |
| int | mcf_sumsize |
| int MDB_crypto_funcs::mcf_keysize |
The size of an encryption key, in bytes
| int MDB_crypto_funcs::mcf_esumsize |
The size of the MAC, for authenticated encryption
| int MDB_crypto_funcs::mcf_sumsize |
The size of the checksum, for plain checksums
| typedef int( MDB_str2key_func)(const char *passwd, MDB_val *key) |
A function for converting a string into an encryption key.
| [in] | passwd | The string to be converted. |
| [in,out] | key | The resulting key. The caller must provide the space for the key. |
| typedef MDB_crypto_funcs*( MDB_crypto_hooks)(void) |
The function that returns the MDB_crypto_funcs structure.
The command line tools expect this function to be named "MDB_crypto". It must be exported by the dynamic module so that the tools can use it.
| void* mdb_modload | ( | const char * | file, |
| const char * | symname, | ||
| MDB_crypto_funcs ** | mcf_ptr, | ||
| char ** | errmsg | ||
| ) |
Load a dynamically loadable module.
| [in] | file | The pathname of the module to load. |
| [in] | symname | The name of a symbol to resolve in the module. |
| [out] | mcf_ptr | The crypto hooks returned from the module. |
| [out] | errmsg | Messages for any errors from trying to load the module. |
| void mdb_modunload | ( | void * | handle | ) |
Unload a dynamically loaded module.
All environments that used the functions in the module must be closed before unloading the module.
| [in] | handle | The handle returned by mdb_modload(). |
| void mdb_modsetup | ( | MDB_env * | env, |
| MDB_crypto_funcs * | mcf_ptr, | ||
| const char * | passphrase | ||
| ) |
Set an environment to use the given crypto functions.
This is just a wrapper around mdb_env_set_encrypt() to ease use of dynamically loaded crypto functions.
| [in] | env | An environment handle returned by mdb_env_create() |
| [in] | mcf_ptr | The crypto hooks retrieved by mdb_modload(). |
| [in] | passphrase | The secret used to generate the encryption key for the environment. |
1.8.2-20120930