#include <mongocxx/v1/client_encryption.hpp>
Support for MongoDB In-Use Encryption.
Provides interfaces to support both Queryable Encryption and Client-Side Field Level Encryption (CSFLE).
Classes | |
| class | options |
| Options for mongocxx::v1::client_encryption. More... | |
| mongocxx::v1::client_encryption::~client_encryption | ( | ) |
Destroy this object.
|
noexcept |
Move constructor.
|
delete |
This class is not copyable.
|
explicit |
Initialize with the given options.
| bsoncxx::v1::document::value mongocxx::v1::client_encryption::add_key_alt_name | ( | bsoncxx::v1::types::value | id, |
| bsoncxx::v1::stdx::string_view | key_alt_name ) |
Add a new keyAltName to the specified data key.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::types::value mongocxx::v1::client_encryption::create_data_key | ( | bsoncxx::v1::stdx::string_view | kms_provider | ) |
Create a new data key within the key vault collection.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::types::value mongocxx::v1::client_encryption::create_data_key | ( | bsoncxx::v1::stdx::string_view | kms_provider, |
| v1::data_key_options const & | opts ) |
Create a new data key within the key vault collection.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::collection mongocxx::v1::client_encryption::create_encrypted_collection | ( | v1::database & | db, |
| bsoncxx::v1::stdx::string_view | name, | ||
| bsoncxx::v1::document::view | opts, | ||
| bsoncxx::v1::document::value & | coll_opts, | ||
| bsoncxx::v1::stdx::string_view | kms_provider ) |
Create a collection with encrypted fields.
| db | The database within which to create the encrypted collection. |
| name | The name of the new encrypted collection. |
| opts | "create" options. |
| coll_opts | Set to the options used to create the encrypted collection, including the "encryptedFields" field. |
| kms_provider | The KMS provider to use for this operation. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::collection mongocxx::v1::client_encryption::create_encrypted_collection | ( | v1::database & | db, |
| bsoncxx::v1::stdx::string_view | name, | ||
| bsoncxx::v1::document::view | opts, | ||
| bsoncxx::v1::document::value & | coll_opts, | ||
| bsoncxx::v1::stdx::string_view | kms_provider, | ||
| bsoncxx::v1::document::view | master_key ) |
Create a collection with encrypted fields.
| db | The database within which to create the encrypted collection. |
| name | The name of the new encrypted collection. |
| opts | "create" options. |
| coll_opts | Set to the options used to create the encrypted collection, including the "encryptedFields" field. |
| kms_provider | The KMS provider to use for this operation. |
| master_key | The master key to use when creating a new data key. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::types::value mongocxx::v1::client_encryption::decrypt | ( | bsoncxx::v1::types::value | value | ) |
Decrypt the given value.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::delete_one_result mongocxx::v1::client_encryption::delete_key | ( | bsoncxx::v1::types::value | id | ) |
Delete the specified data key.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::types::value mongocxx::v1::client_encryption::encrypt | ( | bsoncxx::v1::types::value | value, |
| v1::encrypt_options const & | opts ) |
Encrypt the given value.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::document::value mongocxx::v1::client_encryption::encrypt_expression | ( | bsoncxx::v1::document::view | expr, |
| v1::encrypt_options const & | opts ) |
Encrypt the given Match Expression or Aggregate Expression.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::document::value mongocxx::v1::client_encryption::get_key | ( | bsoncxx::v1::types::value | id | ) |
Return the requested data key.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| bsoncxx::v1::document::value mongocxx::v1::client_encryption::get_key_by_alt_name | ( | bsoncxx::v1::stdx::string_view | key_alt_name | ) |
Return the specified data key.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::cursor mongocxx::v1::client_encryption::get_keys | ( | ) |
Return all data keys within the associated key vault collection.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
noexcept |
Move assignment.
|
delete |
This class is not copyable.
| bsoncxx::v1::document::value mongocxx::v1::client_encryption::remove_key_alt_name | ( | bsoncxx::v1::types::value | id, |
| bsoncxx::v1::stdx::string_view | key_alt_name ) |
Remove the given keyAltName from the specified data key.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::rewrap_many_datakey_result mongocxx::v1::client_encryption::rewrap_many_datakey | ( | bsoncxx::v1::document::view | filter, |
| v1::rewrap_many_datakey_options const & | opts ) |
Decrypt and (re-)encrypt multiple data keys.
When the "masterKey" field is set, the data keys are are (re-)encrypted using the new "masterKey". Otherwise, each data key is (re-)encrypted using their current "masterKey".
All rewrapped data keys are updated in the key vault collection using a single bulk write operation. No bulk write operation is executed when no data keys are found that match the given filter.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |