MongoDB C++ Driver mongocxx-4.0.0
Loading...
Searching...
No Matches
data_key.hpp
Go to the documentation of this file.
1// Copyright 2009-present 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 <string>
18#include <vector>
19
22
25
27
28namespace mongocxx {
29namespace v_noabi {
30namespace options {
31
35class data_key {
36 public:
103 master_key(bsoncxx::v_noabi::document::view_or_value master_key);
104
112 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
113 master_key() const;
114
130
137 MONGOCXX_ABI_EXPORT_CDECL(const std::vector<std::string>&) key_alt_names() const;
138
142 using key_material_type = std::vector<uint8_t>;
143
164
174 MONGOCXX_ABI_EXPORT_CDECL(const bsoncxx::v_noabi::stdx::optional<key_material_type>&)
176
177 private:
178 friend ::mongocxx::v_noabi::client_encryption;
179
180 void* convert() const;
181
182 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _master_key;
183 std::vector<std::string> _key_alt_names;
184 bsoncxx::v_noabi::stdx::optional<key_material_type> _key_material;
185};
186
187} // namespace options
188} // namespace v_noabi
189} // namespace mongocxx
190
191#include <mongocxx/config/postlude.hpp>
192
Class representing options for the object managing explicit client-side encryption.
Definition client_encryption.hpp:35
Class representing options for data key generation for encryption.
Definition data_key.hpp:35
const std::vector< std::string > & key_alt_names() const
Gets the alternate names for the data key.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > & master_key() const
Gets the master key.
std::vector< uint8_t > key_material_type
Represents binary data used to represent key material.
Definition data_key.hpp:142
const bsoncxx::v_noabi::stdx::optional< key_material_type > & key_material()
Gets the keyMaterial as binary data.
Declares mongocxx::v_noabi::client_encryption.
Declares mongocxx::v_noabi::options::data_key.
Provides bsoncxx::v_noabi::document::view_or_value.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:204
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides std::optional-related polyfills for library API usage.