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/json/Value.h"
8
9// auto generated forward declare list
10// clang-format off
14// clang-format on
15
16class WebToken {
17public:
18 // member variables
19 // NOLINTBEGIN
20 ::std::string mHeader;
21 ::Json::Value mHeaderInfo;
22 ::std::string mData;
23 ::Json::Value mDataInfo;
24 ::std::string mSignature;
25 // NOLINTEND
26
27public:
28 // prevent constructor by default
29 WebToken& operator=(WebToken const&) = default;
30 WebToken() = default;
31
32public:
33 // member functions
34 // NOLINTBEGIN
35#ifdef LL_PLAT_C
36 MCAPI WebToken(::WebToken&&);
37#endif
38
39 MCAPI WebToken(::WebToken const&);
40
41 MCAPI explicit WebToken(::std::string token);
42
43 MCAPI void _parse(::Json::Value& value, ::std::string const& data);
44
45 MCAPI ::std::string _signatureToDER() const;
46
47 MCAPI ::std::string getKeyId() const;
48
49#ifdef LL_PLAT_C
50 MCAPI ::std::string getSignerPublicKey() const;
51
52 MCAPI ::WebToken& operator=(::WebToken&&);
53#endif
54
55 MCAPI ::std::string toString() const;
56
57 MCAPI bool verifyWithExternalKey(::std::string const& publicKey) const;
58
59 MCAPI bool verifyWithIncludedKey(::std::vector<::std::string> const& trustedKeys) const;
60
61 MCAPI ~WebToken();
62 // NOLINTEND
63
64public:
65 // static functions
66 // NOLINTBEGIN
67 MCAPI static ::std::string _DERToBinary(::std::string const& derSignature, int outputLength);
68
69 MCAPI static ::std::unique_ptr<::WebToken> createFromData(
70 ::Json::Value const& dataInfo,
71 ::PrivateKeyManager const& manager,
72 ::std::variant<::PublicKeySignatureType, ::CertificateSNIType> signatureType,
73 ::Json::Value const& additionalHeaderClaims
74 );
75 // NOLINTEND
76
77public:
78 // constructor thunks
79 // NOLINTBEGIN
80#ifdef LL_PLAT_C
81 MCAPI void* $ctor(::WebToken&&);
82#endif
83
84 MCAPI void* $ctor(::WebToken const&);
85
86 MCAPI void* $ctor(::std::string token);
87 // NOLINTEND
88
89public:
90 // destructor thunk
91 // NOLINTBEGIN
92 MCAPI void $dtor();
93 // NOLINTEND
94};
Definition Value.h:16
Definition PrivateKeyManager.h:9
Definition CertificateSNIType.h:5
Definition PublicKeySignatureType.h:5