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 bool
49 constructPublicKey(::std::string const& modulus, ::std::string const& exponent, ::std::string& keyOut) /*override*/;
50
51 // vIndex: 3
52 virtual ::std::string encryptData(
53 ::std::string const& publicKey,
54 ::std::string const& data,
55 ::Crypto::Asymmetric::Padding paddingType,
56 ::Crypto::Asymmetric::PubKeyFormat keyFormat
57 ) /*override*/;
58
59 // vIndex: 4
60 virtual ::std::string decryptData(
61 ::std::string const& privateKey,
62 ::std::string const& data,
63 ::Crypto::Asymmetric::Padding paddingType
64 ) /*override*/;
65
66 // vIndex: 5
67 virtual ::std::string signData(
68 ::std::string const& privateKey,
69 ::std::string const& data,
70 ::Crypto::Hash::HashType hash,
71 ::Crypto::Asymmetric::PrivateKeySigningFormat format
72 ) /*override*/;
73
74 // vIndex: 6
75 virtual bool verifyData(
76 ::std::string const& publicKey,
77 ::std::string const& signature,
78 ::std::string const& data,
79 ::Crypto::Hash::HashType hash
80 ) /*override*/;
81
82 // vIndex: 7
83 virtual ::std::string
84 computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey) /*override*/;
85 // NOLINTEND
86
87public:
88 // member functions
89 // NOLINTBEGIN
90 MCNAPI ::std::string _computeSharedSecretECC(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
91
92 MCNAPI ::std::string _decryptDataRSA(
93 ::std::string const& privateKey,
94 ::std::string const& data,
95 ::Crypto::Asymmetric::Padding paddingType
96 );
97
98 MCNAPI ::std::string _encryptDataRSA(
99 ::std::string const& publicKey,
100 ::std::string const& data,
101 ::Crypto::Asymmetric::Padding paddingType,
102 ::Crypto::Asymmetric::PubKeyFormat keyFormat
103 );
104
105 MCNAPI bool _generateKeyPairECC(::std::string& privateKey, ::std::string& publicKey);
106 // NOLINTEND
107
108public:
109 // virtual function thunks
110 // NOLINTBEGIN
111 MCNAPI bool $generateKeyPair(::std::string& privateKey, ::std::string& publicKey);
112
113 MCNAPI bool $constructPublicKey(::std::string const& modulus, ::std::string const& exponent, ::std::string& keyOut);
114
115 MCNAPI ::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 MCNAPI ::std::string
123 $decryptData(::std::string const& privateKey, ::std::string const& data, ::Crypto::Asymmetric::Padding paddingType);
124
125 MCNAPI ::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 MCNAPI 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 MCNAPI ::std::string $computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
140 // NOLINTEND
141
142public:
143 // vftables
144 // NOLINTBEGIN
145 MCNAPI static void** $vftable();
146 // NOLINTEND
147};
148
149} // namespace Crypto::Asymmetric
Definition ISystemInterface.h:13
Definition OpenSSLInterface.h:14
MCAPI::std::string $decryptData(::std::string const &privateKey, ::std::string const &data, ::Crypto::Asymmetric::Padding paddingType)
MCAPI::std::string $computeSharedSecret(::std::string const &myPrivateKey, ::std::string const &peerPublicKey)
MCAPI::std::string _computeSharedSecretECC(::std::string const &myPrivateKey, ::std::string const &peerPublicKey)
MCAPI bool _generateKeyPairECC(::std::string &privateKey, ::std::string &publicKey)
MCAPI::std::string _encryptDataRSA(::std::string const &publicKey, ::std::string const &data, ::Crypto::Asymmetric::Padding paddingType, ::Crypto::Asymmetric::PubKeyFormat keyFormat)
MCAPI bool $generateKeyPair(::std::string &privateKey, ::std::string &publicKey)
MCAPI::std::string $signData(::std::string const &privateKey, ::std::string const &data, ::Crypto::Hash::HashType hash, ::Crypto::Asymmetric::PrivateKeySigningFormat format)
MCAPI::std::string _decryptDataRSA(::std::string const &privateKey, ::std::string const &data, ::Crypto::Asymmetric::Padding paddingType)
static MCAPI void ** $vftable()
MCAPI bool $constructPublicKey(::std::string const &modulus, ::std::string const &exponent, ::std::string &keyOut)
MCAPI bool $verifyData(::std::string const &publicKey, ::std::string const &signature, ::std::string const &data, ::Crypto::Hash::HashType hash)
MCAPI::std::string $encryptData(::std::string const &publicKey, ::std::string const &data, ::Crypto::Asymmetric::Padding paddingType, ::Crypto::Asymmetric::PubKeyFormat keyFormat)
Definition Alias.h:14