MongoDB C++ Driver
mongocxx-3.7.0
|
Class supporting operations for MongoDB Client-Side Field Level Encryption. More...
#include <client_encryption.hpp>
Public Member Functions | |
client_encryption (options::client_encryption opts) | |
Creates a client_encryption object. More... | |
~client_encryption () noexcept | |
Destroys a client_encryption. | |
client_encryption (client_encryption &&) | |
Move-constructs a client_encryption object. | |
client_encryption & | operator= (client_encryption &&) |
Move-assigns a client_encryption object. | |
bsoncxx::types::bson_value::value | create_data_key (std::string kms_provider, const options::data_key &opts={}) |
Creates a new key document and inserts into the key vault collection. More... | |
bsoncxx::types::bson_value::value | encrypt (bsoncxx::types::bson_value::view value, const options::encrypt &opts) |
Encrypts a BSON value with a given key and algorithm. More... | |
bsoncxx::types::bson_value::value | decrypt (bsoncxx::types::bson_value::view value) |
Decrypts an encrypted value (BSON binary of subtype 6). More... | |
Class supporting operations for MongoDB Client-Side Field Level Encryption.
mongocxx::client_encryption::client_encryption | ( | options::client_encryption | opts | ) |
Creates a client_encryption object.
opts | An object representing encryption options. |
bsoncxx::types::bson_value::value mongocxx::client_encryption::create_data_key | ( | std::string | kms_provider, |
const options::data_key & | opts = {} |
||
) |
Creates a new key document and inserts into the key vault collection.
kms_provider | A string identifying the KMS service to use to encrypt the datakey. Must be one of "aws", "azure", "gcp", "kmip", or "local". |
opts | Optional arguments, see options::data_key. |
mongocxx::exception | if there is an error creating the key. |
bsoncxx::types::bson_value::value mongocxx::client_encryption::decrypt | ( | bsoncxx::types::bson_value::view | value | ) |
Decrypts an encrypted value (BSON binary of subtype 6).
value | The encrypted value. |
mongocxx::exception | if there is an error decrypting the value. |
bsoncxx::types::bson_value::value mongocxx::client_encryption::encrypt | ( | bsoncxx::types::bson_value::view | value, |
const options::encrypt & | opts | ||
) |
Encrypts a BSON value with a given key and algorithm.
value | The BSON value to encrypt. |
opts | Options must be given in order to specify an encryption algorithm and a key_id or key_alt_name. See options::encrypt. |
mongocxx::exception | if there is an error encrypting the value. |