-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathaddon.cc
More file actions
32 lines (26 loc) · 1.12 KB
/
addon.cc
File metadata and controls
32 lines (26 loc) · 1.12 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
#include <cstdlib>
#include <cstdio>
#include <addon.h>
#include <x509.h>
using namespace v8;
void init(Local<Object> exports) {
Nan::Set(exports,
Nan::New<String>("version").ToLocalChecked(),
Nan::New<String>(VERSION).ToLocalChecked());
Nan::Set(exports,
Nan::New<String>("verify").ToLocalChecked(),
Nan::New<FunctionTemplate>(verify)->GetFunction(Nan::GetCurrentContext()).ToLocalChecked());
Nan::Set(exports,
Nan::New<String>("getAltNames").ToLocalChecked(),
Nan::New<FunctionTemplate>(get_altnames)->GetFunction(Nan::GetCurrentContext()).ToLocalChecked());
Nan::Set(exports,
Nan::New<String>("getSubject").ToLocalChecked(),
Nan::New<FunctionTemplate>(get_subject)->GetFunction(Nan::GetCurrentContext()).ToLocalChecked());
Nan::Set(exports,
Nan::New<String>("getIssuer").ToLocalChecked(),
Nan::New<FunctionTemplate>(get_issuer)->GetFunction(Nan::GetCurrentContext()).ToLocalChecked());
Nan::Set(exports,
Nan::New<String>("parseCert").ToLocalChecked(),
Nan::New<FunctionTemplate>(parse_cert)->GetFunction(Nan::GetCurrentContext()).ToLocalChecked());
}
NODE_MODULE(x509, init)