pkcs11_protect_server 0.2.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ #ifndef RUBY_PK11_VERSION_H
2
+ #define RUBY_PK11_VERSION_H
3
+
4
+ static const char *VERSION = "0.2.2";
5
+
6
+ #endif
data/ext/pk11s.c ADDED
@@ -0,0 +1,70 @@
1
+ #include <ruby.h>
2
+
3
+ #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
4
+ #define _WINDOWS
5
+ #endif
6
+
7
+ #include <kmlib.h>
8
+ #include "pk11_struct_macros.h"
9
+ #include "pk11_const_macros.h"
10
+ #include "pk11_version.h"
11
+
12
+ ///////////////////////////////////////
13
+
14
+ #include "pk11s_struct_impl.inc"
15
+
16
+ static VALUE mPKCS11;
17
+ static VALUE mProtectServer;
18
+ static VALUE eProtectServerError;
19
+ static VALUE cProtectServerCStruct;
20
+ static VALUE cPkcs11CStruct;
21
+
22
+ static VALUE vOBJECT_CLASSES;
23
+ static VALUE vATTRIBUTES;
24
+ static VALUE vMECHANISMS;
25
+ static VALUE vRETURN_VALUES;
26
+
27
+ #define MODULE_FOR_STRUCTS mProtectServer
28
+ #define MODULE_FOR_CONSTS mProtectServer
29
+ #define BASECLASS_FOR_ERRORS eProtectServerError
30
+ #define BASECLASS_FOR_STRUCTS cProtectServerCStruct
31
+
32
+ void
33
+ Init_pkcs11_protect_server_ext()
34
+ {
35
+ VALUE eError;
36
+
37
+ mPKCS11 = rb_const_get(rb_cObject, rb_intern("PKCS11"));
38
+ mProtectServer = rb_define_module_under(mPKCS11, "ProtectServer");
39
+
40
+ /* Library version */
41
+ rb_define_const( mProtectServer, "VERSION", rb_str_new2(VERSION) );
42
+
43
+ eError = rb_const_get(mPKCS11, rb_intern("Error"));
44
+ /* Document-class: PKCS11::ProtectServer::Error
45
+ *
46
+ * Base class for all ProtectServer specific exceptions (CKR_*) */
47
+ eProtectServerError = rb_define_class_under(mProtectServer, "Error", eError);
48
+
49
+ cPkcs11CStruct = rb_const_get(mPKCS11, rb_intern("CStruct")); \
50
+ cProtectServerCStruct = rb_define_class_under(mProtectServer, "CStruct", cPkcs11CStruct);
51
+
52
+ #include "pk11s_struct_def.inc"
53
+
54
+ vOBJECT_CLASSES = rb_hash_new();
55
+ vATTRIBUTES = rb_hash_new();
56
+ vMECHANISMS = rb_hash_new();
57
+ vRETURN_VALUES = rb_hash_new();
58
+ rb_define_const(mProtectServer, "OBJECT_CLASSES", vOBJECT_CLASSES);
59
+ rb_define_const(mProtectServer, "ATTRIBUTES", vATTRIBUTES);
60
+ rb_define_const(mProtectServer, "MECHANISMS", vMECHANISMS);
61
+ rb_define_const(mProtectServer, "RETURN_VALUES", vRETURN_VALUES);
62
+
63
+ #include "pk11s_const_def.inc"
64
+
65
+ rb_obj_freeze(vOBJECT_CLASSES);
66
+ rb_obj_freeze(vATTRIBUTES);
67
+ rb_obj_freeze(vMECHANISMS);
68
+ rb_obj_freeze(vRETURN_VALUES);
69
+
70
+ }
@@ -0,0 +1,182 @@
1
+ PKCS11_DEFINE_MECHANISM(CKM_DSA_SHA1_PKCS); /* (CKM_VENDOR_DEFINED + CKM_DSA_SHA1 + 0x1) */
2
+ PKCS11_DEFINE_MECHANISM(CKM_RIPEMD256_RSA_PKCS); /* (CKM_VENDOR_DEFINED + CKM_RIPEMD160_RSA_PKCS + 0x1) */
3
+ PKCS11_DEFINE_MECHANISM(CKM_DES_MDC_2_PAD1); /* (CKM_VENDOR_DEFINED + 0x200 + 0x0) */
4
+ PKCS11_DEFINE_MECHANISM(CKM_MD4); /* (CKM_VENDOR_DEFINED + 0x200 + 0x1) */
5
+ PKCS11_DEFINE_MECHANISM(CKM_SHA); /* (CKM_VENDOR_DEFINED + 0x200 + 0x2) */
6
+ PKCS11_DEFINE_MECHANISM(CKM_RIPEMD); /* (CKM_VENDOR_DEFINED + 0x200 + 0x3) */
7
+ PKCS11_DEFINE_MECHANISM(CKM_ARDFP); /* (CKM_VENDOR_DEFINED + 0x200 + 0x4) */
8
+ PKCS11_DEFINE_MECHANISM(CKM_NVB); /* (CKM_VENDOR_DEFINED + 0x200 + 0x5) */
9
+ PKCS11_DEFINE_MECHANISM(CKM_DES_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_DES_ECB) */
10
+ PKCS11_DEFINE_MECHANISM(CKM_CAST_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_CAST_ECB) */
11
+ PKCS11_DEFINE_MECHANISM(CKM_CAST3_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_CAST3_ECB) */
12
+ PKCS11_DEFINE_MECHANISM(CKM_CAST5_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_CAST5_ECB) */
13
+ PKCS11_DEFINE_MECHANISM(CKM_CAST128_ECB_PAD); /* CKM_CAST5_ECB_PAD */
14
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_DES3_ECB) */
15
+ PKCS11_DEFINE_MECHANISM(CKM_IDEA_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_IDEA_ECB) */
16
+ PKCS11_DEFINE_MECHANISM(CKM_RC2_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_RC2_ECB) */
17
+ PKCS11_DEFINE_MECHANISM(CKM_CDMF_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_CDMF_ECB) */
18
+ PKCS11_DEFINE_MECHANISM(CKM_RC5_ECB_PAD); /* (CKM_VENDOR_DEFINED + CKM_RC5_ECB) */
19
+ PKCS11_DEFINE_MECHANISM(CKM_DES_DERIVE_ECB); /* (CKM_VENDOR_DEFINED + 0x500) */
20
+ PKCS11_DEFINE_MECHANISM(CKM_DES_DERIVE_CBC); /* (CKM_VENDOR_DEFINED + 0x501) */
21
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_DERIVE_ECB); /* (CKM_VENDOR_DEFINED + 0x502) */
22
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_DERIVE_CBC); /* (CKM_VENDOR_DEFINED + 0x503) */
23
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_RETAIL_CFB_MAC); /* (CKM_VENDOR_DEFINED + 0x510) */
24
+ PKCS11_DEFINE_MECHANISM(CKM_SHA1_RSA_PKCS_TIMESTAMP); /* (CKM_VENDOR_DEFINED + 0x600) */
25
+ PKCS11_DEFINE_MECHANISM(CKM_DES_BCF); /* (CKM_VENDOR_DEFINED + 910) */
26
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_BCF); /* (CKM_VENDOR_DEFINED + 911) */
27
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_X919_MAC); /* (CKM_VENDOR_DEFINED + CKM_DES3_MAC) */
28
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_X919_MAC_GENERAL); /* (CKM_VENDOR_DEFINED + CKM_DES3_MAC_GENERAL) */
29
+ PKCS11_DEFINE_MECHANISM(CKM_ENCODE_PKCS_7); /* (CKM_VENDOR_DEFINED + 0x934) */
30
+ PKCS11_DEFINE_MECHANISM(CKM_DECODE_PKCS_7); /* (CKM_VENDOR_DEFINED + 0x935) */
31
+ PKCS11_DEFINE_MECHANISM(CKM_RSA_PKCS_7); /* (CKM_VENDOR_DEFINED + 0x930) */
32
+ PKCS11_DEFINE_MECHANISM(CKM_RSA_PKCS_7_ENC); /* (CKM_VENDOR_DEFINED + 0x931) */
33
+ PKCS11_DEFINE_MECHANISM(CKM_RSA_PKCS_7_SIGN); /* (CKM_VENDOR_DEFINED + 0x932) */
34
+ PKCS11_DEFINE_MECHANISM(CKM_RSA_PKCS_7_SIGN_ENC); /* (CKM_VENDOR_DEFINED + 0x933) */
35
+ PKCS11_DEFINE_MECHANISM(CKM_DES_OFB64); /* (CKM_VENDOR_DEFINED + 0x940) */
36
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_OFB64); /* (CKM_VENDOR_DEFINED + 0x941) */
37
+ PKCS11_DEFINE_MECHANISM(CKM_XOR_BASE_AND_KEY); /* (CKM_VENDOR_DEFINED + 0x364) */
38
+ PKCS11_DEFINE_MECHANISM(CKM_ENCODE_ATTRIBUTES); /* (CKM_VENDOR_DEFINED + 0x950) */
39
+ PKCS11_DEFINE_MECHANISM(CKM_ENCODE_X_509); /* (CKM_VENDOR_DEFINED + 0x951) */
40
+ PKCS11_DEFINE_MECHANISM(CKM_ENCODE_PKCS_10); /* (CKM_VENDOR_DEFINED + 0x952) */
41
+ PKCS11_DEFINE_MECHANISM(CKM_DECODE_X_509); /* (CKM_VENDOR_DEFINED + 0x953) */
42
+ PKCS11_DEFINE_MECHANISM(CKM_ENCODE_PUBLIC_KEY); /* (CKM_VENDOR_DEFINED + 0x954) */
43
+ PKCS11_DEFINE_MECHANISM(CKM_ENCODE_X_509_LOCAL_CERT); /* (CKM_VENDOR_DEFINED + 0x955) */
44
+ PKCS11_DEFINE_MECHANISM(CKM_WRAPKEY_DES3_ECB); /* (CKM_VENDOR_DEFINED + 0x961) */
45
+ PKCS11_DEFINE_MECHANISM(CKM_WRAPKEY_DES3_CBC); /* (CKM_VENDOR_DEFINED + 0x962) */
46
+ PKCS11_DEFINE_MECHANISM(CKM_DES3_DDD_CBC); /* (CKM_VENDOR_DEFINED + 0x964) */
47
+ PKCS11_DEFINE_MECHANISM(CKM_VERIFY_CERTIFICATE); /* (CKM_VENDOR_DEFINED + 0x980) */
48
+ PKCS11_DEFINE_MECHANISM(CKM_KEY_TRANSLATION); /* (CK_VENDOR_DEFINED + 0x1B) */
49
+ PKCS11_DEFINE_MECHANISM(CKM_OS_UPGRADE); /* (CKM_VENDOR_DEFINED + 0x990) */
50
+ PKCS11_DEFINE_MECHANISM(CKM_FM_DOWNLOAD); /* (CKM_VENDOR_DEFINED + 0x991) */
51
+ PKCS11_DEFINE_MECHANISM(CKM_PP_LOAD_SECRET); /* (CKM_VENDOR_DEFINED + 0x9a0) */
52
+ PKCS11_DEFINE_MECHANISM(CKM_VISA_CVV); /* (CKM_VENDOR_DEFINED + 0x9b0) */
53
+ PKCS11_DEFINE_MECHANISM(CKM_ZKA_MDC_2_KEY_DERIVATION); /* (CKM_VENDOR_DEFINED + 0x9c0) */
54
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_KEY_GEN); /* (CKM_VENDOR_DEFINED + 0x9d0) */
55
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_ECB); /* (CKM_VENDOR_DEFINED + 0x9d1) */
56
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_CBC); /* (CKM_VENDOR_DEFINED + 0x9d2) */
57
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_MAC); /* (CKM_VENDOR_DEFINED + 0x9d3) */
58
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_MAC_GENERAL); /* (CKM_VENDOR_DEFINED + 0x9d4) */
59
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_ECB_PAD); /* (CKM_VENDOR_DEFINED + 0x9d5) */
60
+ PKCS11_DEFINE_MECHANISM(CKM_SEED_CBC_PAD); /* (CKM_VENDOR_DEFINED + 0x9d6) */
61
+ PKCS11_DEFINE_MECHANISM(CKM_REPLICATE_TOKEN_RSA_AES); /* (CKM_VENDOR_DEFINED + 0x9e0) */
62
+ PKCS11_DEFINE_MECHANISM(CKM_SECRET_SHARE_WITH_ATTRIBUTES); /* (CKM_VENDOR_DEFINED + 0x9f0) */
63
+ PKCS11_DEFINE_MECHANISM(CKM_SECRET_RECOVER_WITH_ATTRIBUTES); /* (CKM_VENDOR_DEFINED + 0x9f1) */
64
+ PKCS11_DEFINE_MECHANISM(CKM_PKCS12_PBE_EXPORT); /* (CKM_VENDOR_DEFINED + 0x9f2) */
65
+ PKCS11_DEFINE_MECHANISM(CKM_PKCS12_PBE_IMPORT); /* (CKM_VENDOR_DEFINED + 0x9f3) */
66
+ PKCS11_DEFINE_MECHANISM(CKM_ECIES); /* (CKM_VENDOR_DEFINED + 0xA00) */
67
+ PKCS11_DEFINE_ATTRIBUTE(CKA_USAGE_COUNT); /* (CKA_VENDOR_DEFINED + 0x0101) */
68
+ PKCS11_DEFINE_ATTRIBUTE(CKA_TIME_STAMP); /* (CKA_VENDOR_DEFINED + 0x0102) */
69
+ PKCS11_DEFINE_ATTRIBUTE(CKA_CHECK_VALUE); /* (CKA_VENDOR_DEFINED + 0x0103) */
70
+ PKCS11_DEFINE_ATTRIBUTE(CKA_MECHANISM_LIST); /* (CKA_VENDOR_DEFINED + 0x0104) */
71
+ PKCS11_DEFINE_ATTRIBUTE(CKA_SIGN_LOCAL_CERT); /* (CKA_VENDOR_DEFINED + 0x0127) */
72
+ PKCS11_DEFINE_ATTRIBUTE(CKA_EXPORT); /* (CKA_VENDOR_DEFINED + 0x0128) */
73
+ PKCS11_DEFINE_ATTRIBUTE(CKA_EXPORTABLE); /* (CKA_VENDOR_DEFINED + 0x0129) */
74
+ PKCS11_DEFINE_ATTRIBUTE(CKA_DELETABLE); /* (CKA_VENDOR_DEFINED + 0x012A) */
75
+ PKCS11_DEFINE_ATTRIBUTE(CKA_IMPORT); /* (CKA_VENDOR_DEFINED + 0x012B) */
76
+ PKCS11_DEFINE_ATTRIBUTE(CKA_KEY_SIZE); /* (CKA_VENDOR_DEFINED + 0x012C) */
77
+ PKCS11_DEFINE_ATTRIBUTE(CKA_ISSUER_STR); /* (CKA_VENDOR_DEFINED + 0x0130) */
78
+ PKCS11_DEFINE_ATTRIBUTE(CKA_SUBJECT_STR); /* (CKA_VENDOR_DEFINED + 0x0131) */
79
+ PKCS11_DEFINE_ATTRIBUTE(CKA_SERIAL_NUMBER_INT); /* (CKA_VENDOR_DEFINED + 0x0132) */
80
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RECORD_COUNT); /* (CKA_VENDOR_DEFINED + 0x0136) */
81
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RECORD_NUMBER); /* (CKA_VENDOR_DEFINED + 0x0137) */
82
+ PKCS11_DEFINE_ATTRIBUTE(CKA_PURGE); /* (CKA_VENDOR_DEFINED + 0x0139) */
83
+ PKCS11_DEFINE_ATTRIBUTE(CKA_EVENT_LOG_FULL); /* (CKA_VENDOR_DEFINED + 0x013A) */
84
+ PKCS11_DEFINE_ATTRIBUTE(CKA_SECURITY_MODE); /* (CKA_VENDOR_DEFINED + 0x0140) */
85
+ PKCS11_DEFINE_ATTRIBUTE(CKA_TRANSPORT_MODE); /* (CKA_VENDOR_DEFINED + 0x0141) */
86
+ PKCS11_DEFINE_ATTRIBUTE(CKA_BATCH); /* (CKA_VENDOR_DEFINED + 0x0142) */
87
+ PKCS11_DEFINE_ATTRIBUTE(CKA_HW_STATUS); /* (CKA_VENDOR_DEFINED + 0x0143) */
88
+ PKCS11_DEFINE_ATTRIBUTE(CKA_FREE_MEM); /* (CKA_VENDOR_DEFINED + 0x0144) */
89
+ PKCS11_DEFINE_ATTRIBUTE(CKA_TAMPER_CMD); /* (CKA_VENDOR_DEFINED + 0x0145) */
90
+ PKCS11_DEFINE_ATTRIBUTE(CKA_DATE_OF_MANUFACTURE); /* (CKA_VENDOR_DEFINED + 0x0146) */
91
+ PKCS11_DEFINE_ATTRIBUTE(CKA_HALT_CMD); /* (CKA_VENDOR_DEFINED + 0x0147) */
92
+ PKCS11_DEFINE_ATTRIBUTE(CKA_APPLICATION_COUNT); /* (CKA_VENDOR_DEFINED + 0x0148) */
93
+ PKCS11_DEFINE_ATTRIBUTE(CKA_FW_VERSION); /* (CKA_VENDOR_DEFINED + 0x0149) */
94
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RESCAN_PERIPHERALS_CMD); /* (CKA_VENDOR_DEFINED + 0x014A) */
95
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RTC_AAC_ENABLED); /* (CKA_VENDOR_DEFINED + 0x014B) */
96
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RTC_AAC_GUARD_SECONDS); /* (CKA_VENDOR_DEFINED + 0x014C) */
97
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RTC_AAC_GUARD_COUNT); /* (CKA_VENDOR_DEFINED + 0x014D) */
98
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RTC_AAC_GUARD_DURATION); /* (CKA_VENDOR_DEFINED + 0x014E) */
99
+ PKCS11_DEFINE_ATTRIBUTE(CKA_HW_EXT_INFO_STR); /* (CKA_VENDOR_DEFINED + 0x014F) */
100
+ PKCS11_DEFINE_ATTRIBUTE(CKA_SLOT_ID); /* (CKA_VENDOR_DEFINED + 0x0151) */
101
+ PKCS11_DEFINE_ATTRIBUTE(CKA_MAX_SESSIONS); /* (CKA_VENDOR_DEFINED + 0x0155) */
102
+ PKCS11_DEFINE_ATTRIBUTE(CKA_MIN_PIN_LEN); /* (CKA_VENDOR_DEFINED + 0x0156) */
103
+ PKCS11_DEFINE_ATTRIBUTE(CKA_MAX_PIN_FAIL); /* (CKA_VENDOR_DEFINED + 0x0158) */
104
+ PKCS11_DEFINE_ATTRIBUTE(CKA_FLAGS); /* (CKA_VENDOR_DEFINED + 0x0159) */
105
+ PKCS11_DEFINE_ATTRIBUTE(CKA_PINPAD_DESC); /* (CKA_VENDOR_DEFINED + 0x015A) */
106
+ PKCS11_DEFINE_ATTRIBUTE(CKA_VERIFY_OS); /* (CKA_VENDOR_DEFINED + 0x0170) */
107
+ PKCS11_DEFINE_ATTRIBUTE(CKA_VERSION); /* (CKA_VENDOR_DEFINED + 0x0181) */
108
+ PKCS11_DEFINE_ATTRIBUTE(CKA_MANUFACTURER); /* (CKA_VENDOR_DEFINED + 0x0182) */
109
+ PKCS11_DEFINE_ATTRIBUTE(CKA_BUILD_DATE); /* (CKA_VENDOR_DEFINED + 0x0183) */
110
+ PKCS11_DEFINE_ATTRIBUTE(CKA_FINGERPRINT); /* (CKA_VENDOR_DEFINED + 0x0184) */
111
+ PKCS11_DEFINE_ATTRIBUTE(CKA_ROM_SPACE); /* (CKA_VENDOR_DEFINED + 0x0185) */
112
+ PKCS11_DEFINE_ATTRIBUTE(CKA_RAM_SPACE); /* (CKA_VENDOR_DEFINED + 0x0186) */
113
+ PKCS11_DEFINE_ATTRIBUTE(CKA_FM_STATUS); /* (CKA_VENDOR_DEFINED + 0x0187) */
114
+ PKCS11_DEFINE_ATTRIBUTE(CKA_DELETE_FM); /* (CKA_VENDOR_DEFINED + 0x0188) */
115
+ PKCS11_DEFINE_ATTRIBUTE(CKA_FM_STARTUP_STATUS); /* (CKA_VENDOR_DEFINED + 0x0189) */
116
+ PKCS11_DEFINE_ATTRIBUTE(CKA_CERTIFICATE_START_TIME); /* (CKA_VENDOR_DEFINED + 0x0190) */
117
+ PKCS11_DEFINE_ATTRIBUTE(CKA_CERTIFICATE_END_TIME); /* (CKA_VENDOR_DEFINED + 0x0191) */
118
+ PKCS11_DEFINE_ATTRIBUTE(CKA_PKI_ATTRIBUTE_BER_ENCODED); /* (CKA_VENDOR_DEFINED + 0x0230) */
119
+ PKCS11_DEFINE_ATTRIBUTE(CKA_HIFACE_MASTER); /* (CKA_VENDOR_DEFINED + 0x250) */
120
+ PKCS11_DEFINE_ATTRIBUTE(CKA_SEED); /* (CKA_VENDOR_DEFINED + 0x260) */
121
+ PKCS11_DEFINE_ATTRIBUTE(CKA_COUNTER); /* (CKA_VENDOR_DEFINED + 0x261) */
122
+ PKCS11_DEFINE_ATTRIBUTE(CKA_H_VALUE); /* (CKA_VENDOR_DEFINED + 0x262) */
123
+ PKCS11_DEFINE_ATTRIBUTE(CKA_INTERNAL_1); /* (CKA_VENDOR_DEFINED + 0x270) */
124
+ PKCS11_DEFINE_ATTRIBUTE(CKA_ENUM_ATTRIBUTE); /* ((CK_ATTRIBUTE_TYPE)0xFFFF) */
125
+ PKCS11_DEFINE_OBJECT_CLASS(CKO_CERTIFICATE_REQUEST); /* (CKO_VENDOR_DEFINED + 0x0201) */
126
+ PKCS11_DEFINE_OBJECT_CLASS(CKO_CRL); /* (CKO_VENDOR_DEFINED + 0x0202) */
127
+ PKCS11_DEFINE_OBJECT_CLASS(CKO_ADAPTER); /* (CKO_VENDOR_DEFINED + 0x020A) */
128
+ PKCS11_DEFINE_OBJECT_CLASS(CKO_SLOT); /* (CKO_VENDOR_DEFINED + 0x020B) */
129
+ PKCS11_DEFINE_OBJECT_CLASS(CKO_FM); /* (CKO_VENDOR_DEFINED + 0x020C) */
130
+ PKCS11_DEFINE_RETURN_VALUE(CKR_ERACOM_ERROR); /* (CKR_VENDOR_DEFINED+0x100) */
131
+ PKCS11_DEFINE_RETURN_VALUE(CKR_TIME_STAMP); /* (CKR_ERACOM_ERROR+0x01) */
132
+ PKCS11_DEFINE_RETURN_VALUE(CKR_ACCESS_DENIED); /* (CKR_ERACOM_ERROR+0x02) */
133
+ PKCS11_DEFINE_RETURN_VALUE(CKR_CRYPTOKI_UNUSABLE); /* (CKR_ERACOM_ERROR+0x03) */
134
+ PKCS11_DEFINE_RETURN_VALUE(CKR_ENCODE_ERROR); /* (CKR_ERACOM_ERROR+0x04) */
135
+ PKCS11_DEFINE_RETURN_VALUE(CKR_V_CONFIG); /* (CKR_ERACOM_ERROR+0x05) */
136
+ PKCS11_DEFINE_RETURN_VALUE(CKR_SO_NOT_LOGGED_IN); /* (CKR_ERACOM_ERROR+0x06) */
137
+ PKCS11_DEFINE_RETURN_VALUE(CKR_CERT_NOT_VALIDATED); /* (CKR_ERACOM_ERROR+0x07) */
138
+ PKCS11_DEFINE_RETURN_VALUE(CKR_PIN_ALREADY_INITIALIZED); /* (CKR_ERACOM_ERROR+0x08) */
139
+ PKCS11_DEFINE_RETURN_VALUE(CKR_REMOTE_SERVER_ERROR); /* (CKR_ERACOM_ERROR+0x0a) */
140
+ PKCS11_DEFINE_RETURN_VALUE(CKR_CSA_HW_ERROR); /* (CKR_ERACOM_ERROR+0x0b) */
141
+ PKCS11_DEFINE_RETURN_VALUE(CKR_NO_CHALLENGE); /* (CKR_ERACOM_ERROR+0x10) */
142
+ PKCS11_DEFINE_RETURN_VALUE(CKR_RESPONSE_INVALID); /* (CKR_ERACOM_ERROR+0x11) */
143
+ PKCS11_DEFINE_RETURN_VALUE(CKR_EVENT_LOG_NOT_FULL); /* (CKR_ERACOM_ERROR+0x13) */
144
+ PKCS11_DEFINE_RETURN_VALUE(CKR_OBJECT_READ_ONLY); /* (CKR_ERACOM_ERROR+0x14) */
145
+ PKCS11_DEFINE_RETURN_VALUE(CKR_TOKEN_READ_ONLY); /* (CKR_ERACOM_ERROR+0x15) */
146
+ PKCS11_DEFINE_RETURN_VALUE(CKR_TOKEN_NOT_INITIALIZED); /* (CKR_ERACOM_ERROR+0x16) */
147
+ PKCS11_DEFINE_RETURN_VALUE(CKR_NOT_ADMIN_TOKEN); /* (CKR_ERACOM_ERROR+0x17) */
148
+ PKCS11_DEFINE_RETURN_VALUE(CKR_AUTHENTICATION_REQUIRED); /* (CKR_ERACOM_ERROR + 0x30) */
149
+ PKCS11_DEFINE_RETURN_VALUE(CKR_OPERATION_NOT_PERMITTED); /* (CKR_ERACOM_ERROR + 0x31) */
150
+ PKCS11_DEFINE_RETURN_VALUE(CKR_PKCS12_DECODE); /* (CKR_ERACOM_ERROR + 0x32) */
151
+ PKCS11_DEFINE_RETURN_VALUE(CKR_PKCS12_UNSUPPORTED_SAFEBAG_TYPE); /* (CKR_ERACOM_ERROR + 0x33) */
152
+ PKCS11_DEFINE_RETURN_VALUE(CKR_PKCS12_UNSUPPORTED_PRIVACY_MODE); /* (CKR_ERACOM_ERROR + 0x34) */
153
+ PKCS11_DEFINE_RETURN_VALUE(CKR_PKCS12_UNSUPPORTED_INTEGRITY_MODE); /* (CKR_ERACOM_ERROR + 0x35) */
154
+ PKCS11_DEFINE_RETURN_VALUE(CKR_ET_NOT_ODD_PARITY); /* (CKR_ERACOM_ERROR + 0x40) */
155
+ PKCS11_DEFINE_RETURN_VALUE(CKR_HOST_ERROR); /* (CKR_VENDOR_DEFINED+0x1000) */
156
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_REQUEST); /* (CKR_HOST_ERROR + 1) */
157
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_ATTRIBUTE_PACKING); /* (CKR_HOST_ERROR + 2) */
158
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_ATTRIBUTE_COUNT); /* (CKR_HOST_ERROR + 3) */
159
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_PARAM_PACKING); /* (CKR_HOST_ERROR + 4) */
160
+ PKCS11_DEFINE_RETURN_VALUE(CKR_EXTERN_DCP_ERROR); /* (CKR_HOST_ERROR + 0x386) */
161
+ PKCS11_DEFINE_RETURN_VALUE(CKR_HIMK_NOT_FOUND); /* (CKR_HOST_ERROR + 0x400) */
162
+ PKCS11_DEFINE_RETURN_VALUE(CKR_MSG_ERROR); /* (CKR_VENDOR_DEFINED+0x300) */
163
+ PKCS11_DEFINE_RETURN_VALUE(CKR_CANNOT_DERIVE_KEYS); /* (CKR_MSG_ERROR + 0x81) */
164
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_REQ_SIGNATURE); /* (CKR_MSG_ERROR + 0x82) */
165
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_REPLY_SIGNATURE); /* (CKR_MSG_ERROR + 0x83) */
166
+ PKCS11_DEFINE_RETURN_VALUE(CKR_SMS_ERROR); /* (CKR_MSG_ERROR + 0x84) */
167
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_PROTECTION); /* (CKR_MSG_ERROR + 0x85) */
168
+ PKCS11_DEFINE_RETURN_VALUE(CKR_DEVICE_RESET); /* (CKR_MSG_ERROR + 0x86) */
169
+ PKCS11_DEFINE_RETURN_VALUE(CKR_NO_SESSION_KEYS); /* (CKR_MSG_ERROR + 0x87) */
170
+ PKCS11_DEFINE_RETURN_VALUE(CKR_BAD_REPLY); /* (CKR_MSG_ERROR + 0x88) */
171
+ PKCS11_DEFINE_RETURN_VALUE(CKR_KEY_ROLLOVER); /* (CKR_MSG_ERROR + 0x89) */
172
+ PKCS11_DEFINE_RETURN_VALUE(CKR_NEED_IV_UPDATE); /* (CKR_MSG_ERROR+0x10) */
173
+ PKCS11_DEFINE_RETURN_VALUE(CKR_DUPLICATE_IV_FOUND); /* (CKR_MSG_ERROR+0x11) */
174
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_ERROR); /* (CKR_VENDOR_DEFINED + 0x2000) */
175
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_NOT_FOUND); /* (CKR_WLD_ERROR) + 0x01 */
176
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_ITEM_READ_FAILED); /* (CKR_WLD_ERROR) + 0x02 */
177
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_NO_TOKEN_LABEL); /* (CKR_WLD_ERROR) + 0x03 */
178
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_TOKEN_LABEL_LEN); /* (CKR_WLD_ERROR) + 0x04 */
179
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_TOKEN_SERIAL_NUM_LEN); /* (CKR_WLD_ERROR) + 0x05 */
180
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_SLOT_DESCRIPTION_LEN); /* (CKR_WLD_ERROR) + 0x06 */
181
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_CONFIG_ITEM_FORMAT_INVALID); /* (CKR_WLD_ERROR) + 0x07 */
182
+ PKCS11_DEFINE_RETURN_VALUE(CKR_WLD_LOGIN_CACHE_INCONSISTENT); /* (CKR_WLD_ERROR) + 0x10 */
@@ -0,0 +1,206 @@
1
+ class PKCS11::ProtectServer::CK_DES_CBC_PARAMS < PKCS11::ProtectServer::CStruct
2
+ # Size of corresponding C struct in bytes
3
+ SIZEOF_STRUCT=Integer
4
+ # @return [String] Binary copy of the C struct
5
+ def to_s; end
6
+ # @return [Array<String>] Attributes of this struct
7
+ def members; end
8
+ # @return [String] accessor for iv (max 8 bytes)
9
+ attr_accessor :iv
10
+ # @return [String] accessor for data (max 8 bytes)
11
+ attr_accessor :data
12
+ end
13
+ class PKCS11::ProtectServer::CK_DES2_CBC_PARAMS < PKCS11::ProtectServer::CStruct
14
+ # Size of corresponding C struct in bytes
15
+ SIZEOF_STRUCT=Integer
16
+ # @return [String] Binary copy of the C struct
17
+ def to_s; end
18
+ # @return [Array<String>] Attributes of this struct
19
+ def members; end
20
+ # @return [String] accessor for iv (max 8 bytes)
21
+ attr_accessor :iv
22
+ # @return [String] accessor for data (max 16 bytes)
23
+ attr_accessor :data
24
+ end
25
+ class PKCS11::ProtectServer::CK_DES3_CBC_PARAMS < PKCS11::ProtectServer::CStruct
26
+ # Size of corresponding C struct in bytes
27
+ SIZEOF_STRUCT=Integer
28
+ # @return [String] Binary copy of the C struct
29
+ def to_s; end
30
+ # @return [Array<String>] Attributes of this struct
31
+ def members; end
32
+ # @return [String] accessor for iv (max 8 bytes)
33
+ attr_accessor :iv
34
+ # @return [String] accessor for data (max 24 bytes)
35
+ attr_accessor :data
36
+ end
37
+ class PKCS11::ProtectServer::CK_TIMESTAMP_PARAMS < PKCS11::ProtectServer::CStruct
38
+ # Size of corresponding C struct in bytes
39
+ SIZEOF_STRUCT=Integer
40
+ # @return [String] Binary copy of the C struct
41
+ def to_s; end
42
+ # @return [Array<String>] Attributes of this struct
43
+ def members; end
44
+ # @return [Boolean] Bool value
45
+ attr_accessor :useMilliseconds
46
+ # @return [Integer] accessor for timestampFormat (CK_ULONG)
47
+ attr_accessor :timestampFormat
48
+ end
49
+ class PKCS11::ProtectServer::CK_ATTRIBUTES < PKCS11::ProtectServer::CStruct
50
+ # Size of corresponding C struct in bytes
51
+ SIZEOF_STRUCT=Integer
52
+ # @return [String] Binary copy of the C struct
53
+ def to_s; end
54
+ # @return [Array<String>] Attributes of this struct
55
+ def members; end
56
+ # @return [Array<PKCS11::CK_ATTRIBUTE>] accessor for attributes and count
57
+ attr_accessor :attributes
58
+ end
59
+ class PKCS11::ProtectServer::CK_MECH_AND_OBJECT < PKCS11::ProtectServer::CStruct
60
+ # Size of corresponding C struct in bytes
61
+ SIZEOF_STRUCT=Integer
62
+ # @return [String] Binary copy of the C struct
63
+ def to_s; end
64
+ # @return [Array<String>] Attributes of this struct
65
+ def members; end
66
+ # @return [PKCS11::CK_MECHANISM] inline struct (see pkcs11.gem)
67
+ attr_accessor :mechanism
68
+ # @return [Integer, PKCS11::Object] Object handle (CK_ULONG)
69
+ attr_accessor :obj
70
+ end
71
+ class PKCS11::ProtectServer::CK_MECH_TYPE_AND_OBJECT < PKCS11::ProtectServer::CStruct
72
+ # Size of corresponding C struct in bytes
73
+ SIZEOF_STRUCT=Integer
74
+ # @return [String] Binary copy of the C struct
75
+ def to_s; end
76
+ # @return [Array<String>] Attributes of this struct
77
+ def members; end
78
+ # @return [Integer] accessor for mechanism (CK_ULONG)
79
+ attr_accessor :mechanism
80
+ # @return [Integer, PKCS11::Object] Object handle (CK_ULONG)
81
+ attr_accessor :obj
82
+ end
83
+ class PKCS11::ProtectServer::CK_MECH_AND_OBJECTS < PKCS11::ProtectServer::CStruct
84
+ # Size of corresponding C struct in bytes
85
+ SIZEOF_STRUCT=Integer
86
+ # @return [String] Binary copy of the C struct
87
+ def to_s; end
88
+ # @return [Array<String>] Attributes of this struct
89
+ def members; end
90
+ # @return [Array<PKCS11::CK_MECH_AND_OBJECT>] accessor for mechanism and count
91
+ attr_accessor :mechanism
92
+ end
93
+ class PKCS11::ProtectServer::CK_PKCS_7_PARAMS < PKCS11::ProtectServer::CStruct
94
+ # Size of corresponding C struct in bytes
95
+ SIZEOF_STRUCT=Integer
96
+ # @return [String] Binary copy of the C struct
97
+ def to_s; end
98
+ # @return [Array<String>] Attributes of this struct
99
+ def members; end
100
+ # @return [Integer] accessor for flags (CK_ULONG)
101
+ attr_accessor :flags
102
+ # @return [Integer] accessor for length (CK_ULONG)
103
+ attr_accessor :length
104
+ # @return [PKCS11::ProtectServer::CK_MECH_AND_OBJECTS] inline struct
105
+ attr_accessor :signature
106
+ # @return [PKCS11::ProtectServer::CK_MECH_AND_OBJECTS] inline struct
107
+ attr_accessor :encryption
108
+ # @return [PKCS11::ProtectServer::CK_ATTRIBUTES] inline struct
109
+ attr_accessor :extensions
110
+ end
111
+ class PKCS11::ProtectServer::CK_PP_LOAD_SECRET_PARAMS < PKCS11::ProtectServer::CStruct
112
+ # Size of corresponding C struct in bytes
113
+ SIZEOF_STRUCT=Integer
114
+ # @return [String] Binary copy of the C struct
115
+ def to_s; end
116
+ # @return [Array<String>] Attributes of this struct
117
+ def members; end
118
+ # @return [String, nil] accessor for prompt
119
+ attr_accessor :prompt
120
+ # @return [Boolean] Bool value
121
+ attr_accessor :bMaskInput
122
+ # @return [Integer] accessor for cConvert (CK_ULONG)
123
+ attr_accessor :cConvert
124
+ end
125
+ class PKCS11::ProtectServer::CK_REPLICATE_TOKEN_PARAMS < PKCS11::ProtectServer::CStruct
126
+ # Size of corresponding C struct in bytes
127
+ SIZEOF_STRUCT=Integer
128
+ # @return [String] Binary copy of the C struct
129
+ def to_s; end
130
+ # @return [Array<String>] Attributes of this struct
131
+ def members; end
132
+ # @return [String] accessor for peerId (max 16 bytes)
133
+ attr_accessor :peerId
134
+ end
135
+ class PKCS11::ProtectServer::CK_SECRET_SHARE_PARAMS < PKCS11::ProtectServer::CStruct
136
+ # Size of corresponding C struct in bytes
137
+ SIZEOF_STRUCT=Integer
138
+ # @return [String] Binary copy of the C struct
139
+ def to_s; end
140
+ # @return [Array<String>] Attributes of this struct
141
+ def members; end
142
+ # @return [Integer] accessor for n (CK_ULONG)
143
+ attr_accessor :n
144
+ # @return [Integer] accessor for m (CK_ULONG)
145
+ attr_accessor :m
146
+ end
147
+ class PKCS11::ProtectServer::CK_PKCS12_PBE_EXPORT_PARAMS < PKCS11::ProtectServer::CStruct
148
+ # Size of corresponding C struct in bytes
149
+ SIZEOF_STRUCT=Integer
150
+ # @return [String] Binary copy of the C struct
151
+ def to_s; end
152
+ # @return [Array<String>] Attributes of this struct
153
+ def members; end
154
+ # @return [String, nil] accessor for passwordAuthSafe and passwordAuthSafeLen
155
+ attr_accessor :passwordAuthSafe
156
+ # @return [String, nil] accessor for passwordHMAC and passwordHMACLen
157
+ attr_accessor :passwordHMAC
158
+ # @return [Integer, PKCS11::Object] Object handle (CK_ULONG)
159
+ attr_accessor :keyCert
160
+ # @return [Integer] accessor for safeBagKgMech (CK_ULONG)
161
+ attr_accessor :safeBagKgMech
162
+ # @return [Integer] accessor for safeContentKgMech (CK_ULONG)
163
+ attr_accessor :safeContentKgMech
164
+ # @return [Integer] accessor for hmacKgMech (CK_ULONG)
165
+ attr_accessor :hmacKgMech
166
+ end
167
+ class PKCS11::ProtectServer::CK_PKCS12_PBE_IMPORT_PARAMS < PKCS11::ProtectServer::CStruct
168
+ # Size of corresponding C struct in bytes
169
+ SIZEOF_STRUCT=Integer
170
+ # @return [String] Binary copy of the C struct
171
+ def to_s; end
172
+ # @return [Array<String>] Attributes of this struct
173
+ def members; end
174
+ # @return [Array<PKCS11::CK_ATTRIBUTE>] accessor for certAttr and certAttrCount
175
+ attr_accessor :certAttr
176
+ # @return [String, nil] accessor for passwordAuthSafe and passwordAuthSafeLen
177
+ attr_accessor :passwordAuthSafe
178
+ # @return [String, nil] accessor for passwordHMAC and passwordHMACLen
179
+ attr_accessor :passwordHMAC
180
+ # @return [Integer, nil] accessor for hCertCount (CK_ULONG_PTR)
181
+ attr_accessor :hCertCount
182
+ end
183
+ class PKCS11::ProtectServer::CK_ECIES_PARAMS < PKCS11::ProtectServer::CStruct
184
+ # Size of corresponding C struct in bytes
185
+ SIZEOF_STRUCT=Integer
186
+ # @return [String] Binary copy of the C struct
187
+ def to_s; end
188
+ # @return [Array<String>] Attributes of this struct
189
+ def members; end
190
+ # @return [String, nil] accessor for pSharedData1
191
+ attr_accessor :pSharedData1
192
+ # @return [String, nil] accessor for pSharedData2
193
+ attr_accessor :pSharedData2
194
+ # @return [Integer] accessor for kdf (CK_ULONG)
195
+ attr_accessor :kdf
196
+ # @return [Integer] accessor for ulSharedDataLen1 (CK_ULONG)
197
+ attr_accessor :ulSharedDataLen1
198
+ # @return [Integer] accessor for ulEncKeyLenInBits (CK_ULONG)
199
+ attr_accessor :ulEncKeyLenInBits
200
+ # @return [Integer] accessor for ulMacKeyLenInBits (CK_ULONG)
201
+ attr_accessor :ulMacKeyLenInBits
202
+ # @return [Integer] accessor for ulMacLenInBits (CK_ULONG)
203
+ attr_accessor :ulMacLenInBits
204
+ # @return [Integer] accessor for ulSharedDataLen2 (CK_ULONG)
205
+ attr_accessor :ulSharedDataLen2
206
+ end