MongoDB C++ Driver
mongocxx-3.7.0
|
Class representing options for data key generation for encryption. More...
#include <data_key.hpp>
Public Member Functions | |
data_key & | master_key (bsoncxx::document::view_or_value master_key) |
Sets a KMS-specific key used to encrypt the new data key. More... | |
const stdx::optional< bsoncxx::document::view_or_value > & | master_key () const |
Gets the master key. More... | |
data_key & | key_alt_names (std::vector< std::string > key_alt_names) |
Sets an optional list of string alternate names used to reference the key. More... | |
const std::vector< std::string > & | key_alt_names () const |
Gets the alternate names for the data key. More... | |
Friends | |
class | mongocxx::client_encryption |
Class representing options for data key generation for encryption.
const std::vector<std::string>& mongocxx::options::data_key::key_alt_names | ( | ) | const |
Gets the alternate names for the data key.
data_key& mongocxx::options::data_key::key_alt_names | ( | std::vector< std::string > | key_alt_names | ) |
Sets an optional list of string alternate names used to reference the key.
If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id.
key_alt_names | The alternate names for the key. |
const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::data_key::master_key | ( | ) | const |
Gets the master key.
data_key& mongocxx::options::data_key::master_key | ( | bsoncxx::document::view_or_value | master_key | ) |
Sets a KMS-specific key used to encrypt the new data key.
If the KMS provider is "aws" the masterKey is required and has the following fields:
{ region: String, key: String, // The Amazon Resource Name (ARN) to the AWS customer master key (CMK). endpoint: Optional<String> // An alternate host identifier to send KMS requests to. May include port number. Defaults to "kms.<region>.amazonaws.com" }
If the KMS provider is "azure" the masterKey is required and has the following fields:
{ keyVaultEndpoint: String, // Host with optional port. Example: "example.vault.azure.net". keyName: String, keyVersion: Optional<String> // A specific version of the named key, defaults to using the key's primary version. }
If the KMS provider is "gcp" the masterKey is required and has the following fields:
{ projectId: String, location: String, keyRing: String, keyName: String, keyVersion: Optional<String>, // A specific version of the named key, defaults to using the key's primary version. endpoint: Optional<String> // Host with optional port. Defaults to "cloudkms.googleapis.com". }
If the KMS provider is "kmip" the masterKey is required and has the following fields:
{ }
If the KMS provider is "local" the masterKey is not applicable.
master_key | The document representing the master key. |