MongoDB C++ Driver
mongocxx-3.7.0
|
Class representing options for explicit client-side encryption. More...
#include <encrypt.hpp>
Public Types | |
enum | encryption_algorithm : std::uint8_t { encryption_algorithm::k_deterministic, encryption_algorithm::k_random } |
Determines which AEAD_AES_256_CBC algorithm to use with HMAC_SHA_512 when encrypting data. More... | |
Public Member Functions | |
encrypt & | key_id (bsoncxx::types::bson_value::view_or_value key_id) |
Sets the key to use for this encryption operation. More... | |
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. More... | |
const stdx::optional< std::string > & | key_alt_name () const |
Gets the current key alt name. More... | |
encrypt & | algorithm (encryption_algorithm algorithm) |
Sets the algorithm to use for encryption. More... | |
const stdx::optional< encryption_algorithm > & | algorithm () const |
Gets the current algorithm. More... | |
const stdx::optional< bsoncxx::types::bson_value::view_or_value > & | key_id () const |
Gets the key_id. More... | |
Friends | |
class | mongocxx::client_encryption |
Class representing options for explicit client-side encryption.
|
strong |
const stdx::optional<encryption_algorithm>& mongocxx::options::encrypt::algorithm | ( | ) | const |
Gets the current algorithm.
encrypt& mongocxx::options::encrypt::algorithm | ( | encryption_algorithm | algorithm | ) |
Sets the algorithm to use for encryption.
algorithm | An algorithm, either deterministic or random, to use for encryption. |
const stdx::optional<std::string>& mongocxx::options::encrypt::key_alt_name | ( | ) | const |
Gets the current key alt name.
encrypt& mongocxx::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 stdx::optional<bsoncxx::types::bson_value::view_or_value>& mongocxx::options::encrypt::key_id | ( | ) | const |
Gets the key_id.
encrypt& mongocxx::options::encrypt::key_id | ( | bsoncxx::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). |