-
Notifications
You must be signed in to change notification settings - Fork 2
/
const.js
179 lines (177 loc) · 8.53 KB
/
const.js
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
var CKR = Array();
CKR[0x00000000] = "OK";
CKR[-0x00000001] = "CANCEL";
CKR[-0x00000002] = "HOST_MEMORY";
CKR[-0x00000003] = "SLOT_ID_INVALID";
CKR[-0x00000005] = "GENERAL_ERROR";
CKR[-0x00000006] = "FUNCTION_FAILED";
CKR[-0x00000007] = "ARGUMENTS_BAD";
CKR[-0x00000008] = "NO_EVENT";
CKR[-0x00000009] = "NEED_TO_CREATE_THREADS";
CKR[-0x0000000A] = "CANT_LOCK"
CKR[-0x00000010] = "ATTRIBUTE_READ_ONLY";
CKR[-0x00000011] = "ATTRIBUTE_SENSITIVE";
CKR[-0x00000012] = "ATTRIBUTE_TYPE_INVALID";
CKR[-0x00000013] = "ATTRIBUTE_VALUE_INVALID";
CKR[-0x00000020] = "DATA_INVALID";
CKR[-0x00000021] = "DATA_LEN_RANGE";
CKR[-0x00000030] = "DEVICE_ERROR";
CKR[-0x00000031] = "DEVICE_MEMORY";
CKR[-0x00000032] = "DEVICE_REMOVED";
CKR[-0x00000040] = "ENCRYPTED_DATA_INVALID";
CKR[-0x00000041] = "ENCRYPTED_DATA_LEN_RANGE";
CKR[-0x00000050] = "FUNCTION_CANCELED";
CKR[-0x00000051] = "FUNCTION_NOT_PARALLEL";
CKR[-0x00000054] = "FUNCTION_NOT_SUPPORTED";
CKR[-0x00000060] = "KEY_HANDLE_INVALID";
CKR[-0x00000062] = "KEY_SIZE_RANGE";
CKR[-0x00000063] = "KEY_TYPE_INCONSISTENT";
CKR[-0x00000064] = "KEY_NOT_NEEDED";
CKR[-0x00000065] = "KEY_CHANGED";
CKR[-0x00000066] = "KEY_NEEDED";
CKR[-0x00000067] = "KEY_INDIGESTIBLE";
CKR[-0x00000068] = "KEY_FUNCTION_NOT_PERMITTED";
CKR[-0x00000069] = "KEY_NOT_WRAPPABLE";
CKR[-0x0000006A] = "KEY_UNEXTRACTABLE";
CKR[-0x00000070] = "MECHANISM_INVALID";
CKR[-0x00000071] = "MECHANISM_PARAM_INVALID";
CKR[-0x00000082] = "OBJECT_HANDLE_INVALID";
CKR[-0x00000090] = "OPERATION_ACTIVE";
CKR[-0x00000091] = "OPERATION_NOT_INITIALIZED";
CKR[-0x000000A0] = "PIN_INCORRECT";
CKR[-0x000000A1] = "PIN_INVALID";
CKR[-0x000000A2] = "PIN_LEN_RANGE";
CKR[-0x000000A3] = "PIN_EXPIRED";
CKR[-0x000000A4] = "PIN_LOCKED";
CKR[-0x000000B0] = "SESSION_CLOSED";
CKR[-0x000000B1] = "SESSION_COUNT";
CKR[-0x000000B3] = "SESSION_HANDLE_INVALID";
CKR[-0x000000B4] = "SESSION_PARALLEL_NOT_SUPPORTED";
CKR[-0x000000B5] = "SESSION_READ_ONLY";
CKR[-0x000000B6] = "SESSION_EXISTS";
CKR[-0x000000B7] = "SESSION_READ_ONLY_EXISTS";
CKR[-0x000000B8] = "SESSION_READ_WRITE_SO_EXISTS";
CKR[-0x000000C0] = "SIGNATURE_INVALID";
CKR[-0x000000C1] = "SIGNATURE_LEN_RANGE";
CKR[-0x000000D0] = "TEMPLATE_INCOMPLETE";
CKR[-0x000000D1] = "TEMPLATE_INCONSISTENT";
CKR[-0x000000E0] = "TOKEN_NOT_PRESENT";
CKR[-0x000000E1] = "TOKEN_NOT_RECOGNIZED";
CKR[-0x000000E2] = "TOKEN_WRITE_PROTECTED";
CKR[-0x000000F0] = "UNWRAPPING_KEY_HANDLE_INVALID";
CKR[-0x000000F1] = "UNWRAPPING_KEY_SIZE_RANGE";
CKR[-0x000000F2] = "UNWRAPPING_KEY_TYPE_INCONSISTENT";
CKR[-0x00000100] = "USER_ALREADY_LOGGED_IN";
CKR[-0x00000101] = "USER_NOT_LOGGED_IN";
CKR[-0x00000102] = "USER_PIN_NOT_INITIALIZED";
CKR[-0x00000103] = "USER_TYPE_INVALID";
CKR[-0x00000104] = "USER_ANOTHER_ALREADY_LOGGED_IN";
CKR[-0x00000105] = "USER_TOO_MANY_TYPES";
CKR[-0x00000110] = "WRAPPED_KEY_INVALID";
CKR[-0x00000112] = "WRAPPED_KEY_LEN_RANGE";
CKR[-0x00000113] = "WRAPPING_KEY_HANDLE_INVALID";
CKR[-0x00000114] = "WRAPPING_KEY_SIZE_RANGE";
CKR[-0x00000115] = "WRAPPING_KEY_TYPE_INCONSISTENT";
CKR[-0x00000120] = "RANDOM_SEED_NOT_SUPPORTED";
CKR[-0x00000121] = "RANDOM_NO_RNG";
CKR[-0x00000130] = "DOMAIN_PARAMS_INVALID";
CKR[-0x00000150] = "BUFFER_TOO_SMALL";
CKR[-0x00000160] = "SAVED_STATE_INVALID";
CKR[-0x00000170] = "INFORMATION_SENSITIVE";
CKR[-0x00000180] = "STATE_UNSAVEABLE";
CKR[-0x00000190] = "CRYPTOKI_NOT_INITIALIZED";
CKR[-0x00000191] = "CRYPTOKI_ALREADY_INITIALIZED";
CKR[-0x000001A0] = "MUTEX_BAD";
CKR[-0x000001A1] = "MUTEX_NOT_LOCKED";
CKR[-0x000001B0] = "NEW_PIN_MODE";
CKR[-0x000001B1] = "NEXT_OTP";
CKR[-0x00000200] = "FUNCTION_REJECTED";
CKR[-0x80000000] = "VENDOR_DEFINED";
const CKR_OK = 0x00000000
const CKR_CANCEL = -0x00000001
const CKR_HOST_MEMORY = -0x00000002
const CKR_SLOT_ID_INVALID = -0x00000003
const CKR_GENERAL_ERROR = -0x00000005
const CKR_FUNCTION_FAILED = -0x00000006
const CKR_ARGUMENTS_BAD = -0x00000007
const CKR_NO_EVENT = -0x00000008
const CKR_NEED_TO_CREATE_THREADS = -0x00000009
const CKR_CANT_LOCK = -0x0000000A
const CKR_ATTRIBUTE_READ_ONLY = -0x00000010
const CKR_ATTRIBUTE_SENSITIVE = -0x00000011
const CKR_ATTRIBUTE_TYPE_INVALID = -0x00000012
const CKR_ATTRIBUTE_VALUE_INVALID = -0x00000013
const CKR_DATA_INVALID = -0x00000020
const CKR_DATA_LEN_RANGE = -0x00000021
const CKR_DEVICE_ERROR = -0x00000030
const CKR_DEVICE_MEMORY = -0x00000031
const CKR_DEVICE_REMOVED = -0x00000032
const CKR_ENCRYPTED_DATA_INVALID = -0x00000040
const CKR_ENCRYPTED_DATA_LEN_RANGE = -0x00000041
const CKR_FUNCTION_CANCELED = -0x00000050
const CKR_FUNCTION_NOT_PARALLEL = -0x00000051
const CKR_FUNCTION_NOT_SUPPORTED = -0x00000054
const CKR_KEY_HANDLE_INVALID = -0x00000060
const CKR_KEY_SIZE_RANGE = -0x00000062
const CKR_KEY_TYPE_INCONSISTENT = -0x00000063
const CKR_KEY_NOT_NEEDED = -0x00000064
const CKR_KEY_CHANGED = -0x00000065
const CKR_KEY_NEEDED = -0x00000066
const CKR_KEY_INDIGESTIBLE = -0x00000067
const CKR_KEY_FUNCTION_NOT_PERMITTED = -0x00000068
const CKR_KEY_NOT_WRAPPABLE = -0x00000069
const CKR_KEY_UNEXTRACTABLE = -0x0000006A
const CKR_MECHANISM_INVALID = -0x00000070
const CKR_MECHANISM_PARAM_INVALID = -0x00000071
const CKR_OBJECT_HANDLE_INVALID = -0x00000082
const CKR_OPERATION_ACTIVE = -0x00000090
const CKR_OPERATION_NOT_INITIALIZED = -0x00000091
const CKR_PIN_INCORRECT = -0x000000A0
const CKR_PIN_INVALID = -0x000000A1
const CKR_PIN_LEN_RANGE = -0x000000A2
const CKR_PIN_EXPIRED = -0x000000A3
const CKR_PIN_LOCKED = -0x000000A4
const CKR_SESSION_CLOSED = -0x000000B0
const CKR_SESSION_COUNT = -0x000000B1
const CKR_SESSION_HANDLE_INVALID = -0x000000B3
const CKR_SESSION_PARALLEL_NOT_SUPPORTED = -0x000000B4
const CKR_SESSION_READ_ONLY = -0x000000B5
const CKR_SESSION_EXISTS = -0x000000B6
const CKR_SESSION_READ_ONLY_EXISTS = -0x000000B7
const CKR_SESSION_READ_WRITE_SO_EXISTS = -0x000000B8
const CKR_SIGNATURE_INVALID = -0x000000C0
const CKR_SIGNATURE_LEN_RANGE = -0x000000C1
const CKR_TEMPLATE_INCOMPLETE = -0x000000D0
const CKR_TEMPLATE_INCONSISTENT = -0x000000D1
const CKR_TOKEN_NOT_PRESENT = -0x000000E0
const CKR_TOKEN_NOT_RECOGNIZED = -0x000000E1
const CKR_TOKEN_WRITE_PROTECTED = -0x000000E2
const CKR_UNWRAPPING_KEY_HANDLE_INVALID = -0x000000F0
const CKR_UNWRAPPING_KEY_SIZE_RANGE = -0x000000F1
const CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT = -0x000000F2
const CKR_USER_ALREADY_LOGGED_IN = -0x00000100
const CKR_USER_NOT_LOGGED_IN = -0x00000101
const CKR_USER_PIN_NOT_INITIALIZED = -0x00000102
const CKR_USER_TYPE_INVALID = -0x00000103
const CKR_USER_ANOTHER_ALREADY_LOGGED_IN = -0x00000104
const CKR_USER_TOO_MANY_TYPES = -0x00000105
const CKR_WRAPPED_KEY_INVALID = -0x00000110
const CKR_WRAPPED_KEY_LEN_RANGE = -0x00000112
const CKR_WRAPPING_KEY_HANDLE_INVALID = -0x00000113
const CKR_WRAPPING_KEY_SIZE_RANGE = -0x00000114
const CKR_WRAPPING_KEY_TYPE_INCONSISTENT = -0x00000115
const CKR_RANDOM_SEED_NOT_SUPPORTED = -0x00000120
const CKR_RANDOM_NO_RNG = -0x00000121
const CKR_DOMAIN_PARAMS_INVALID = -0x00000130
const CKR_BUFFER_TOO_SMALL = -0x00000150
const CKR_SAVED_STATE_INVALID = -0x00000160
const CKR_INFORMATION_SENSITIVE = -0x00000170
const CKR_STATE_UNSAVEABLE = -0x00000180
const CKR_CRYPTOKI_NOT_INITIALIZED = -0x00000190
const CKR_CRYPTOKI_ALREADY_INITIALIZED = -0x00000191
const CKR_MUTEX_BAD = -0x000001A0
const CKR_MUTEX_NOT_LOCKED = -0x000001A1
const CKR_NEW_PIN_MODE = -0x000001B0
const CKR_NEXT_OTP = -0x000001B1
const CKR_FUNCTION_REJECTED = -0x00000200
const CKR_VENDOR_DEFINED = -0x80000000