Loading...
Searching...
No Matches
mongocxx::options::encrypt Class Reference

`#include <mongocxx/v_noabi/mongocxx/options/encrypt.hpp>`

## Description

Used by mongocxx::v_noabi::client_encryption.

## Public Types

using | encryption_algorithm = v1::encrypt_options::encryption_algorithm
| Determines which AEAD_AES_256_CBC algorithm to use with HMAC_SHA_512 when encrypting data.
using | encryption_query_type = v1::encrypt_options::encryption_query_type
| queryType only applies when algorithm is "indexed" or "range". It is an error to set queryType when algorithm is not "indexed" or "range".

## Public Member Functions

| encrypt ()=default
| Default initialization.
| encrypt (v1::encrypt_options opts)
| Construct with the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< encryption_algorithm > const & | algorithm () const
| Gets the current algorithm.
encrypt & | algorithm (encryption_algorithm algorithm)
| Sets the algorithm to use for encryption.
bsoncxx::v_noabi::stdx::optional< std::int64_t > const & | contention_factor () const
| Gets the current contention factor.
encrypt & | contention_factor (std::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".
bsoncxx::v_noabi::stdx::optional< std::string > const & | 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.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & | 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.
| operator v1::encrypt_options () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< encryption_query_type > const & | query_type () const
| Gets the current query type.
encrypt & | query_type (encryption_query_type query_type)
| Sets the query type to use for encryption.
bsoncxx::v_noabi::stdx::optional< options::range > const & | range_opts () const
| Gets the current range options.
encrypt & | range_opts (options::range opts)
| Sets the range options to use for encryption.
bsoncxx::v_noabi::stdx::optional< v1::text_options > const & | text_opts () const
| Gets the current text options.
encrypt & | text_opts (v1::text_options opts)
| Sets the text options to use for encryption.

## Member Typedef Documentation

## encryption_algorithm

using mongocxx::v_noabi::options::encrypt::encryption_algorithm = v1::encrypt_options::encryption_algorithm

Determines which AEAD_AES_256_CBC algorithm to use with HMAC_SHA_512 when encrypting data.

## encryption_query_type

using mongocxx::v_noabi::options::encrypt::encryption_query_type = v1::encrypt_options::encryption_query_type

queryType only applies when algorithm is "indexed" or "range". It is an error to set queryType when algorithm is not "indexed" or "range".

## Constructor & Destructor Documentation

## encrypt() [1/2]

mongocxx::v_noabi::options::encrypt::encrypt | ( |  | ) |

default

Default initialization.

## encrypt() [2/2]

mongocxx::v_noabi::options::encrypt::encrypt | ( | v1::encrypt_options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## Member Function Documentation

## algorithm() [1/2]

bsoncxx::v_noabi::stdx::optional< encryption_algorithm > const & mongocxx::v_noabi::options::encrypt::algorithm | ( |  | ) | const

inline

Gets the current algorithm.

Indexed and Unindexed are used for Queryable Encryption.

Returns
  An optional algorithm.

## algorithm() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::algorithm | ( | encryption_algorithm | algorithm | ) |

inline

Sets the algorithm to use for encryption.

Indexed and Unindexed are used for Queryable Encryption.

Parameters

  algorithm | An algorithm, either deterministic, random, indexed, or unindexed to use for encryption.

Note
  To insert or query with an indexed encrypted payload, use a mongocxx::v_noabi::client configured with mongocxx::v_noabi::options::auto_encryption. mongocxx::v_noabi::options::auto_encryption::bypass_query_analysis may be true. mongocxx::v_noabi::options::auto_encryption::bypass_auto_encryption must be false.

See also
  - https://www.mongodb.com/docs/manual/core/security-client-side-encryption/#encryption-algorithms

## contention_factor() [1/2]

bsoncxx::v_noabi::stdx::optional< std::int64_t > const & mongocxx::v_noabi::options::encrypt::contention_factor | ( |  | ) | const

inline

Gets the current contention factor.

Returns
  An optional contention factor.

## contention_factor() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::contention_factor | ( | std::int64_t | contention_factor | ) |

inline

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".

Parameters

  contention_factor | An integer specifiying the desired contention factor.

## key_alt_name() [1/2]

bsoncxx::v_noabi::stdx::optional< std::string > const & mongocxx::v_noabi::options::encrypt::key_alt_name | ( |  | ) | const

inline

Gets the current key alt name.

Returns
  An optional key name.

## key_alt_name() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::key_alt_name | ( | std::string | name | ) |

inline

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.

Parameters

  name | The name of the key to use for encryption.

Returns
  A reference to this obejct to facilitate method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/method/getClientEncryption/

## key_id() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & mongocxx::v_noabi::options::encrypt::key_id | ( |  | ) | const

inline

Gets the key_id.

Returns
  An optional owning bson_value containing the key_id.

## key_id() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::key_id | ( | bsoncxx::v_noabi::types::bson_value::view_or_value | key_id | ) |

inline

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.

Parameters

  key_id | The id of the key to use for encryption, as a bson_value containing a UUID (BSON binary subtype 4).

Returns
  A reference to this object to facilitate method chaining.

See also
  - https://www.mongodb.com/docs/manual/core/security-client-side-encryption/

## operator v1::encrypt_options()

mongocxx::v_noabi::options::encrypt::operator v1::encrypt_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## query_type() [1/2]

bsoncxx::v_noabi::stdx::optional< encryption_query_type > const & mongocxx::v_noabi::options::encrypt::query_type | ( |  | ) | const

inline

Gets the current query type.

Returns
  A query type.

## query_type() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::query_type | ( | encryption_query_type | query_type | ) |

inline

Sets the query type to use for encryption.

Parameters

  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".

## range_opts() [1/2]

bsoncxx::v_noabi::stdx::optional< options::range > const & mongocxx::v_noabi::options::encrypt::range_opts | ( |  | ) | const

inline

Gets the current range options.

Returns
  An optional range options.

## range_opts() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::range_opts | ( | options::range | opts | ) |

inline

Sets the range options to use for encryption.

## text_opts() [1/2]

bsoncxx::v_noabi::stdx::optional< v1::text_options > const & mongocxx::v_noabi::options::encrypt::text_opts | ( |  | ) | const

inline

Gets the current text options.

## text_opts() [2/2]

encrypt & mongocxx::v_noabi::options::encrypt::text_opts | ( | v1::text_options | opts | ) |

inline

Sets the text options to use for encryption.

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

- mongocxx/v_noabi/mongocxx/options/encrypt.hpp