MongoDB C++ Driver mongocxx-3.7.0
Loading...
Searching...
No Matches
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
25namespace mongocxx {
26MONGOCXX_INLINE_NAMESPACE_BEGIN
27
31class MONGOCXX_API client_encryption {
32 public:
42
47
52
57
58 client_encryption(const client_encryption&) = delete;
59 client_encryption& operator=(const client_encryption&) = delete;
60
78 bsoncxx::types::bson_value::value create_data_key(std::string kms_provider,
79 const options::data_key& opts = {});
80
98 const options::encrypt& opts);
99
114
115 private:
116 class MONGOCXX_PRIVATE impl;
117
118 std::unique_ptr<impl> _impl;
119};
120
121MONGOCXX_INLINE_NAMESPACE_END
122} // namespace mongocxx
123
124#include <mongocxx/config/postlude.hpp>
A variant owning type that represents any BSON type.
Definition value.hpp:44
A view-only variant that can contain any BSON type.
Definition view.hpp:44
Class supporting operations for MongoDB Client-Side Field Level Encryption.
Definition client_encryption.hpp:31
client_encryption(options::client_encryption opts)
Creates a client_encryption object.
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.
bsoncxx::types::bson_value::value decrypt(bsoncxx::types::bson_value::view value)
Decrypts an encrypted value (BSON binary of subtype 6).
~client_encryption() noexcept
Destroys a client_encryption.
Class representing options for the object managing explicit client-side encryption.
Definition client_encryption.hpp:36
Class representing options for explicit client-side encryption.
Definition encrypt.hpp:34
Top level namespace for MongoDB C++ BSON functionality.
Definition element.hpp:24
Top level namespace for the MongoDB C++ driver.
Definition bulk_write.hpp:24