pkcs11 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +2 -0
- data/History.txt +23 -0
- data/Manifest.txt +6 -0
- data/README.rdoc +28 -15
- data/Rakefile +51 -2
- data/ext/extconf.rb +1 -0
- data/ext/generate_structs.rb +157 -0
- data/ext/generate_thread_funcs.rb +72 -0
- data/ext/pk11.c +482 -252
- data/ext/pk11.h +4 -1
- data/ext/pk11_const.c +25 -476
- data/ext/pk11_const_def.inc +452 -0
- data/ext/pk11_struct_def.inc +304 -0
- data/ext/pk11_struct_impl.inc +304 -0
- data/ext/pk11_thread_funcs.c +411 -0
- data/ext/pk11_thread_funcs.h +482 -0
- data/lib/pkcs11.rb +5 -8
- data/lib/pkcs11/extensions.rb +17 -109
- data/lib/pkcs11/helper.rb +151 -0
- data/lib/pkcs11/library.rb +44 -13
- data/lib/pkcs11/object.rb +73 -17
- data/lib/pkcs11/session.rb +318 -121
- data/lib/pkcs11/slot.rb +30 -9
- data/test/helper.rb +13 -6
- data/test/test_pkcs11.rb +13 -2
- data/test/test_pkcs11_crypt.rb +38 -3
- data/test/test_pkcs11_object.rb +18 -4
- data/test/test_pkcs11_session.rb +28 -2
- data/test/test_pkcs11_slot.rb +9 -6
- data/test/test_pkcs11_structs.rb +134 -0
- data/test/test_pkcs11_thread.rb +45 -0
- metadata +40 -7
data/ext/pk11.h
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
#endif
|
25
25
|
|
26
26
|
void Init_pkcs11_ext();
|
27
|
-
void Init_pkcs11_const(VALUE);
|
27
|
+
void Init_pkcs11_const(VALUE, VALUE);
|
28
28
|
|
29
29
|
#ifdef compile_for_windows
|
30
30
|
#pragma pack(push, cryptoki, 1)
|
@@ -75,4 +75,7 @@ returnType (CK_CALL_SPEC CK_PTR name)
|
|
75
75
|
#include "otp-pkcs11.h" /* for PKCS #11 v2.20 Amendment 1 */
|
76
76
|
#include "ct-kip.h" /* for PKCS #11 v2.20 Amendment 2 */
|
77
77
|
#include "pkcs-11v2-20a3.h" /* for PKCS #11 v2.20 Amendment 3 */
|
78
|
+
|
79
|
+
#include "pk11_thread_funcs.h"
|
80
|
+
|
78
81
|
#endif
|
data/ext/pk11_const.c
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
#define PKCS11_DEFINE_CONST_GROUP(group, name, value) \
|
7
7
|
do { \
|
8
8
|
VALUE rvalue = ULONG2NUM(value); \
|
9
|
+
rb_define_const(cPKCS11, name, rvalue); \
|
9
10
|
VALUE str = rb_obj_freeze(rb_str_new2(name)); \
|
10
11
|
VALUE old = rb_hash_aref(group, rvalue); \
|
11
12
|
if (!NIL_P(old)) rb_warning("%s is equal to %s", RSTRING_PTR(old), name); \
|
12
13
|
rb_hash_aset(group, rvalue, str); \
|
13
|
-
rb_define_const(cPKCS11, name, rvalue); \
|
14
14
|
} while(0)
|
15
15
|
|
16
16
|
#define PKCS11_DEFINE_OBJECT_CLASS(constant) \
|
@@ -20,7 +20,13 @@
|
|
20
20
|
#define PKCS11_DEFINE_MECHANISM(constant) \
|
21
21
|
PKCS11_DEFINE_CONST_GROUP(vMECHANISMS, #constant, constant)
|
22
22
|
#define PKCS11_DEFINE_RETURN_VALUE(constant) \
|
23
|
-
|
23
|
+
do { \
|
24
|
+
VALUE eError = rb_define_class_under(cPKCS11, #constant, ePKCS11Error); \
|
25
|
+
VALUE rvalue = ULONG2NUM(constant); \
|
26
|
+
VALUE old = rb_hash_aref(vRETURN_VALUES, rvalue); \
|
27
|
+
if (!NIL_P(old)) rb_warning("%s is equal to %s", RSTRING_PTR(old), #constant); \
|
28
|
+
rb_hash_aset(vRETURN_VALUES, rvalue, eError); \
|
29
|
+
} while(0)
|
24
30
|
|
25
31
|
static VALUE vOBJECT_CLASSES;
|
26
32
|
static VALUE vATTRIBUTES;
|
@@ -28,22 +34,20 @@ static VALUE vMECHANISMS;
|
|
28
34
|
static VALUE vRETURN_VALUES;
|
29
35
|
|
30
36
|
VALUE
|
31
|
-
|
37
|
+
pkcs11_return_value_to_class(CK_RV rv, VALUE ePKCS11Error)
|
32
38
|
{
|
33
|
-
VALUE
|
34
|
-
|
35
|
-
|
36
|
-
if (NIL_P(
|
37
|
-
|
38
|
-
snprintf(buf, sizeof(buf), "0x%08x", (unsigned int)rv);
|
39
|
-
name = rb_obj_freeze(rb_str_new2(buf));
|
39
|
+
VALUE class;
|
40
|
+
|
41
|
+
class = rb_hash_aref(vRETURN_VALUES, INT2NUM(rv));
|
42
|
+
if (NIL_P(class)){
|
43
|
+
class = ePKCS11Error;
|
40
44
|
}
|
41
45
|
|
42
|
-
return
|
46
|
+
return class;
|
43
47
|
}
|
44
48
|
|
45
49
|
void
|
46
|
-
Init_pkcs11_const(VALUE cPKCS11)
|
50
|
+
Init_pkcs11_const(VALUE cPKCS11, VALUE ePKCS11Error)
|
47
51
|
{
|
48
52
|
PKCS11_DEFINE_CONST(CRYPTOKI_VERSION_MAJOR);
|
49
53
|
PKCS11_DEFINE_CONST(CRYPTOKI_VERSION_MINOR);
|
@@ -191,475 +195,20 @@ Init_pkcs11_const(VALUE cPKCS11)
|
|
191
195
|
PKCS11_DEFINE_CONST(CKZ_SALT_SPECIFIED);
|
192
196
|
|
193
197
|
vOBJECT_CLASSES = rb_hash_new();
|
194
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_DATA);
|
195
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_CERTIFICATE);
|
196
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_PUBLIC_KEY);
|
197
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_PRIVATE_KEY);
|
198
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_SECRET_KEY);
|
199
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_HW_FEATURE);
|
200
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_DOMAIN_PARAMETERS);
|
201
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_MECHANISM);
|
202
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_OTP_KEY);
|
203
|
-
PKCS11_DEFINE_OBJECT_CLASS(CKO_VENDOR_DEFINED);
|
204
|
-
rb_obj_freeze(vOBJECT_CLASSES);
|
205
|
-
rb_define_const(cPKCS11, "OBJECT_CLASSES", vOBJECT_CLASSES);
|
206
|
-
|
207
198
|
vATTRIBUTES = rb_hash_new();
|
208
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CLASS);
|
209
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_TOKEN);
|
210
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PRIVATE);
|
211
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_LABEL);
|
212
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_APPLICATION);
|
213
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_VALUE);
|
214
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OBJECT_ID);
|
215
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CERTIFICATE_TYPE);
|
216
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ISSUER);
|
217
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SERIAL_NUMBER);
|
218
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_AC_ISSUER);
|
219
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OWNER);
|
220
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ATTR_TYPES);
|
221
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_TRUSTED);
|
222
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_KEY_TYPE);
|
223
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SUBJECT);
|
224
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ID);
|
225
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SENSITIVE);
|
226
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ENCRYPT);
|
227
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_DECRYPT);
|
228
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_WRAP);
|
229
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_UNWRAP);
|
230
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SIGN);
|
231
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SIGN_RECOVER);
|
232
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_VERIFY);
|
233
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_VERIFY_RECOVER);
|
234
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_DERIVE);
|
235
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_START_DATE);
|
236
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_END_DATE);
|
237
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_MODULUS);
|
238
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_MODULUS_BITS);
|
239
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PUBLIC_EXPONENT);
|
240
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PRIVATE_EXPONENT);
|
241
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PRIME_1);
|
242
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PRIME_2);
|
243
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_EXPONENT_1);
|
244
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_EXPONENT_2);
|
245
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_COEFFICIENT);
|
246
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PRIME);
|
247
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SUBPRIME);
|
248
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_BASE);
|
249
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PRIME_BITS);
|
250
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SUBPRIME_BITS);
|
251
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SUB_PRIME_BITS);
|
252
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_VALUE_BITS);
|
253
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_VALUE_LEN);
|
254
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_EXTRACTABLE);
|
255
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_LOCAL);
|
256
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_NEVER_EXTRACTABLE);
|
257
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ALWAYS_SENSITIVE);
|
258
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_KEY_GEN_MECHANISM);
|
259
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_MODIFIABLE);
|
260
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ECDSA_PARAMS);
|
261
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_EC_PARAMS);
|
262
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_EC_POINT);
|
263
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SECONDARY_AUTH);
|
264
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_AUTH_PIN_FLAGS);
|
265
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_HW_FEATURE_TYPE);
|
266
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_RESET_ON_INIT);
|
267
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_HAS_RESET);
|
268
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_VENDOR_DEFINED);
|
269
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ALLOWED_MECHANISMS);
|
270
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ALWAYS_AUTHENTICATE);
|
271
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_BITS_PER_PIXEL);
|
272
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CERTIFICATE_CATEGORY);
|
273
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CHAR_COLUMNS);
|
274
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CHAR_ROWS);
|
275
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CHAR_SETS);
|
276
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_CHECK_VALUE);
|
277
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_COLOR);
|
278
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_DEFAULT_CMS_ATTRIBUTES);
|
279
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_ENCODING_METHODS);
|
280
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_HASH_OF_ISSUER_PUBLIC_KEY);
|
281
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_HASH_OF_SUBJECT_PUBLIC_KEY);
|
282
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_JAVA_MIDP_SECURITY_DOMAIN);
|
283
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_MECHANISM_TYPE);
|
284
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_MIME_TYPES);
|
285
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_CHALLENGE_REQUIREMENT);
|
286
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_COUNTER);
|
287
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_COUNTER_REQUIREMENT);
|
288
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_FORMAT);
|
289
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_LENGTH);
|
290
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_PIN_REQUIREMENT);
|
291
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_SERVICE_IDENTIFIER);
|
292
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_SERVICE_LOGO);
|
293
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_SERVICE_LOGO_TYPE);
|
294
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_TIME);
|
295
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_TIME_INTERVAL);
|
296
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_TIME_REQUIREMENT);
|
297
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_USER_FRIENDLY_MODE);
|
298
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_OTP_USER_IDENTIFIER);
|
299
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PIXEL_X);
|
300
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_PIXEL_Y);
|
301
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_REQUIRED_CMS_ATTRIBUTES);
|
302
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_RESOLUTION);
|
303
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_SUPPORTED_CMS_ATTRIBUTES);
|
304
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_UNWRAP_TEMPLATE);
|
305
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_URL);
|
306
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_WRAP_TEMPLATE);
|
307
|
-
PKCS11_DEFINE_ATTRIBUTE(CKA_WRAP_WITH_TRUSTED);
|
308
|
-
rb_obj_freeze(vATTRIBUTES);
|
309
|
-
rb_define_const(cPKCS11, "ATTRIBUTES", vATTRIBUTES);
|
310
|
-
|
311
199
|
vMECHANISMS = rb_hash_new();
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
PKCS11_DEFINE_MECHANISM(CKM_RSA_X_509);
|
316
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD2_RSA_PKCS);
|
317
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD5_RSA_PKCS);
|
318
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA1_RSA_PKCS);
|
319
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD128_RSA_PKCS);
|
320
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD160_RSA_PKCS);
|
321
|
-
PKCS11_DEFINE_MECHANISM(CKM_RSA_PKCS_OAEP);
|
322
|
-
PKCS11_DEFINE_MECHANISM(CKM_RSA_X9_31_KEY_PAIR_GEN);
|
323
|
-
PKCS11_DEFINE_MECHANISM(CKM_RSA_X9_31);
|
324
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA1_RSA_X9_31);
|
325
|
-
PKCS11_DEFINE_MECHANISM(CKM_RSA_PKCS_PSS);
|
326
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA1_RSA_PKCS_PSS);
|
327
|
-
PKCS11_DEFINE_MECHANISM(CKM_DSA_KEY_PAIR_GEN);
|
328
|
-
PKCS11_DEFINE_MECHANISM(CKM_DSA);
|
329
|
-
PKCS11_DEFINE_MECHANISM(CKM_DSA_SHA1);
|
330
|
-
PKCS11_DEFINE_MECHANISM(CKM_DH_PKCS_KEY_PAIR_GEN);
|
331
|
-
PKCS11_DEFINE_MECHANISM(CKM_DH_PKCS_DERIVE);
|
332
|
-
PKCS11_DEFINE_MECHANISM(CKM_X9_42_DH_KEY_PAIR_GEN);
|
333
|
-
PKCS11_DEFINE_MECHANISM(CKM_X9_42_DH_DERIVE);
|
334
|
-
PKCS11_DEFINE_MECHANISM(CKM_X9_42_DH_HYBRID_DERIVE);
|
335
|
-
PKCS11_DEFINE_MECHANISM(CKM_X9_42_MQV_DERIVE);
|
336
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC2_KEY_GEN);
|
337
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC2_ECB);
|
338
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC2_CBC);
|
339
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC2_MAC);
|
340
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC2_MAC_GENERAL);
|
341
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC2_CBC_PAD);
|
342
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC4_KEY_GEN);
|
343
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC4);
|
344
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_KEY_GEN);
|
345
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_ECB);
|
346
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_CBC);
|
347
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_MAC);
|
348
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_MAC_GENERAL);
|
349
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_CBC_PAD);
|
350
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES2_KEY_GEN);
|
351
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_KEY_GEN);
|
352
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_ECB);
|
353
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_CBC);
|
354
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_MAC);
|
355
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_MAC_GENERAL);
|
356
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_CBC_PAD);
|
357
|
-
PKCS11_DEFINE_MECHANISM(CKM_CDMF_KEY_GEN);
|
358
|
-
PKCS11_DEFINE_MECHANISM(CKM_CDMF_ECB);
|
359
|
-
PKCS11_DEFINE_MECHANISM(CKM_CDMF_CBC);
|
360
|
-
PKCS11_DEFINE_MECHANISM(CKM_CDMF_MAC);
|
361
|
-
PKCS11_DEFINE_MECHANISM(CKM_CDMF_MAC_GENERAL);
|
362
|
-
PKCS11_DEFINE_MECHANISM(CKM_CDMF_CBC_PAD);
|
363
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD2);
|
364
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD2_HMAC);
|
365
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD2_HMAC_GENERAL);
|
366
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD5);
|
367
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD5_HMAC);
|
368
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD5_HMAC_GENERAL);
|
369
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA_1);
|
370
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA_1_HMAC);
|
371
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA_1_HMAC_GENERAL);
|
372
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD128);
|
373
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD128_HMAC);
|
374
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD128_HMAC_GENERAL);
|
375
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD160);
|
376
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD160_HMAC);
|
377
|
-
PKCS11_DEFINE_MECHANISM(CKM_RIPEMD160_HMAC_GENERAL);
|
378
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST_KEY_GEN);
|
379
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST_ECB);
|
380
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST_CBC);
|
381
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST_MAC);
|
382
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST_MAC_GENERAL);
|
383
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST_CBC_PAD);
|
384
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST3_KEY_GEN);
|
385
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST3_ECB);
|
386
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST3_CBC);
|
387
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST3_MAC);
|
388
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST3_MAC_GENERAL);
|
389
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST3_CBC_PAD);
|
390
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST5_KEY_GEN);
|
391
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST128_KEY_GEN);
|
392
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST5_ECB);
|
393
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST128_ECB);
|
394
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST5_CBC);
|
395
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST128_CBC);
|
396
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST5_MAC);
|
397
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST128_MAC);
|
398
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST5_MAC_GENERAL);
|
399
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST128_MAC_GENERAL);
|
400
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST5_CBC_PAD);
|
401
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAST128_CBC_PAD);
|
402
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC5_KEY_GEN);
|
403
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC5_ECB);
|
404
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC5_CBC);
|
405
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC5_MAC);
|
406
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC5_MAC_GENERAL);
|
407
|
-
PKCS11_DEFINE_MECHANISM(CKM_RC5_CBC_PAD);
|
408
|
-
PKCS11_DEFINE_MECHANISM(CKM_IDEA_KEY_GEN);
|
409
|
-
PKCS11_DEFINE_MECHANISM(CKM_IDEA_ECB);
|
410
|
-
PKCS11_DEFINE_MECHANISM(CKM_IDEA_CBC);
|
411
|
-
PKCS11_DEFINE_MECHANISM(CKM_IDEA_MAC);
|
412
|
-
PKCS11_DEFINE_MECHANISM(CKM_IDEA_MAC_GENERAL);
|
413
|
-
PKCS11_DEFINE_MECHANISM(CKM_IDEA_CBC_PAD);
|
414
|
-
PKCS11_DEFINE_MECHANISM(CKM_GENERIC_SECRET_KEY_GEN);
|
415
|
-
PKCS11_DEFINE_MECHANISM(CKM_CONCATENATE_BASE_AND_KEY);
|
416
|
-
PKCS11_DEFINE_MECHANISM(CKM_CONCATENATE_BASE_AND_DATA);
|
417
|
-
PKCS11_DEFINE_MECHANISM(CKM_CONCATENATE_DATA_AND_BASE);
|
418
|
-
PKCS11_DEFINE_MECHANISM(CKM_XOR_BASE_AND_DATA);
|
419
|
-
PKCS11_DEFINE_MECHANISM(CKM_EXTRACT_KEY_FROM_KEY);
|
420
|
-
PKCS11_DEFINE_MECHANISM(CKM_SSL3_PRE_MASTER_KEY_GEN);
|
421
|
-
PKCS11_DEFINE_MECHANISM(CKM_SSL3_MASTER_KEY_DERIVE);
|
422
|
-
PKCS11_DEFINE_MECHANISM(CKM_SSL3_KEY_AND_MAC_DERIVE);
|
423
|
-
PKCS11_DEFINE_MECHANISM(CKM_SSL3_MASTER_KEY_DERIVE_DH);
|
424
|
-
PKCS11_DEFINE_MECHANISM(CKM_TLS_PRE_MASTER_KEY_GEN);
|
425
|
-
PKCS11_DEFINE_MECHANISM(CKM_TLS_MASTER_KEY_DERIVE);
|
426
|
-
PKCS11_DEFINE_MECHANISM(CKM_TLS_KEY_AND_MAC_DERIVE);
|
427
|
-
PKCS11_DEFINE_MECHANISM(CKM_TLS_MASTER_KEY_DERIVE_DH);
|
428
|
-
PKCS11_DEFINE_MECHANISM(CKM_SSL3_MD5_MAC);
|
429
|
-
PKCS11_DEFINE_MECHANISM(CKM_SSL3_SHA1_MAC);
|
430
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD5_KEY_DERIVATION);
|
431
|
-
PKCS11_DEFINE_MECHANISM(CKM_MD2_KEY_DERIVATION);
|
432
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA1_KEY_DERIVATION);
|
433
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_MD2_DES_CBC);
|
434
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_MD5_DES_CBC);
|
435
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_MD5_CAST_CBC);
|
436
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_MD5_CAST3_CBC);
|
437
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_MD5_CAST5_CBC);
|
438
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_MD5_CAST128_CBC);
|
439
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_CAST5_CBC);
|
440
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_CAST128_CBC);
|
441
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_RC4_128);
|
442
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_RC4_40);
|
443
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_DES3_EDE_CBC);
|
444
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_DES2_EDE_CBC);
|
445
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_RC2_128_CBC);
|
446
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBE_SHA1_RC2_40_CBC);
|
447
|
-
PKCS11_DEFINE_MECHANISM(CKM_PKCS5_PBKD2);
|
448
|
-
PKCS11_DEFINE_MECHANISM(CKM_PBA_SHA1_WITH_SHA1_HMAC);
|
449
|
-
PKCS11_DEFINE_MECHANISM(CKM_KEY_WRAP_LYNKS);
|
450
|
-
PKCS11_DEFINE_MECHANISM(CKM_KEY_WRAP_SET_OAEP);
|
451
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_KEY_GEN);
|
452
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_ECB64);
|
453
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_CBC64);
|
454
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_OFB64);
|
455
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_CFB64);
|
456
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_CFB32);
|
457
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_CFB16);
|
458
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_CFB8);
|
459
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_WRAP);
|
460
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_PRIVATE_WRAP);
|
461
|
-
PKCS11_DEFINE_MECHANISM(CKM_SKIPJACK_RELAYX);
|
462
|
-
PKCS11_DEFINE_MECHANISM(CKM_KEA_KEY_PAIR_GEN);
|
463
|
-
PKCS11_DEFINE_MECHANISM(CKM_KEA_KEY_DERIVE);
|
464
|
-
PKCS11_DEFINE_MECHANISM(CKM_FORTEZZA_TIMESTAMP);
|
465
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_KEY_GEN);
|
466
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_ECB128);
|
467
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_ECB96);
|
468
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_CBC128);
|
469
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_COUNTER);
|
470
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_SHUFFLE);
|
471
|
-
PKCS11_DEFINE_MECHANISM(CKM_BATON_WRAP);
|
472
|
-
PKCS11_DEFINE_MECHANISM(CKM_ECDSA_KEY_PAIR_GEN);
|
473
|
-
PKCS11_DEFINE_MECHANISM(CKM_EC_KEY_PAIR_GEN);
|
474
|
-
PKCS11_DEFINE_MECHANISM(CKM_ECDSA);
|
475
|
-
PKCS11_DEFINE_MECHANISM(CKM_ECDSA_SHA1);
|
476
|
-
PKCS11_DEFINE_MECHANISM(CKM_ECDH1_DERIVE);
|
477
|
-
PKCS11_DEFINE_MECHANISM(CKM_ECDH1_COFACTOR_DERIVE);
|
478
|
-
PKCS11_DEFINE_MECHANISM(CKM_ECMQV_DERIVE);
|
479
|
-
PKCS11_DEFINE_MECHANISM(CKM_JUNIPER_KEY_GEN);
|
480
|
-
PKCS11_DEFINE_MECHANISM(CKM_JUNIPER_ECB128);
|
481
|
-
PKCS11_DEFINE_MECHANISM(CKM_JUNIPER_CBC128);
|
482
|
-
PKCS11_DEFINE_MECHANISM(CKM_JUNIPER_COUNTER);
|
483
|
-
PKCS11_DEFINE_MECHANISM(CKM_JUNIPER_SHUFFLE);
|
484
|
-
PKCS11_DEFINE_MECHANISM(CKM_JUNIPER_WRAP);
|
485
|
-
PKCS11_DEFINE_MECHANISM(CKM_FASTHASH);
|
486
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_KEY_GEN);
|
487
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_ECB);
|
488
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_CBC);
|
489
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_MAC);
|
490
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_MAC_GENERAL);
|
491
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_CBC_PAD);
|
492
|
-
PKCS11_DEFINE_MECHANISM(CKM_DSA_PARAMETER_GEN);
|
493
|
-
PKCS11_DEFINE_MECHANISM(CKM_DH_PKCS_PARAMETER_GEN);
|
494
|
-
PKCS11_DEFINE_MECHANISM(CKM_X9_42_DH_PARAMETER_GEN);
|
495
|
-
PKCS11_DEFINE_MECHANISM(CKM_ACTI);
|
496
|
-
PKCS11_DEFINE_MECHANISM(CKM_ACTI_KEY_GEN);
|
497
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_CBC_ENCRYPT_DATA);
|
498
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_CTR);
|
499
|
-
PKCS11_DEFINE_MECHANISM(CKM_AES_ECB_ENCRYPT_DATA);
|
500
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_CBC);
|
501
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_CBC_ENCRYPT_DATA);
|
502
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_CBC_PAD);
|
503
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_ECB);
|
504
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_ECB_ENCRYPT_DATA);
|
505
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_KEY_GEN);
|
506
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_MAC);
|
507
|
-
PKCS11_DEFINE_MECHANISM(CKM_ARIA_MAC_GENERAL);
|
508
|
-
PKCS11_DEFINE_MECHANISM(CKM_BLOWFISH_CBC);
|
509
|
-
PKCS11_DEFINE_MECHANISM(CKM_BLOWFISH_KEY_GEN);
|
510
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_CBC);
|
511
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_CBC_ENCRYPT_DATA);
|
512
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_CBC_PAD);
|
513
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_CTR);
|
514
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_ECB);
|
515
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_ECB_ENCRYPT_DATA);
|
516
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_KEY_GEN);
|
517
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_MAC);
|
518
|
-
PKCS11_DEFINE_MECHANISM(CKM_CAMELLIA_MAC_GENERAL);
|
519
|
-
PKCS11_DEFINE_MECHANISM(CKM_CMS_SIG);
|
520
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_CBC_ENCRYPT_DATA);
|
521
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES3_ECB_ENCRYPT_DATA);
|
522
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_CBC_ENCRYPT_DATA);
|
523
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_CFB64);
|
524
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_CFB8);
|
525
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_ECB_ENCRYPT_DATA);
|
526
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_OFB64);
|
527
|
-
PKCS11_DEFINE_MECHANISM(CKM_DES_OFB8);
|
528
|
-
PKCS11_DEFINE_MECHANISM(CKM_HOTP);
|
529
|
-
PKCS11_DEFINE_MECHANISM(CKM_HOTP_KEY_GEN);
|
530
|
-
PKCS11_DEFINE_MECHANISM(CKM_KIP_DERIVE);
|
531
|
-
PKCS11_DEFINE_MECHANISM(CKM_KIP_MAC);
|
532
|
-
PKCS11_DEFINE_MECHANISM(CKM_KIP_WRAP);
|
533
|
-
PKCS11_DEFINE_MECHANISM(CKM_SECURID);
|
534
|
-
PKCS11_DEFINE_MECHANISM(CKM_SECURID_KEY_GEN);
|
535
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA224);
|
536
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA224_HMAC);
|
537
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA224_HMAC_GENERAL);
|
538
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA224_KEY_DERIVATION);
|
539
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA224_RSA_PKCS);
|
540
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA224_RSA_PKCS_PSS);
|
541
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA256);
|
542
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA256_HMAC);
|
543
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA256_HMAC_GENERAL);
|
544
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA256_KEY_DERIVATION);
|
545
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA256_RSA_PKCS);
|
546
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA256_RSA_PKCS_PSS);
|
547
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA384);
|
548
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA384_HMAC);
|
549
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA384_HMAC_GENERAL);
|
550
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA384_KEY_DERIVATION);
|
551
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA384_RSA_PKCS);
|
552
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA384_RSA_PKCS_PSS);
|
553
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA512);
|
554
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA512_HMAC);
|
555
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA512_HMAC_GENERAL);
|
556
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA512_KEY_DERIVATION);
|
557
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA512_RSA_PKCS);
|
558
|
-
PKCS11_DEFINE_MECHANISM(CKM_SHA512_RSA_PKCS_PSS);
|
559
|
-
PKCS11_DEFINE_MECHANISM(CKM_TLS_PRF);
|
560
|
-
PKCS11_DEFINE_MECHANISM(CKM_TWOFISH_CBC);
|
561
|
-
PKCS11_DEFINE_MECHANISM(CKM_TWOFISH_KEY_GEN);
|
562
|
-
PKCS11_DEFINE_MECHANISM(CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE);
|
563
|
-
PKCS11_DEFINE_MECHANISM(CKM_WTLS_MASTER_KEY_DERIVE);
|
564
|
-
PKCS11_DEFINE_MECHANISM(CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC);
|
565
|
-
PKCS11_DEFINE_MECHANISM(CKM_WTLS_PRE_MASTER_KEY_GEN);
|
566
|
-
PKCS11_DEFINE_MECHANISM(CKM_WTLS_PRF);
|
567
|
-
PKCS11_DEFINE_MECHANISM(CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE);
|
568
|
-
PKCS11_DEFINE_MECHANISM(CKM_VENDOR_DEFINED);
|
569
|
-
rb_obj_freeze(vMECHANISMS);
|
200
|
+
vRETURN_VALUES = rb_hash_new();
|
201
|
+
rb_define_const(cPKCS11, "OBJECT_CLASSES", vOBJECT_CLASSES);
|
202
|
+
rb_define_const(cPKCS11, "ATTRIBUTES", vATTRIBUTES);
|
570
203
|
rb_define_const(cPKCS11, "MECHANISMS", vMECHANISMS);
|
204
|
+
rb_define_const(cPKCS11, "RETURN_VALUES", vRETURN_VALUES);
|
571
205
|
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_GENERAL_ERROR);
|
578
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_FUNCTION_FAILED);
|
579
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ARGUMENTS_BAD);
|
580
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_NO_EVENT);
|
581
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_NEED_TO_CREATE_THREADS);
|
582
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_CANT_LOCK);
|
583
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ATTRIBUTE_READ_ONLY);
|
584
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ATTRIBUTE_SENSITIVE);
|
585
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ATTRIBUTE_TYPE_INVALID);
|
586
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ATTRIBUTE_VALUE_INVALID);
|
587
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_DATA_INVALID);
|
588
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_DATA_LEN_RANGE);
|
589
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_DEVICE_ERROR);
|
590
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_DEVICE_MEMORY);
|
591
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_DEVICE_REMOVED);
|
592
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ENCRYPTED_DATA_INVALID);
|
593
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_ENCRYPTED_DATA_LEN_RANGE);
|
594
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_FUNCTION_CANCELED);
|
595
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_FUNCTION_NOT_PARALLEL);
|
596
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_FUNCTION_NOT_SUPPORTED);
|
597
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_HANDLE_INVALID);
|
598
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_SIZE_RANGE);
|
599
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_TYPE_INCONSISTENT);
|
600
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_NOT_NEEDED);
|
601
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_CHANGED);
|
602
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_NEEDED);
|
603
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_INDIGESTIBLE);
|
604
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_FUNCTION_NOT_PERMITTED);
|
605
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_NOT_WRAPPABLE);
|
606
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_UNEXTRACTABLE);
|
607
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_MECHANISM_INVALID);
|
608
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_MECHANISM_PARAM_INVALID);
|
609
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_OBJECT_HANDLE_INVALID);
|
610
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_OPERATION_ACTIVE);
|
611
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_OPERATION_NOT_INITIALIZED);
|
612
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_PIN_INCORRECT);
|
613
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_PIN_INVALID);
|
614
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_PIN_LEN_RANGE);
|
615
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_PIN_EXPIRED);
|
616
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_PIN_LOCKED);
|
617
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_CLOSED);
|
618
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_COUNT);
|
619
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_HANDLE_INVALID);
|
620
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_PARALLEL_NOT_SUPPORTED);
|
621
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_READ_ONLY);
|
622
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_EXISTS);
|
623
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_READ_ONLY_EXISTS);
|
624
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SESSION_READ_WRITE_SO_EXISTS);
|
625
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SIGNATURE_INVALID);
|
626
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SIGNATURE_LEN_RANGE);
|
627
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_TEMPLATE_INCOMPLETE);
|
628
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_TEMPLATE_INCONSISTENT);
|
629
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_TOKEN_NOT_PRESENT);
|
630
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_TOKEN_NOT_RECOGNIZED);
|
631
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_TOKEN_WRITE_PROTECTED);
|
632
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_UNWRAPPING_KEY_HANDLE_INVALID);
|
633
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_UNWRAPPING_KEY_SIZE_RANGE);
|
634
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT);
|
635
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_USER_ALREADY_LOGGED_IN);
|
636
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_USER_NOT_LOGGED_IN);
|
637
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_USER_PIN_NOT_INITIALIZED);
|
638
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_USER_TYPE_INVALID);
|
639
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_USER_ANOTHER_ALREADY_LOGGED_IN);
|
640
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_USER_TOO_MANY_TYPES);
|
641
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_WRAPPED_KEY_INVALID);
|
642
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_WRAPPED_KEY_LEN_RANGE);
|
643
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_WRAPPING_KEY_HANDLE_INVALID);
|
644
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_WRAPPING_KEY_SIZE_RANGE);
|
645
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_WRAPPING_KEY_TYPE_INCONSISTENT);
|
646
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_RANDOM_SEED_NOT_SUPPORTED);
|
647
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_RANDOM_NO_RNG);
|
648
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_DOMAIN_PARAMS_INVALID);
|
649
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_BUFFER_TOO_SMALL);
|
650
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_SAVED_STATE_INVALID);
|
651
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_INFORMATION_SENSITIVE);
|
652
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_STATE_UNSAVEABLE);
|
653
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_CRYPTOKI_NOT_INITIALIZED);
|
654
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_CRYPTOKI_ALREADY_INITIALIZED);
|
655
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_MUTEX_BAD);
|
656
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_MUTEX_NOT_LOCKED);
|
657
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_FUNCTION_REJECTED);
|
658
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_NEW_PIN_MODE);
|
659
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_NEXT_OTP);
|
660
|
-
PKCS11_DEFINE_RETURN_VALUE(CKR_VENDOR_DEFINED);
|
206
|
+
#include "pk11_const_def.inc"
|
207
|
+
|
208
|
+
rb_obj_freeze(vOBJECT_CLASSES);
|
209
|
+
rb_obj_freeze(vATTRIBUTES);
|
210
|
+
rb_obj_freeze(vMECHANISMS);
|
661
211
|
rb_obj_freeze(vRETURN_VALUES);
|
662
|
-
rb_define_const(cPKCS11, "RETURN_VALUES", vRETURN_VALUES);
|
663
212
|
|
664
213
|
/* OTP parameters */
|
665
214
|
PKCS11_DEFINE_CONST(CK_OTP_CHALLENGE);
|