MongoDB C++ Driver mongocxx-3.11.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
26#include <mongocxx/stdx.hpp>
27
29
30namespace mongocxx {
31namespace v_noabi {
32namespace options {
33
37class data_key {
38 public:
76 // keyId: Optional<String>, // keyId is the KMIP Unique Identifier to a 96 byte KMIP Secret
77 // // Data managed object.If keyId is omitted, the driver creates a
78 // // random 96 byte KMIP Secret Data managed object.
79 // endpoint: Optional<String> // Host with optional port.
94 master_key(bsoncxx::v_noabi::document::view_or_value master_key);
95
102 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
103 master_key() const;
104
120
127 MONGOCXX_ABI_EXPORT_CDECL(const std::vector<std::string>&) key_alt_names() const;
128
132 using key_material_type = std::vector<uint8_t>;
133
154
165
166 private:
167 friend ::mongocxx::v_noabi::client_encryption;
168
169 void* convert() const;
170
171 stdx::optional<bsoncxx::v_noabi::document::view_or_value> _master_key;
172 std::vector<std::string> _key_alt_names;
173 stdx::optional<key_material_type> _key_material;
174};
175
176} // namespace options
177} // namespace v_noabi
178} // namespace mongocxx
179
180// CXX-2770: missing include of postlude header.
181#if defined(MONGOCXX_TEST_MACRO_GUARDS_FIX_MISSING_POSTLUDE)
183#endif
184
Class representing options for the object managing explicit client-side encryption.
Definition client_encryption.hpp:37
Class representing options for data key generation for encryption.
Definition data_key.hpp:37
const std::vector< std::string > & key_alt_names() const
Gets the alternate names for the data key.
const 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:132
const 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:222
The mongocxx macro guard postlude header.
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.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.