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 MCNAPI ::std::string _computeSharedSecretECC(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
87
88 MCNAPI ::std::string _decryptDataRSA(
89 ::std::string const& privateKey,
90 ::std::string const& data,
91 ::Crypto::Asymmetric::Padding paddingType
92 );
93
94 MCNAPI ::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 MCNAPI bool _generateKeyPairECC(::std::string& privateKey, ::std::string& publicKey);
102 // NOLINTEND
103
104public:
105 // virtual function thunks
106 // NOLINTBEGIN
107 MCNAPI bool $generateKeyPair(::std::string& privateKey, ::std::string& publicKey);
108
109 MCNAPI ::std::string $encryptData(
110 ::std::string const& publicKey,
111 ::std::string const& data,
112 ::Crypto::Asymmetric::Padding paddingType,
113 ::Crypto::Asymmetric::PubKeyFormat keyFormat
114 );
115
116 MCNAPI ::std::string
117 $decryptData(::std::string const& privateKey, ::std::string const& data, ::Crypto::Asymmetric::Padding paddingType);
118
119 MCNAPI ::std::string $signData(
120 ::std::string const& privateKey,
121 ::std::string const& data,
122 ::Crypto::Hash::HashType hash,
123 ::Crypto::Asymmetric::PrivateKeySigningFormat format
124 );
125
126 MCNAPI bool $verifyData(
127 ::std::string const& publicKey,
128 ::std::string const& signature,
129 ::std::string const& data,
130 ::Crypto::Hash::HashType hash
131 );
132
133 MCNAPI ::std::string $computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey);
134 // NOLINTEND
135
136public:
137 // vftables
138 // NOLINTBEGIN
139 MCNAPI static void** $vftable();
140 // NOLINTEND
141};
142
143} // 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 $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