LeviLamina
Loading...
Searching...
No Matches
WebToken.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/json/Value.h"
5
6// auto generated inclusion list
7#include "mc/deps/crypto/asymmetric/system/System.h"
8#include "mc/deps/json/Value.h"
9
10// auto generated forward declare list
11// clang-format off
15// clang-format on
16
17class WebToken {
18public:
19 // member variables
20 // NOLINTBEGIN
21 ::std::string mHeader;
22 ::Json::Value mHeaderInfo;
23 ::std::string mData;
24 ::Json::Value mDataInfo;
25 ::std::string mSignature;
26 // NOLINTEND
27
28public:
29 WebToken() = default;
30
31public:
32 // member functions
33 // NOLINTBEGIN
34 MCAPI WebToken(::WebToken const&);
35
36 MCAPI ::std::string getKeyId() const;
37
38#ifdef LL_PLAT_C
39 MCAPI ::std::string getSignerPublicKey() const;
40#endif
41
42 MCAPI ::WebToken& operator=(::WebToken&&);
43
44 MCAPI ::WebToken& operator=(::WebToken const&);
45
46 MCAPI bool verifyWithExternalKey(
47 ::std::string const& publicKey,
48 ::std::optional<::Crypto::Asymmetric::System> expectedSystem
49 ) const;
50
51 MCAPI bool verifyWithIncludedKey(::std::vector<::std::string> const& trustedKeys) const;
52
53 MCAPI ~WebToken();
54 // NOLINTEND
55
56public:
57 // static functions
58 // NOLINTBEGIN
59 MCAPI static ::std::optional<::WebToken>
60 createFromData(::Json::Value const& dataInfo, ::PrivateKeyManager const& manager);
61
62#ifdef LL_PLAT_C
63 MCAPI static ::std::optional<::WebToken> createFromData(
64 ::Json::Value const& dataInfo,
65 ::PrivateKeyManager const& manager,
66 ::Json::Value const& extraHeaders
67 );
68#endif
69
70 MCAPI static ::std::optional<::WebToken> createFromData(
71 ::Json::Value const& dataInfo,
72 ::PrivateKeyManager const& manager,
73 ::Json::Value const& extraHeaders,
74 ::std::variant<::PublicKeySignatureType, ::CertificateSNIType> const& signatureType
75 );
76
77 MCAPI static ::std::optional<::WebToken> parse(::std::string_view token, uint64 maxLength);
78 // NOLINTEND
79
80public:
81 // constructor thunks
82 // NOLINTBEGIN
83 MCAPI void* $ctor(::WebToken const&);
84 // NOLINTEND
85
86public:
87 // destructor thunk
88 // NOLINTBEGIN
89 MCAPI void $dtor();
90 // NOLINTEND
91};
Definition Value.h:16
Definition PrivateKeyManager.h:9
Definition CertificateSNIType.h:5
Definition PublicKeySignatureType.h:5