MongoDB C++ Driver current
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
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
173 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<key_material_type> const&)
175
176 private:
177 friend ::mongocxx::v_noabi::client_encryption;
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
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & master_key() const
Gets the master key.
std::vector< std::string > const & key_alt_names() const
Gets the alternate names for the data key.
bsoncxx::v_noabi::stdx::optional< key_material_type > const & 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 export.hpp:52
The mongocxx v_noabi 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.
Provides std::optional-related polyfills for library API usage.