|
Couchbase C Client
3.3.19
Asynchronous C Client for Couchbase
|
Register crypto-providers and working with encrypted fields of the documents.
These routines contain functionality to define and hook crypto providers, as well as functions which should be used for portable (cross SDK) encoding of encrypted fields.
| void lcbcrypto_register | ( | lcb_INSTANCE * | instance, |
| const char * | name, | ||
| lcbcrypto_PROVIDER * | provider ) |
Register crypto-provider for specified alias.
See full example in example/crypto/openssl_symmetric_provider.c
| instance | the handle |
| name | provider alias, this will be recorded in JSON. |
| provider | implementation of the crypto-provider |
| void lcbcrypto_unregister | ( | lcb_INSTANCE * | instance, |
| const char * | name ) |
Unregister crypto-provider for specified alias.
See full example in example/crypto/openssl_symmetric_provider.c
| instance | the handle |
| name | provider alias. |
| void lcbcrypto_ref | ( | lcbcrypto_PROVIDER * | provider | ) |
Increment reference counter for crypto-provider.
| provider | provider instance |
| void lcbcrypto_unref | ( | lcbcrypto_PROVIDER * | provider | ) |
Decrement reference counter for crypto-provider.
It calls destructor once counter reaches zero. The provider instance should not be used after calling this function.
| provider | provider instance |
| lcb_STATUS lcbcrypto_encrypt_fields | ( | lcb_INSTANCE * | instance, |
| lcbcrypto_CMDENCRYPT * | cmd ) |
Encrypt all specified fields in the JSON encoded object.
The function will remove original content of the field, and rename it using LCBCRYPTO_DEFAULT_FIELD_PREFIX, or custom prefix, specified in the command.
See full example in example/crypto/openssl_symmetric_encrypt.c
| instance | the handle |
| cmd | the command structure |
| lcb_STATUS lcbcrypto_decrypt_fields | ( | lcb_INSTANCE * | instance, |
| lcbcrypto_CMDDECRYPT * | cmd ) |
Decrypt all specified fields in the JSON encoded object.
The function will remove original content of the field, and rename it using LCBCRYPTO_DEFAULT_FIELD_PREFIX, or custom prefix, specified in the command.
See full example in example/crypto/openssl_symmetric_decrypt.c
| instance | the handle |
| cmd | the command structure |
| struct lcbcrypto_SIGV |
| struct lcbcrypto_PROVIDER |
| struct lcbcrypto_FIELDSPEC |
| struct lcbcrypto_CMDENCRYPT |
| struct lcbcrypto_CMDDECRYPT |