LeviLamina
Loading...
Searching...
No Matches
OpenSSLInterface.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/crypto/asymmetric/ISystemInterface.h"
7#include "mc/deps/crypto/asymmetric/Padding.h"
8#include "mc/deps/crypto/asymmetric/PrivateKeySigningFormat.h"
9#include "mc/deps/crypto/asymmetric/PubKeyFormat.h"
10#include "mc/deps/crypto/hash/HashType.h"
11
12namespace Crypto::Asymmetric {
13
15public:
16 // OpenSSLInterface inner types define
17 enum class SystemType : int {
18 Rsa = 0,
19 Ecc = 1,
20 None = 2,
21 };
22
23public:
24 // member variables
25 // NOLINTBEGIN
30 // NOLINTEND
31
32public:
33 // prevent constructor by default
34 OpenSSLInterface& operator=(OpenSSLInterface const&);
37
38public:
39 // virtual functions
40 // NOLINTBEGIN
41 // vIndex: 0
42 virtual ~OpenSSLInterface() /*override*/ = default;
43
44 // vIndex: 1
45 virtual bool generateKeyPair(::std::string& privateKey, ::std::string& publicKey) /*override*/;
46
47 // vIndex: 2
48 virtual ::std::string encryptData(
49 ::std::string const& publicKey,
50 ::std::string const& data,
51 ::Crypto::Asymmetric::Padding paddingType,
52 ::Crypto::Asymmetric::PubKeyFormat keyFormat
53 ) /*override*/;
54
55 // vIndex: 3
56 virtual ::std::string decryptData(
57 ::std::string const& privateKey,
58 ::std::string const& data,
59 ::Crypto::Asymmetric::Padding paddingType
60 ) /*override*/;
61
62 // vIndex: 4
63 virtual ::std::string signData(
64 ::std::string const& privateKey,
65 ::std::string const& data,
66 ::Crypto::Hash::HashType hash,
67 ::Crypto::Asymmetric::PrivateKeySigningFormat format
68 ) /*override*/;
69
70 // vIndex: 5
71 virtual bool verifyData(
72 ::std::string const& publicKey,
73 ::std::string const& signature,
74 ::std::string const& data,
75 ::Crypto::Hash::HashType hash
76 ) /*override*/;
77
78 // vIndex: 6
79 virtual ::std::string
80 computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey) /*override*/;
81 // NOLINTEND
82
83public:
84 // member functions
85 // NOLINTBEGIN
86 MCAPI ::std::string _computeSharedSecretECC(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
87
88 MCAPI ::std::string _decryptDataRSA(
89 ::std::string const& privateKey,
90 ::std::string const& data,
91 ::Crypto::Asymmetric::Padding paddingType
92 );
93
94 MCAPI ::std::string _encryptDataRSA(
95 ::std::string const& publicKey,
96 ::std::string const& data,
97 ::Crypto::Asymmetric::Padding paddingType,
98 ::Crypto::Asymmetric::PubKeyFormat keyFormat
99 );
100
101 MCAPI bool _generateKeyPairECC(::std::string& privateKey, ::std::string& publicKey);
102 // NOLINTEND
103
104public:
105 // destructor thunk
106 // NOLINTBEGIN
107
108 // NOLINTEND
109
110public:
111 // virtual function thunks
112 // NOLINTBEGIN
113 MCAPI bool $generateKeyPair(::std::string& privateKey, ::std::string& publicKey);
114
115 MCAPI ::std::string $encryptData(
116 ::std::string const& publicKey,
117 ::std::string const& data,
118 ::Crypto::Asymmetric::Padding paddingType,
119 ::Crypto::Asymmetric::PubKeyFormat keyFormat
120 );
121
122 MCAPI ::std::string
123 $decryptData(::std::string const& privateKey, ::std::string const& data, ::Crypto::Asymmetric::Padding paddingType);
124
125 MCAPI ::std::string $signData(
126 ::std::string const& privateKey,
127 ::std::string const& data,
128 ::Crypto::Hash::HashType hash,
129 ::Crypto::Asymmetric::PrivateKeySigningFormat format
130 );
131
132 MCAPI bool $verifyData(
133 ::std::string const& publicKey,
134 ::std::string const& signature,
135 ::std::string const& data,
136 ::Crypto::Hash::HashType hash
137 );
138
139 MCAPI ::std::string $computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
140 // NOLINTEND
141
142public:
143 // vftables
144 // NOLINTBEGIN
145 MCAPI static void** $vftable();
146 // NOLINTEND
147};
148
149} // namespace Crypto::Asymmetric
Definition ISystemInterface.h:13
Definition OpenSSLInterface.h:14
Definition Alias.h:14