MySQL 8.4.0
Source Code Documentation
signing_key.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 Without limiting anything contained in the foregoing, this file,
16 which is part of C Driver for MySQL (Connector/C), is also subject to the
17 Universal FOSS Exception, version 1.0, a copy of which can be found at
18 http://oss.oracle.com/licenses/universal-foss-exception.
19
20 This program is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License, version 2.0, for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
28
29#ifndef OCI_SIGNING_KEYS_H
30#define OCI_SIGNING_KEYS_H
31
32#include <string>
33
34#include "sql-common/oci/ssl.h"
36
37namespace oci {
39 /**
40 * @brief Private key from a local file, used to Signing_Key::sign() requests.
41 *
42 */
43 private:
45 std::string m_public_key;
46
47 public:
48 Signing_Key(const std::string &file_name);
51 Signing_Key(const Signing_Key &) = delete;
52 Signing_Key &operator=(const Signing_Key &) = delete;
53 Signing_Key(Signing_Key &&) = default;
55 operator bool() const { return m_private_key.operator bool(); }
56 std::string get_public_key() { return m_public_key; }
57
58 // main operation
59 Data sign(const std::string &message);
60 Data sign(const void *message, size_t length);
61};
62} // namespace oci
63#endif
Definition: signing_key.h:38
Signing_Key(Signing_Key &&)=default
Signing_Key()
Constructor.
Definition: signing_key.cc:132
Signing_Key & operator=(Signing_Key &&)=delete
Signing_Key(const Signing_Key &)=delete
std::string get_public_key()
Definition: signing_key.h:56
std::string m_public_key
Definition: signing_key.h:45
Data sign(const std::string &message)
Definition: signing_key.cc:42
ssl::EVP_PKEY_ptr m_private_key
Private key from a local file, used to Signing_Key::sign() requests.
Definition: signing_key.h:44
Signing_Key & operator=(const Signing_Key &)=delete
Definition: ssl.h:39
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:76
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:94
std::unique_ptr< EVP_PKEY, EVP_PKEY_deleter > EVP_PKEY_ptr
Definition: ssl_ptr.h:76
Definition: signing_key.cc:36
std::vector< unsigned char > Data
Definition: ssl.h:36