-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathzcrypto.h
More file actions
55 lines (45 loc) · 2.12 KB
/
zcrypto.h
File metadata and controls
55 lines (45 loc) · 2.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Licensed Materials - Property of IBM
* (C) Copyright IBM Corp. 2022. All Rights Reserved.
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
#ifndef __ZCRYPTO_H_
#define __ZCRYPTO_H_ 1
#include <gskcms.h>
#include <gskssl.h>
#include <napi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
extern "C" int createKDB_impl( const char* filename, const char* password, int length, int expiration, gsk_handle* handle);
extern "C" int importKey_impl(const char* filename, const char* password, const char* label, gsk_handle* handle);
extern "C" int exportKeyToFile_impl(const char* filename, const char* password, const char* label, gsk_handle* handle);
extern "C" int exportKeyToBuffer_impl(const char* password, const char* label, gsk_buffer* stream, gsk_handle* handle);
extern "C" int exportCertToBuffer_impl(const char* label, gsk_buffer* stream, gsk_handle* handle);
extern "C" int openKDB_impl( const char* filename, const char* password, gsk_handle* handle);
extern "C" int closeKDB_impl( gsk_handle* handle);
extern "C" int openKeyRing_impl( const char* ring_name, gsk_handle* handle);
extern "C" char* errorString_impl( int err, char *errstr, int errstrlen );
class ZCrypto : public Napi::ObjectWrap<ZCrypto> {
public:
static Napi::Object Init(Napi::Env env, Napi::Object exports);
ZCrypto(const Napi::CallbackInfo& info);
~ZCrypto();
private:
static Napi::FunctionReference constructor;
Napi::Value OpenKeyRing(const Napi::CallbackInfo &info);
Napi::Value OpenKDB(const Napi::CallbackInfo &info);
Napi::Value CloseKDB(const Napi::CallbackInfo &info);
Napi::Value CreateKDB(const Napi::CallbackInfo &info);
Napi::Value ImportKey(const Napi::CallbackInfo &info);
Napi::Value GetErrorString(const Napi::CallbackInfo &info);
Napi::Value ExportKeyToFile(const Napi::CallbackInfo &info);
Napi::Value ExportKeyToBuffer(const Napi::CallbackInfo &info);
Napi::Value ExportCertToBuffer(const Napi::CallbackInfo &info);
bool initialized;
gsk_handle handle;
};
#if !defined(__MVS__)
#error This addon is for zos only
#endif
#endif