MongoDB C++ Driver  mongocxx-3.6.2
All Classes Namespaces Functions Typedefs Enumerations Enumerator Friends Pages
client_encryption.hpp
1 // Copyright 2020 MongoDB Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <bsoncxx/types/bson_value/value.hpp>
18 #include <bsoncxx/types/bson_value/view.hpp>
19 #include <mongocxx/options/client_encryption.hpp>
20 #include <mongocxx/options/data_key.hpp>
21 #include <mongocxx/options/encrypt.hpp>
22 
23 #include <mongocxx/config/prelude.hpp>
24 
25 namespace mongocxx {
26 MONGOCXX_INLINE_NAMESPACE_BEGIN
27 
28 class MONGOCXX_API client_encryption {
29  public:
39 
43  ~client_encryption() noexcept;
44 
62  bsoncxx::types::bson_value::value create_data_key(std::string kms_provider,
63  const options::data_key& opts = {});
64 
82  const options::encrypt& opts);
83 
98 
99  private:
100  class MONGOCXX_PRIVATE impl;
101 
102  std::unique_ptr<impl> _impl;
103 };
104 
105 MONGOCXX_INLINE_NAMESPACE_END
106 } // namespace mongocxx
107 
108 #include <mongocxx/config/postlude.hpp>
mongocxx::options::client_encryption
Class representing options for the object managing explicit client-side encryption.
Definition: client_encryption.hpp:36
mongocxx
Top level namespace for the MongoDB C++ driver.
Definition: bulk_write.hpp:24
bsoncxx
Top level namespace for MongoDB C++ BSON functionality.
Definition: element.hpp:24
mongocxx::client_encryption::~client_encryption
~client_encryption() noexcept
Destroys a client_encryption.
mongocxx::options::encrypt
Class representing options for explicit client-side encryption.
Definition: encrypt.hpp:34
mongocxx::client_encryption
Definition: client_encryption.hpp:28
mongocxx::client_encryption::client_encryption
client_encryption(options::client_encryption opts)
Creates a client_encryption object.
mongocxx::client_encryption::encrypt
bsoncxx::types::bson_value::value encrypt(bsoncxx::types::bson_value::view value, const options::encrypt &opts)
Encrypts a BSON value with a given key and algorithm.
mongocxx::client_encryption::decrypt
bsoncxx::types::bson_value::value decrypt(bsoncxx::types::bson_value::view value)
Decrypts an encrypted value (BSON binary of subtype 6).
bsoncxx::types::bson_value::value
A variant owning type that represents any BSON type.
Definition: value.hpp:39
bsoncxx::types::bson_value::view
A view-only variant that can contain any BSON type.
Definition: view.hpp:44