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/Padding.h"
7#include "mc/deps/crypto/PrivateKeySigningFormat.h"
8#include "mc/deps/crypto/PubKeyFormat.h"
9#include "mc/deps/crypto/asymmetric/system/ISystemInterface.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 bool useSHA256
58 ) /*override*/;
59
60 // vIndex: 4
61 virtual ::std::string decryptData(
62 ::std::string const& privateKey,
63 ::std::string const& data,
64 ::Crypto::Asymmetric::Padding paddingType
65 ) /*override*/;
66
67 // vIndex: 5
68 virtual ::std::string signData(
69 ::std::string const& privateKey,
70 ::std::string const& data,
71 ::Crypto::Hash::HashType hash,
72 ::Crypto::Asymmetric::PrivateKeySigningFormat format
73 ) /*override*/;
74
75 // vIndex: 6
76 virtual bool verifyData(
77 ::std::string const& publicKey,
78 ::std::string const& signature,
79 ::std::string const& data,
80 ::Crypto::Hash::HashType hash
81 ) /*override*/;
82
83 // vIndex: 7
84 virtual ::std::string
85 computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey) /*override*/;
86 // NOLINTEND
87
88public:
89 // member functions
90 // NOLINTBEGIN
91 MCNAPI ::std::string _computeSharedSecretECC(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
92
93 MCNAPI ::std::string _decryptDataRSA(
94 ::std::string const& privateKey,
95 ::std::string const& data,
96 ::Crypto::Asymmetric::Padding paddingType
97 );
98
99 MCNAPI ::std::string _encryptDataRSA(
100 ::std::string const& publicKey,
101 ::std::string const& data,
102 ::Crypto::Asymmetric::Padding paddingType,
103 ::Crypto::Asymmetric::PubKeyFormat keyFormat,
104 bool useSHA256
105 );
106
107 MCNAPI bool _generateKeyPairECC(::std::string& privateKey, ::std::string& publicKey);
108 // NOLINTEND
109
110public:
111 // virtual function thunks
112 // NOLINTBEGIN
113 MCNAPI bool $generateKeyPair(::std::string& privateKey, ::std::string& publicKey);
114
115 MCNAPI bool $constructPublicKey(::std::string const& modulus, ::std::string const& exponent, ::std::string& keyOut);
116
117 MCNAPI ::std::string $encryptData(
118 ::std::string const& publicKey,
119 ::std::string const& data,
120 ::Crypto::Asymmetric::Padding paddingType,
121 ::Crypto::Asymmetric::PubKeyFormat keyFormat,
122 bool useSHA256
123 );
124
125 MCNAPI ::std::string
126 $decryptData(::std::string const& privateKey, ::std::string const& data, ::Crypto::Asymmetric::Padding paddingType);
127
128 MCNAPI ::std::string $signData(
129 ::std::string const& privateKey,
130 ::std::string const& data,
131 ::Crypto::Hash::HashType hash,
132 ::Crypto::Asymmetric::PrivateKeySigningFormat format
133 );
134
135 MCNAPI bool $verifyData(
136 ::std::string const& publicKey,
137 ::std::string const& signature,
138 ::std::string const& data,
139 ::Crypto::Hash::HashType hash
140 );
141
142 MCNAPI ::std::string $computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
143 // NOLINTEND
144
145public:
146 // vftables
147 // NOLINTBEGIN
148 MCNAPI static void** $vftable();
149 // NOLINTEND
150};
151
152} // 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 bool $generateKeyPair(::std::string &privateKey, ::std::string &publicKey)
MCAPI::std::string $encryptData(::std::string const &publicKey, ::std::string const &data, ::Crypto::Asymmetric::Padding paddingType, ::Crypto::Asymmetric::PubKeyFormat keyFormat, bool useSHA256)
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 _encryptDataRSA(::std::string const &publicKey, ::std::string const &data, ::Crypto::Asymmetric::Padding paddingType, ::Crypto::Asymmetric::PubKeyFormat keyFormat, bool useSHA256)
Definition Alias.h:14