MySQL 8.3.0
Source Code Documentation
signing_key.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 Without limiting anything contained in the foregoing, this file,
15 which is part of C Driver for MySQL (Connector/C), is also subject to the
16 Universal FOSS Exception, version 1.0, a copy of which can be found at
17 http://oss.oracle.com/licenses/universal-foss-exception.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License, version 2.0, for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
27
28#ifndef OCI_SIGNING_KEYS_H
29#define OCI_SIGNING_KEYS_H
30
31#include <string>
32
33#include "sql-common/oci/ssl.h"
35
36namespace oci {
38 /**
39 * @brief Private key from a local file, used to Signing_Key::sign() requests.
40 *
41 */
42 private:
44 std::string m_public_key;
45
46 public:
47 Signing_Key(const std::string &file_name);
50 Signing_Key(const Signing_Key &) = delete;
51 Signing_Key &operator=(const Signing_Key &) = delete;
52 Signing_Key(Signing_Key &&) = default;
54 operator bool() const { return m_private_key.operator bool(); }
55 std::string get_public_key() { return m_public_key; }
56
57 // main operation
58 Data sign(const std::string &message);
59 Data sign(const void *message, size_t length);
60};
61} // namespace oci
62#endif
Definition: signing_key.h:37
Signing_Key(Signing_Key &&)=default
Signing_Key()
Constructor.
Definition: signing_key.cc:131
Signing_Key & operator=(Signing_Key &&)=delete
Signing_Key(const Signing_Key &)=delete
std::string get_public_key()
Definition: signing_key.h:55
std::string m_public_key
Definition: signing_key.h:44
Data sign(const std::string &message)
Definition: signing_key.cc:41
ssl::EVP_PKEY_ptr m_private_key
Private key from a local file, used to Signing_Key::sign() requests.
Definition: signing_key.h:43
Signing_Key & operator=(const Signing_Key &)=delete
Definition: ssl.h:38
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:93
std::unique_ptr< EVP_PKEY, EVP_PKEY_deleter > EVP_PKEY_ptr
Definition: ssl_ptr.h:75
Definition: signing_key.cc:35
std::vector< unsigned char > Data
Definition: ssl.h:35