-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathaddon.cc
More file actions
26 lines (20 loc) · 981 Bytes
/
addon.cc
File metadata and controls
26 lines (20 loc) · 981 Bytes
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
#include <cstdio>
#include <cstdlib>
#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::Set(exports, Nan::New<String>("getAltNames").ToLocalChecked(),
Nan::New<FunctionTemplate>(get_altnames)->GetFunction());
Nan::Set(exports, Nan::New<String>("getSubject").ToLocalChecked(),
Nan::New<FunctionTemplate>(get_subject)->GetFunction());
Nan::Set(exports, Nan::New<String>("getIssuer").ToLocalChecked(),
Nan::New<FunctionTemplate>(get_issuer)->GetFunction());
Nan::Set(exports, Nan::New<String>("parseCert").ToLocalChecked(),
Nan::New<FunctionTemplate>(parse_cert)->GetFunction());
}
NODE_MODULE(x509, init)