MongoDB C++ Driver mongocxx-4.0.0
|
#include <mongocxx/v_noabi/mongocxx/options/encrypt.hpp>
Class representing options for explicit client-side encryption.
Public Types | |
enum class | encryption_algorithm : std::uint8_t |
Determines which AEAD_AES_256_CBC algorithm to use with HMAC_SHA_512 when encrypting data. More... | |
enum class | encryption_query_type : std::uint8_t |
queryType only applies when algorithm is "indexed" or "range". It is an error to set queryType when algorithm is not "indexed" or "range". More... | |
Public Member Functions | |
const bsoncxx::v_noabi::stdx::optional< encryption_algorithm > & | algorithm () const |
Gets the current algorithm. | |
encrypt & | algorithm (encryption_algorithm algorithm) |
Sets the algorithm to use for encryption. | |
const bsoncxx::v_noabi::stdx::optional< int64_t > & | contention_factor () const |
Gets the current contention factor. | |
encrypt & | contention_factor (int64_t contention_factor) |
Sets the contention factor to use for encryption. contentionFactor only applies when algorithm is "Indexed" or "Range". It is an error to set contentionFactor when algorithm is not "Indexed". | |
const bsoncxx::v_noabi::stdx::optional< std::string > & | key_alt_name () const |
Gets the current key alt name. | |
encrypt & | key_alt_name (std::string name) |
Sets a name by which to lookup a key from the key vault collection to use for this encryption operation. A key alt name can be used instead of a key id. | |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > & | key_id () const |
Gets the key_id. | |
encrypt & | key_id (bsoncxx::v_noabi::types::bson_value::view_or_value key_id) |
Sets the key to use for this encryption operation. A key id can be used instead of a key alt name. | |
const bsoncxx::v_noabi::stdx::optional< encryption_query_type > & | query_type () const |
Gets the current query type. | |
encrypt & | query_type (encryption_query_type query_type) |
Sets the query type to use for encryption. | |
const bsoncxx::v_noabi::stdx::optional< options::range > & | range_opts () const |
Gets the current range options. | |
encrypt & | range_opts (options::range opts) |
Sets the range options to use for encryption. | |
|
strong |
|
strong |
const bsoncxx::v_noabi::stdx::optional< encryption_algorithm > & mongocxx::v_noabi::options::encrypt::algorithm | ( | ) | const |
Gets the current algorithm.
Indexed and Unindexed are used for Queryable Encryption.
encrypt & mongocxx::v_noabi::options::encrypt::algorithm | ( | encryption_algorithm | algorithm | ) |
Sets the algorithm to use for encryption.
Indexed and Unindexed are used for Queryable Encryption.
algorithm | An algorithm, either deterministic, random, indexed, or unindexed to use for encryption. |
const bsoncxx::v_noabi::stdx::optional< int64_t > & mongocxx::v_noabi::options::encrypt::contention_factor | ( | ) | const |
Gets the current contention factor.
encrypt & mongocxx::v_noabi::options::encrypt::contention_factor | ( | int64_t | contention_factor | ) |
Sets the contention factor to use for encryption. contentionFactor only applies when algorithm is "Indexed" or "Range". It is an error to set contentionFactor when algorithm is not "Indexed".
contention_factor | An integer specifiying the desired contention factor. |
const bsoncxx::v_noabi::stdx::optional< std::string > & mongocxx::v_noabi::options::encrypt::key_alt_name | ( | ) | const |
Gets the current key alt name.
encrypt & mongocxx::v_noabi::options::encrypt::key_alt_name | ( | std::string | name | ) |
Sets a name by which to lookup a key from the key vault collection to use for this encryption operation. A key alt name can be used instead of a key id.
name | The name of the key to use for encryption. |
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > & mongocxx::v_noabi::options::encrypt::key_id | ( | ) | const |
Gets the key_id.
encrypt & mongocxx::v_noabi::options::encrypt::key_id | ( | bsoncxx::v_noabi::types::bson_value::view_or_value | key_id | ) |
Sets the key to use for this encryption operation. A key id can be used instead of a key alt name.
If a non-owning bson_value::view is passed in as the key_id, the object that owns key_id's memory must outlive this object.
key_id | The id of the key to use for encryption, as a bson_value containing a UUID (BSON binary subtype 4). |
const bsoncxx::v_noabi::stdx::optional< encryption_query_type > & mongocxx::v_noabi::options::encrypt::query_type | ( | ) | const |
Gets the current query type.
encrypt & mongocxx::v_noabi::options::encrypt::query_type | ( | encryption_query_type | query_type | ) |
Sets the query type to use for encryption.
query_type | One of the following: - equality query_type only applies when algorithm is "Indexed" or "Range". It is an error to set query_type when algorithm is not "Indexed" or "Range". |
const bsoncxx::v_noabi::stdx::optional< options::range > & mongocxx::v_noabi::options::encrypt::range_opts | ( | ) | const |
Gets the current range options.
encrypt & mongocxx::v_noabi::options::encrypt::range_opts | ( | options::range | opts | ) |
Sets the range options to use for encryption.