MongoDB C++ Driver  mongocxx-3.6.7
Public Member Functions | Friends | List of all members
mongocxx::options::data_key Class Reference

Class representing options for data key generation for encryption. More...

#include <data_key.hpp>

Public Member Functions

data_keymaster_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_keykey_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
 

Detailed Description

Class representing options for data key generation for encryption.

Member Function Documentation

◆ key_alt_names() [1/2]

const std::vector<std::string>& mongocxx::options::data_key::key_alt_names ( ) const

Gets the alternate names for the data key.

Returns
The alternate names for the data key.

◆ key_alt_names() [2/2]

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.

Parameters
key_alt_namesThe alternate names for the key.
Returns
A reference to this object.
See also
https://docs.mongodb.com/manual/reference/method/getClientEncryption/

◆ master_key() [1/2]

const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::data_key::master_key ( ) const

Gets the master key.

Returns
An optional document containing the master key.

◆ master_key() [2/2]

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 kmsProvider is "aws" it is required and has the following fields:

  • region: String // Required.
  • key: String // Required. The Amazon Resource Name (ARN) to the AWS customer master key (CMK).
  • endpoint: String // Optional. An alternate host identifier to send KMS requests to. May include port number.
Parameters
master_keyThe document representing the master key.
Returns
A reference to this object.
See also
https://docs.mongodb.com/manual/core/security-client-side-encryption-key-management/

The documentation for this class was generated from the following file: