LeviLamina
Loading...
Searching...
No Matches
ISystemInterface.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/crypto/asymmetric/Padding.h"
7#include "mc/deps/crypto/asymmetric/PrivateKeySigningFormat.h"
8#include "mc/deps/crypto/asymmetric/PubKeyFormat.h"
9#include "mc/deps/crypto/hash/HashType.h"
10#include "mc/platform/Result.h"
11
12// auto generated forward declare list
13// clang-format off
14namespace Crypto::Asymmetric { struct EcPublicKeyComponents; }
15namespace Crypto::Asymmetric { struct RsaPublicKeyComponents; }
16// clang-format on
17
18namespace Crypto::Asymmetric {
19
21public:
22 // virtual functions
23 // NOLINTBEGIN
24 virtual ~ISystemInterface() = default;
25
26 virtual bool generateKeyPair(::std::string& privateKey, ::std::string& publicKey) = 0;
27
28 virtual ::Bedrock::Result<::std::string>
29 parsePrivateKey(::std::string const& privateKey, ::Crypto::Asymmetric::PrivateKeySigningFormat format) = 0;
30
31 virtual ::Bedrock::Result<::std::string> derivePublicKey(::std::string const& privateKey) = 0;
32
33 virtual ::Bedrock::Result<::std::string> constructPublicKey(
34 ::std::variant<::Crypto::Asymmetric::RsaPublicKeyComponents, ::Crypto::Asymmetric::EcPublicKeyComponents> const&
35 components
36 ) = 0;
37
38 virtual ::Bedrock::Result<
39 ::std::variant<::Crypto::Asymmetric::RsaPublicKeyComponents, ::Crypto::Asymmetric::EcPublicKeyComponents>>
40 deconstructPublicKey(::std::string const& publicKey) = 0;
41
42 virtual ::std::string encryptData(
43 ::std::string const& publicKey,
44 ::std::string const& data,
45 ::Crypto::Asymmetric::Padding paddingType,
46 ::Crypto::Asymmetric::PubKeyFormat keyFormat,
47 bool useSHA256
48 ) = 0;
49
50 virtual ::std::string decryptData(
51 ::std::string const& privateKey,
52 ::std::string const& data,
53 ::Crypto::Asymmetric::Padding paddingType
54 ) = 0;
55
56 virtual ::std::string signData(
57 ::std::string const& privateKey,
58 ::std::string const& data,
59 ::Crypto::Hash::HashType hash,
60 ::Crypto::Asymmetric::PrivateKeySigningFormat format
61 ) = 0;
62
63 virtual bool verifyData(
64 ::std::string const& publicKey,
65 ::std::string const& signature,
66 ::std::string const& data,
67 ::Crypto::Hash::HashType hash
68 ) = 0;
69
70 virtual ::std::string
71 computeSharedSecret(::std::string const& myPrivateKey, ::std::string const& peerPublicKey) = 0;
72 // NOLINTEND
73};
74
75} // namespace Crypto::Asymmetric
Definition ISystemInterface.h:20
Definition EcPublicKeyComponents.h:7
Definition RsaPublicKeyComponents.h:7