MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
111 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const&)
112 master_key() const;
113
129
136 MONGOCXX_ABI_EXPORT_CDECL(std::vector<std::string> const&) key_alt_names() const;
137
141 using key_material_type = std::vector<uint8_t>;
142
163
175
176 private:
178
179 void* convert() const;
180
181 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _master_key;
182 std::vector<std::string> _key_alt_names;
183 bsoncxx::v_noabi::stdx::optional<key_material_type> _key_material;
184};
185
186} // namespace options
187} // namespace v_noabi
188} // namespace mongocxx
189
190#include <mongocxx/config/postlude.hpp>
191
Used by mongocxx::v_noabi::client_encryption.
Definition client_encryption.hpp:35
Used by mongocxx::v_noabi::client_encryption::create_data_key.
Definition data_key.hpp:35
std::vector< uint8_t > key_material_type
Represents binary data used to represent key material.
Definition data_key.hpp:141
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 a...
data_key & master_key(bsoncxx::v_noabi::document::view_or_value master_key)
Sets a KMS-specific key used to encrypt the new data key.
data_key & key_material(key_material_type key_material)
Sets the binary data for the key material.
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 export.hpp:52
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Provides std::optional-related polyfills for library API usage.