-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Expand file tree
/
Copy pathJSVerify.h
More file actions
87 lines (65 loc) · 2.8 KB
/
Copy pathJSVerify.h
File metadata and controls
87 lines (65 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#include "root.h"
#include "JSBuffer.h"
#include "helpers.h"
#include "ncrypto.h"
#include <JavaScriptCore/LazyProperty.h>
#include <JavaScriptCore/LazyPropertyInlines.h>
namespace Bun {
class JSVerify;
class JSVerifyPrototype;
class JSVerifyConstructor;
// Function to handle JWK format keys
std::optional<ncrypto::EVPKeyPointer> getKeyObjectHandleFromJwk(JSC::JSGlobalObject* lexicalGlobalObject, JSC::ThrowScope& scope, JSC::JSValue key, bool isPublic);
class JSVerify final : public JSC::JSDestructibleObject {
public:
using Base = JSC::JSDestructibleObject;
static constexpr unsigned StructureFlags = Base::StructureFlags;
static JSVerify* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject);
static void destroy(JSC::JSCell* cell);
~JSVerify();
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype);
template<typename CellType, JSC::SubspaceAccess mode>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm);
DECLARE_INFO;
DECLARE_VISIT_CHILDREN;
ncrypto::EVPMDCtxPointer m_mdCtx;
size_t m_sizeForGC { 0 };
private:
JSVerify(JSC::VM& vm, JSC::Structure* structure);
void finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject);
};
class JSVerifyPrototype final : public JSC::JSNonFinalObject {
public:
using Base = JSC::JSNonFinalObject;
static constexpr unsigned StructureFlags = Base::StructureFlags;
static JSVerifyPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype);
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
return &vm.plainObjectSpace();
}
DECLARE_INFO;
private:
JSVerifyPrototype(JSC::VM& vm, JSC::Structure* structure);
void finishCreation(JSC::VM& vm);
};
class JSVerifyConstructor final : public JSC::InternalFunction {
public:
using Base = JSC::InternalFunction;
static constexpr unsigned StructureFlags = Base::StructureFlags;
static JSVerifyConstructor* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSObject* prototype);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype);
template<typename CellType, JSC::SubspaceAccess>
static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
{
return &vm.internalFunctionSpace();
}
DECLARE_INFO;
private:
JSVerifyConstructor(JSC::VM& vm, JSC::Structure* structure);
void finishCreation(JSC::VM& vm, JSC::JSObject* prototype);
};
void setupJSVerifyClassStructure(JSC::LazyClassStructure::Initializer& init);
} // namespace Bun