pkcs11 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,304 @@
1
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_VERSION);
2
+ PKCS11_IMPLEMENT_BYTE_ACCESSOR(CK_VERSION, minor);
3
+ PKCS11_IMPLEMENT_BYTE_ACCESSOR(CK_VERSION, major);
4
+
5
+ PKCS11_IMPLEMENT_ALLOCATOR(CK_INFO);
6
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_INFO, flags);
7
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_INFO, manufacturerID);
8
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_INFO, CK_VERSION, cryptokiVersion);
9
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_INFO, libraryDescription);
10
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_INFO, CK_VERSION, libraryVersion);
11
+
12
+ PKCS11_IMPLEMENT_ALLOCATOR(CK_SLOT_INFO);
13
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SLOT_INFO, flags);
14
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_SLOT_INFO, manufacturerID);
15
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_SLOT_INFO, slotDescription);
16
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SLOT_INFO, CK_VERSION, firmwareVersion);
17
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SLOT_INFO, CK_VERSION, hardwareVersion);
18
+
19
+ PKCS11_IMPLEMENT_ALLOCATOR(CK_TOKEN_INFO);
20
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulSessionCount);
21
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, utcTime);
22
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulFreePublicMemory);
23
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, flags);
24
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulMinPinLen);
25
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, manufacturerID);
26
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulMaxSessionCount);
27
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulFreePrivateMemory);
28
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulRwSessionCount);
29
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulMaxRwSessionCount);
30
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulTotalPublicMemory);
31
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulTotalPrivateMemory);
32
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_TOKEN_INFO, ulMaxPinLen);
33
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, model);
34
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, label);
35
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_TOKEN_INFO, CK_VERSION, firmwareVersion);
36
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_TOKEN_INFO, serialNumber);
37
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_TOKEN_INFO, CK_VERSION, hardwareVersion);
38
+
39
+ PKCS11_IMPLEMENT_ALLOCATOR(CK_SESSION_INFO);
40
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, flags);
41
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, slotID);
42
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, state);
43
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SESSION_INFO, ulDeviceError);
44
+
45
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DATE);
46
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, month);
47
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, day);
48
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DATE, year);
49
+
50
+ PKCS11_IMPLEMENT_ALLOCATOR(CK_MECHANISM_INFO);
51
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_MECHANISM_INFO, ulMinKeySize);
52
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_MECHANISM_INFO, flags);
53
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_MECHANISM_INFO, ulMaxKeySize);
54
+
55
+ PKCS11_IMPLEMENT_ALLOCATOR(CK_C_INITIALIZE_ARGS);
56
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_C_INITIALIZE_ARGS, pReserved);
57
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_C_INITIALIZE_ARGS, flags);
58
+ /* unimplemented attr CK_UNLOCKMUTEX UnlockMutex */
59
+ /* unimplemented attr CK_DESTROYMUTEX DestroyMutex */
60
+ /* unimplemented attr CK_CREATEMUTEX CreateMutex */
61
+ /* unimplemented attr CK_LOCKMUTEX LockMutex */
62
+
63
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RSA_PKCS_OAEP_PARAMS);
64
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, pSourceData, ulSourceDataLen);
65
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, source);
66
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, mgf);
67
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_OAEP_PARAMS, hashAlg);
68
+
69
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RSA_PKCS_PSS_PARAMS);
70
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_PSS_PARAMS, mgf);
71
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_PSS_PARAMS, sLen);
72
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RSA_PKCS_PSS_PARAMS, hashAlg);
73
+
74
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECDH1_DERIVE_PARAMS);
75
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
76
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
77
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH1_DERIVE_PARAMS, kdf);
78
+
79
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECDH2_DERIVE_PARAMS);
80
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pPublicData2);
81
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
82
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
83
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, ulPublicDataLen2);
84
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, hPrivateData);
85
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, kdf);
86
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECDH2_DERIVE_PARAMS, ulPrivateDataLen);
87
+
88
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ECMQV_DERIVE_PARAMS);
89
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData2);
90
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
91
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, pSharedData, ulSharedDataLen);
92
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, publicKey);
93
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, ulPublicDataLen2);
94
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, hPrivateData);
95
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, kdf);
96
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_ECMQV_DERIVE_PARAMS, ulPrivateDataLen);
97
+
98
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_DH1_DERIVE_PARAMS);
99
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
100
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
101
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH1_DERIVE_PARAMS, kdf);
102
+
103
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_DH2_DERIVE_PARAMS);
104
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData2);
105
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
106
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
107
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, ulPublicDataLen2);
108
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, hPrivateData);
109
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, kdf);
110
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_DH2_DERIVE_PARAMS, ulPrivateDataLen);
111
+
112
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_X9_42_MQV_DERIVE_PARAMS);
113
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData2);
114
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pOtherInfo, ulOtherInfoLen);
115
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
116
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, publicKey);
117
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, ulPublicDataLen2);
118
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, hPrivateData);
119
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, kdf);
120
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_X9_42_MQV_DERIVE_PARAMS, ulPrivateDataLen);
121
+
122
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEA_DERIVE_PARAMS);
123
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomA);
124
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_KEA_DERIVE_PARAMS, pRandomB);
125
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEA_DERIVE_PARAMS, pPublicData, ulPublicDataLen);
126
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_KEA_DERIVE_PARAMS, ulRandomLen);
127
+ PKCS11_IMPLEMENT_BOOL_ACCESSOR(CK_KEA_DERIVE_PARAMS, isSender);
128
+
129
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC2_CBC_PARAMS);
130
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_CBC_PARAMS, ulEffectiveBits);
131
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_RC2_CBC_PARAMS, iv);
132
+
133
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC2_MAC_GENERAL_PARAMS);
134
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_MAC_GENERAL_PARAMS, ulMacLength);
135
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC2_MAC_GENERAL_PARAMS, ulEffectiveBits);
136
+
137
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC5_PARAMS);
138
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_PARAMS, ulRounds);
139
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_PARAMS, ulWordsize);
140
+
141
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC5_CBC_PARAMS);
142
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_RC5_CBC_PARAMS, pIv, ulIvLen);
143
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_CBC_PARAMS, ulRounds);
144
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_CBC_PARAMS, ulWordsize);
145
+
146
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_RC5_MAC_GENERAL_PARAMS);
147
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulMacLength);
148
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulRounds);
149
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_RC5_MAC_GENERAL_PARAMS, ulWordsize);
150
+
151
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS);
152
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, pData, length);
153
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_DES_CBC_ENCRYPT_DATA_PARAMS, iv);
154
+
155
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS);
156
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, pData, length);
157
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CBC_ENCRYPT_DATA_PARAMS, iv);
158
+
159
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS);
160
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pRandomA);
161
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pBaseG);
162
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPublicData, ulPublicDataLen);
163
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPassword, ulPasswordLen);
164
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPrimeP);
165
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pSubprimeQ);
166
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulQLen);
167
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulPAndGLen);
168
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulRandomLen);
169
+
170
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SKIPJACK_RELAYX_PARAMS);
171
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPassword, ulNewPasswordLen);
172
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewPublicData, ulNewPublicDataLen);
173
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldRandomA);
174
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pNewRandomA);
175
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPublicData, ulOldPublicDataLen);
176
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldPassword, ulOldPasswordLen);
177
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, pOldWrappedX, ulOldWrappedXLen);
178
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, ulOldRandomLen);
179
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SKIPJACK_RELAYX_PARAMS, ulNewRandomLen);
180
+
181
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PBE_PARAMS);
182
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pPassword, ulPasswordLen);
183
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PBE_PARAMS, pInitVector);
184
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PBE_PARAMS, pSalt, ulSaltLen);
185
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PBE_PARAMS, ulIteration);
186
+
187
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEY_WRAP_SET_OAEP_PARAMS);
188
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, pX, ulXLen);
189
+ PKCS11_IMPLEMENT_BYTE_ACCESSOR(CK_KEY_WRAP_SET_OAEP_PARAMS, bBC);
190
+
191
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_RANDOM_DATA);
192
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pClientRandom, ulClientRandomLen);
193
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_SSL3_RANDOM_DATA, pServerRandom, ulServerRandomLen);
194
+
195
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS);
196
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_SSL3_RANDOM_DATA, RandomInfo);
197
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, CK_VERSION, pVersion);
198
+
199
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_KEY_MAT_OUT);
200
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVClient);
201
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_SSL3_KEY_MAT_OUT, pIVServer);
202
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hServerKey);
203
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hServerMacSecret);
204
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hClientKey);
205
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_SSL3_KEY_MAT_OUT, hClientMacSecret);
206
+
207
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_SSL3_KEY_MAT_PARAMS);
208
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_RANDOM_DATA, RandomInfo);
209
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, ulIVSizeInBits);
210
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, ulKeySizeInBits);
211
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, ulMacSizeInBits);
212
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, CK_SSL3_KEY_MAT_OUT, pReturnedKeyMaterial);
213
+ PKCS11_IMPLEMENT_BOOL_ACCESSOR(CK_SSL3_KEY_MAT_PARAMS, bIsExport);
214
+
215
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_TLS_PRF_PARAMS);
216
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_TLS_PRF_PARAMS, pLabel, ulLabelLen);
217
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_TLS_PRF_PARAMS, pOutput);
218
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_TLS_PRF_PARAMS, pSeed, ulSeedLen);
219
+ PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_TLS_PRF_PARAMS, pulOutputLen);
220
+
221
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_RANDOM_DATA);
222
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pClientRandom, ulClientRandomLen);
223
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_RANDOM_DATA, pServerRandom, ulServerRandomLen);
224
+
225
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS);
226
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, pVersion);
227
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, DigestMechanism);
228
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, CK_WTLS_RANDOM_DATA, RandomInfo);
229
+
230
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_PRF_PARAMS);
231
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pLabel, ulLabelLen);
232
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pOutput);
233
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_WTLS_PRF_PARAMS, pSeed, ulSeedLen);
234
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_PRF_PARAMS, DigestMechanism);
235
+ PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_WTLS_PRF_PARAMS, pulOutputLen);
236
+
237
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_KEY_MAT_OUT);
238
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_WTLS_KEY_MAT_OUT, pIV);
239
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_WTLS_KEY_MAT_OUT, hMacSecret);
240
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_WTLS_KEY_MAT_OUT, hKey);
241
+
242
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_WTLS_KEY_MAT_PARAMS);
243
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, ulSequenceNumber);
244
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, DigestMechanism);
245
+ PKCS11_IMPLEMENT_STRUCT_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_RANDOM_DATA, RandomInfo);
246
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, ulIVSizeInBits);
247
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, CK_WTLS_KEY_MAT_OUT, pReturnedKeyMaterial);
248
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, ulKeySizeInBits);
249
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, ulMacSizeInBits);
250
+ PKCS11_IMPLEMENT_BOOL_ACCESSOR(CK_WTLS_KEY_MAT_PARAMS, bIsExport);
251
+
252
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CMS_SIG_PARAMS);
253
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequestedAttributes, ulRequestedAttributesLen);
254
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, pContentType);
255
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CMS_SIG_PARAMS, pRequiredAttributes, ulRequiredAttributesLen);
256
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, CK_MECHANISM, pDigestMechanism);
257
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_CMS_SIG_PARAMS, CK_MECHANISM, pSigningMechanism);
258
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_CMS_SIG_PARAMS, certificateHandle);
259
+
260
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KEY_DERIVATION_STRING_DATA);
261
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KEY_DERIVATION_STRING_DATA, pData, ulLen);
262
+
263
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_PKCS5_PBKD2_PARAMS);
264
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pSaltSourceData, ulSaltSourceDataLen);
265
+ PKCS11_IMPLEMENT_STRING_PTR_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPassword);
266
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, pPrfData, ulPrfDataLen);
267
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, saltSource);
268
+ PKCS11_IMPLEMENT_ULONG_PTR_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, ulPasswordLen);
269
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, prf);
270
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_PKCS5_PBKD2_PARAMS, iterations);
271
+
272
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_PARAM);
273
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_OTP_PARAM, pValue, ulValueLen);
274
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_OTP_PARAM, type);
275
+
276
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_PARAMS);
277
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_OTP_PARAMS, ulCount);
278
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_OTP_PARAMS, CK_OTP_PARAM, pParams);
279
+
280
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_OTP_SIGNATURE_INFO);
281
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_OTP_SIGNATURE_INFO, ulCount);
282
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_OTP_SIGNATURE_INFO, CK_OTP_PARAM, pParams);
283
+
284
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_KIP_PARAMS);
285
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_KIP_PARAMS, pSeed, ulSeedLen);
286
+ PKCS11_IMPLEMENT_STRUCT_PTR_ACCESSOR(CK_KIP_PARAMS, CK_MECHANISM, pMechanism);
287
+ PKCS11_IMPLEMENT_HANDLE_ACCESSOR(CK_KIP_PARAMS, hKey);
288
+
289
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_AES_CTR_PARAMS);
290
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_AES_CTR_PARAMS, cb);
291
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_AES_CTR_PARAMS, ulCounterBits);
292
+
293
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CAMELLIA_CTR_PARAMS);
294
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CTR_PARAMS, cb);
295
+ PKCS11_IMPLEMENT_ULONG_ACCESSOR(CK_CAMELLIA_CTR_PARAMS, ulCounterBits);
296
+
297
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS);
298
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, pData, length);
299
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, iv);
300
+
301
+ PKCS11_IMPLEMENT_STRUCT_WITH_ALLOCATOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS);
302
+ PKCS11_IMPLEMENT_STRING_PTR_LEN_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, pData, length);
303
+ PKCS11_IMPLEMENT_STRING_ACCESSOR(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, iv);
304
+
@@ -0,0 +1,411 @@
1
+ #include "pk11_thread_funcs.h"
2
+ #ifdef HAVE_RB_THREAD_BLOCKING_REGION
3
+ VALUE tbf_C_Initialize( void *data ){
4
+ struct tbr_C_Initialize_params *p = (struct tbr_C_Initialize_params*)data;
5
+ p->retval = p->func( p->params.pInitArgs );
6
+ return Qnil;
7
+ }
8
+
9
+ VALUE tbf_C_Finalize( void *data ){
10
+ struct tbr_C_Finalize_params *p = (struct tbr_C_Finalize_params*)data;
11
+ p->retval = p->func( p->params.pReserved );
12
+ return Qnil;
13
+ }
14
+
15
+ VALUE tbf_C_GetInfo( void *data ){
16
+ struct tbr_C_GetInfo_params *p = (struct tbr_C_GetInfo_params*)data;
17
+ p->retval = p->func( p->params.pInfo );
18
+ return Qnil;
19
+ }
20
+
21
+ VALUE tbf_C_GetFunctionList( void *data ){
22
+ struct tbr_C_GetFunctionList_params *p = (struct tbr_C_GetFunctionList_params*)data;
23
+ p->retval = p->func( p->params.ppFunctionList );
24
+ return Qnil;
25
+ }
26
+
27
+ VALUE tbf_C_GetSlotList( void *data ){
28
+ struct tbr_C_GetSlotList_params *p = (struct tbr_C_GetSlotList_params*)data;
29
+ p->retval = p->func( p->params.tokenPresent,p->params.pSlotList,p->params.pulCount );
30
+ return Qnil;
31
+ }
32
+
33
+ VALUE tbf_C_GetSlotInfo( void *data ){
34
+ struct tbr_C_GetSlotInfo_params *p = (struct tbr_C_GetSlotInfo_params*)data;
35
+ p->retval = p->func( p->params.slotID,p->params.pInfo );
36
+ return Qnil;
37
+ }
38
+
39
+ VALUE tbf_C_GetTokenInfo( void *data ){
40
+ struct tbr_C_GetTokenInfo_params *p = (struct tbr_C_GetTokenInfo_params*)data;
41
+ p->retval = p->func( p->params.slotID,p->params.pInfo );
42
+ return Qnil;
43
+ }
44
+
45
+ VALUE tbf_C_GetMechanismList( void *data ){
46
+ struct tbr_C_GetMechanismList_params *p = (struct tbr_C_GetMechanismList_params*)data;
47
+ p->retval = p->func( p->params.slotID,p->params.pMechanismList,p->params.pulCount );
48
+ return Qnil;
49
+ }
50
+
51
+ VALUE tbf_C_GetMechanismInfo( void *data ){
52
+ struct tbr_C_GetMechanismInfo_params *p = (struct tbr_C_GetMechanismInfo_params*)data;
53
+ p->retval = p->func( p->params.slotID,p->params.type,p->params.pInfo );
54
+ return Qnil;
55
+ }
56
+
57
+ VALUE tbf_C_InitToken( void *data ){
58
+ struct tbr_C_InitToken_params *p = (struct tbr_C_InitToken_params*)data;
59
+ p->retval = p->func( p->params.slotID,p->params.pPin,p->params.ulPinLen,p->params.pLabel );
60
+ return Qnil;
61
+ }
62
+
63
+ VALUE tbf_C_InitPIN( void *data ){
64
+ struct tbr_C_InitPIN_params *p = (struct tbr_C_InitPIN_params*)data;
65
+ p->retval = p->func( p->params.hSession,p->params.pPin,p->params.ulPinLen );
66
+ return Qnil;
67
+ }
68
+
69
+ VALUE tbf_C_SetPIN( void *data ){
70
+ struct tbr_C_SetPIN_params *p = (struct tbr_C_SetPIN_params*)data;
71
+ p->retval = p->func( p->params.hSession,p->params.pOldPin,p->params.ulOldLen,p->params.pNewPin,p->params.ulNewLen );
72
+ return Qnil;
73
+ }
74
+
75
+ VALUE tbf_C_OpenSession( void *data ){
76
+ struct tbr_C_OpenSession_params *p = (struct tbr_C_OpenSession_params*)data;
77
+ p->retval = p->func( p->params.slotID,p->params.flags,p->params.pApplication,p->params.Notify,p->params.phSession );
78
+ return Qnil;
79
+ }
80
+
81
+ VALUE tbf_C_CloseSession( void *data ){
82
+ struct tbr_C_CloseSession_params *p = (struct tbr_C_CloseSession_params*)data;
83
+ p->retval = p->func( p->params.hSession );
84
+ return Qnil;
85
+ }
86
+
87
+ VALUE tbf_C_CloseAllSessions( void *data ){
88
+ struct tbr_C_CloseAllSessions_params *p = (struct tbr_C_CloseAllSessions_params*)data;
89
+ p->retval = p->func( p->params.slotID );
90
+ return Qnil;
91
+ }
92
+
93
+ VALUE tbf_C_GetSessionInfo( void *data ){
94
+ struct tbr_C_GetSessionInfo_params *p = (struct tbr_C_GetSessionInfo_params*)data;
95
+ p->retval = p->func( p->params.hSession,p->params.pInfo );
96
+ return Qnil;
97
+ }
98
+
99
+ VALUE tbf_C_GetOperationState( void *data ){
100
+ struct tbr_C_GetOperationState_params *p = (struct tbr_C_GetOperationState_params*)data;
101
+ p->retval = p->func( p->params.hSession,p->params.pOperationState,p->params.pulOperationStateLen );
102
+ return Qnil;
103
+ }
104
+
105
+ VALUE tbf_C_SetOperationState( void *data ){
106
+ struct tbr_C_SetOperationState_params *p = (struct tbr_C_SetOperationState_params*)data;
107
+ p->retval = p->func( p->params.hSession,p->params.pOperationState,p->params.ulOperationStateLen,p->params.hEncryptionKey,p->params.hAuthenticationKey );
108
+ return Qnil;
109
+ }
110
+
111
+ VALUE tbf_C_Login( void *data ){
112
+ struct tbr_C_Login_params *p = (struct tbr_C_Login_params*)data;
113
+ p->retval = p->func( p->params.hSession,p->params.userType,p->params.pPin,p->params.ulPinLen );
114
+ return Qnil;
115
+ }
116
+
117
+ VALUE tbf_C_Logout( void *data ){
118
+ struct tbr_C_Logout_params *p = (struct tbr_C_Logout_params*)data;
119
+ p->retval = p->func( p->params.hSession );
120
+ return Qnil;
121
+ }
122
+
123
+ VALUE tbf_C_CreateObject( void *data ){
124
+ struct tbr_C_CreateObject_params *p = (struct tbr_C_CreateObject_params*)data;
125
+ p->retval = p->func( p->params.hSession,p->params.pTemplate,p->params.ulCount,p->params.phObject );
126
+ return Qnil;
127
+ }
128
+
129
+ VALUE tbf_C_CopyObject( void *data ){
130
+ struct tbr_C_CopyObject_params *p = (struct tbr_C_CopyObject_params*)data;
131
+ p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pTemplate,p->params.ulCount,p->params.phNewObject );
132
+ return Qnil;
133
+ }
134
+
135
+ VALUE tbf_C_DestroyObject( void *data ){
136
+ struct tbr_C_DestroyObject_params *p = (struct tbr_C_DestroyObject_params*)data;
137
+ p->retval = p->func( p->params.hSession,p->params.hObject );
138
+ return Qnil;
139
+ }
140
+
141
+ VALUE tbf_C_GetObjectSize( void *data ){
142
+ struct tbr_C_GetObjectSize_params *p = (struct tbr_C_GetObjectSize_params*)data;
143
+ p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pulSize );
144
+ return Qnil;
145
+ }
146
+
147
+ VALUE tbf_C_GetAttributeValue( void *data ){
148
+ struct tbr_C_GetAttributeValue_params *p = (struct tbr_C_GetAttributeValue_params*)data;
149
+ p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pTemplate,p->params.ulCount );
150
+ return Qnil;
151
+ }
152
+
153
+ VALUE tbf_C_SetAttributeValue( void *data ){
154
+ struct tbr_C_SetAttributeValue_params *p = (struct tbr_C_SetAttributeValue_params*)data;
155
+ p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pTemplate,p->params.ulCount );
156
+ return Qnil;
157
+ }
158
+
159
+ VALUE tbf_C_FindObjectsInit( void *data ){
160
+ struct tbr_C_FindObjectsInit_params *p = (struct tbr_C_FindObjectsInit_params*)data;
161
+ p->retval = p->func( p->params.hSession,p->params.pTemplate,p->params.ulCount );
162
+ return Qnil;
163
+ }
164
+
165
+ VALUE tbf_C_FindObjects( void *data ){
166
+ struct tbr_C_FindObjects_params *p = (struct tbr_C_FindObjects_params*)data;
167
+ p->retval = p->func( p->params.hSession,p->params.phObject,p->params.ulMaxObjectCount,p->params.pulObjectCount );
168
+ return Qnil;
169
+ }
170
+
171
+ VALUE tbf_C_FindObjectsFinal( void *data ){
172
+ struct tbr_C_FindObjectsFinal_params *p = (struct tbr_C_FindObjectsFinal_params*)data;
173
+ p->retval = p->func( p->params.hSession );
174
+ return Qnil;
175
+ }
176
+
177
+ VALUE tbf_C_EncryptInit( void *data ){
178
+ struct tbr_C_EncryptInit_params *p = (struct tbr_C_EncryptInit_params*)data;
179
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
180
+ return Qnil;
181
+ }
182
+
183
+ VALUE tbf_C_Encrypt( void *data ){
184
+ struct tbr_C_Encrypt_params *p = (struct tbr_C_Encrypt_params*)data;
185
+ p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pEncryptedData,p->params.pulEncryptedDataLen );
186
+ return Qnil;
187
+ }
188
+
189
+ VALUE tbf_C_EncryptUpdate( void *data ){
190
+ struct tbr_C_EncryptUpdate_params *p = (struct tbr_C_EncryptUpdate_params*)data;
191
+ p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen,p->params.pEncryptedPart,p->params.pulEncryptedPartLen );
192
+ return Qnil;
193
+ }
194
+
195
+ VALUE tbf_C_EncryptFinal( void *data ){
196
+ struct tbr_C_EncryptFinal_params *p = (struct tbr_C_EncryptFinal_params*)data;
197
+ p->retval = p->func( p->params.hSession,p->params.pLastEncryptedPart,p->params.pulLastEncryptedPartLen );
198
+ return Qnil;
199
+ }
200
+
201
+ VALUE tbf_C_DecryptInit( void *data ){
202
+ struct tbr_C_DecryptInit_params *p = (struct tbr_C_DecryptInit_params*)data;
203
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
204
+ return Qnil;
205
+ }
206
+
207
+ VALUE tbf_C_Decrypt( void *data ){
208
+ struct tbr_C_Decrypt_params *p = (struct tbr_C_Decrypt_params*)data;
209
+ p->retval = p->func( p->params.hSession,p->params.pEncryptedData,p->params.ulEncryptedDataLen,p->params.pData,p->params.pulDataLen );
210
+ return Qnil;
211
+ }
212
+
213
+ VALUE tbf_C_DecryptUpdate( void *data ){
214
+ struct tbr_C_DecryptUpdate_params *p = (struct tbr_C_DecryptUpdate_params*)data;
215
+ p->retval = p->func( p->params.hSession,p->params.pEncryptedPart,p->params.ulEncryptedPartLen,p->params.pPart,p->params.pulPartLen );
216
+ return Qnil;
217
+ }
218
+
219
+ VALUE tbf_C_DecryptFinal( void *data ){
220
+ struct tbr_C_DecryptFinal_params *p = (struct tbr_C_DecryptFinal_params*)data;
221
+ p->retval = p->func( p->params.hSession,p->params.pLastPart,p->params.pulLastPartLen );
222
+ return Qnil;
223
+ }
224
+
225
+ VALUE tbf_C_DigestInit( void *data ){
226
+ struct tbr_C_DigestInit_params *p = (struct tbr_C_DigestInit_params*)data;
227
+ p->retval = p->func( p->params.hSession,p->params.pMechanism );
228
+ return Qnil;
229
+ }
230
+
231
+ VALUE tbf_C_Digest( void *data ){
232
+ struct tbr_C_Digest_params *p = (struct tbr_C_Digest_params*)data;
233
+ p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pDigest,p->params.pulDigestLen );
234
+ return Qnil;
235
+ }
236
+
237
+ VALUE tbf_C_DigestUpdate( void *data ){
238
+ struct tbr_C_DigestUpdate_params *p = (struct tbr_C_DigestUpdate_params*)data;
239
+ p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen );
240
+ return Qnil;
241
+ }
242
+
243
+ VALUE tbf_C_DigestKey( void *data ){
244
+ struct tbr_C_DigestKey_params *p = (struct tbr_C_DigestKey_params*)data;
245
+ p->retval = p->func( p->params.hSession,p->params.hKey );
246
+ return Qnil;
247
+ }
248
+
249
+ VALUE tbf_C_DigestFinal( void *data ){
250
+ struct tbr_C_DigestFinal_params *p = (struct tbr_C_DigestFinal_params*)data;
251
+ p->retval = p->func( p->params.hSession,p->params.pDigest,p->params.pulDigestLen );
252
+ return Qnil;
253
+ }
254
+
255
+ VALUE tbf_C_SignInit( void *data ){
256
+ struct tbr_C_SignInit_params *p = (struct tbr_C_SignInit_params*)data;
257
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
258
+ return Qnil;
259
+ }
260
+
261
+ VALUE tbf_C_Sign( void *data ){
262
+ struct tbr_C_Sign_params *p = (struct tbr_C_Sign_params*)data;
263
+ p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pSignature,p->params.pulSignatureLen );
264
+ return Qnil;
265
+ }
266
+
267
+ VALUE tbf_C_SignUpdate( void *data ){
268
+ struct tbr_C_SignUpdate_params *p = (struct tbr_C_SignUpdate_params*)data;
269
+ p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen );
270
+ return Qnil;
271
+ }
272
+
273
+ VALUE tbf_C_SignFinal( void *data ){
274
+ struct tbr_C_SignFinal_params *p = (struct tbr_C_SignFinal_params*)data;
275
+ p->retval = p->func( p->params.hSession,p->params.pSignature,p->params.pulSignatureLen );
276
+ return Qnil;
277
+ }
278
+
279
+ VALUE tbf_C_SignRecoverInit( void *data ){
280
+ struct tbr_C_SignRecoverInit_params *p = (struct tbr_C_SignRecoverInit_params*)data;
281
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
282
+ return Qnil;
283
+ }
284
+
285
+ VALUE tbf_C_SignRecover( void *data ){
286
+ struct tbr_C_SignRecover_params *p = (struct tbr_C_SignRecover_params*)data;
287
+ p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pSignature,p->params.pulSignatureLen );
288
+ return Qnil;
289
+ }
290
+
291
+ VALUE tbf_C_VerifyInit( void *data ){
292
+ struct tbr_C_VerifyInit_params *p = (struct tbr_C_VerifyInit_params*)data;
293
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
294
+ return Qnil;
295
+ }
296
+
297
+ VALUE tbf_C_Verify( void *data ){
298
+ struct tbr_C_Verify_params *p = (struct tbr_C_Verify_params*)data;
299
+ p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pSignature,p->params.ulSignatureLen );
300
+ return Qnil;
301
+ }
302
+
303
+ VALUE tbf_C_VerifyUpdate( void *data ){
304
+ struct tbr_C_VerifyUpdate_params *p = (struct tbr_C_VerifyUpdate_params*)data;
305
+ p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen );
306
+ return Qnil;
307
+ }
308
+
309
+ VALUE tbf_C_VerifyFinal( void *data ){
310
+ struct tbr_C_VerifyFinal_params *p = (struct tbr_C_VerifyFinal_params*)data;
311
+ p->retval = p->func( p->params.hSession,p->params.pSignature,p->params.ulSignatureLen );
312
+ return Qnil;
313
+ }
314
+
315
+ VALUE tbf_C_VerifyRecoverInit( void *data ){
316
+ struct tbr_C_VerifyRecoverInit_params *p = (struct tbr_C_VerifyRecoverInit_params*)data;
317
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
318
+ return Qnil;
319
+ }
320
+
321
+ VALUE tbf_C_VerifyRecover( void *data ){
322
+ struct tbr_C_VerifyRecover_params *p = (struct tbr_C_VerifyRecover_params*)data;
323
+ p->retval = p->func( p->params.hSession,p->params.pSignature,p->params.ulSignatureLen,p->params.pData,p->params.pulDataLen );
324
+ return Qnil;
325
+ }
326
+
327
+ VALUE tbf_C_DigestEncryptUpdate( void *data ){
328
+ struct tbr_C_DigestEncryptUpdate_params *p = (struct tbr_C_DigestEncryptUpdate_params*)data;
329
+ p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen,p->params.pEncryptedPart,p->params.pulEncryptedPartLen );
330
+ return Qnil;
331
+ }
332
+
333
+ VALUE tbf_C_DecryptDigestUpdate( void *data ){
334
+ struct tbr_C_DecryptDigestUpdate_params *p = (struct tbr_C_DecryptDigestUpdate_params*)data;
335
+ p->retval = p->func( p->params.hSession,p->params.pEncryptedPart,p->params.ulEncryptedPartLen,p->params.pPart,p->params.pulPartLen );
336
+ return Qnil;
337
+ }
338
+
339
+ VALUE tbf_C_SignEncryptUpdate( void *data ){
340
+ struct tbr_C_SignEncryptUpdate_params *p = (struct tbr_C_SignEncryptUpdate_params*)data;
341
+ p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen,p->params.pEncryptedPart,p->params.pulEncryptedPartLen );
342
+ return Qnil;
343
+ }
344
+
345
+ VALUE tbf_C_DecryptVerifyUpdate( void *data ){
346
+ struct tbr_C_DecryptVerifyUpdate_params *p = (struct tbr_C_DecryptVerifyUpdate_params*)data;
347
+ p->retval = p->func( p->params.hSession,p->params.pEncryptedPart,p->params.ulEncryptedPartLen,p->params.pPart,p->params.pulPartLen );
348
+ return Qnil;
349
+ }
350
+
351
+ VALUE tbf_C_GenerateKey( void *data ){
352
+ struct tbr_C_GenerateKey_params *p = (struct tbr_C_GenerateKey_params*)data;
353
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.pTemplate,p->params.ulCount,p->params.phKey );
354
+ return Qnil;
355
+ }
356
+
357
+ VALUE tbf_C_GenerateKeyPair( void *data ){
358
+ struct tbr_C_GenerateKeyPair_params *p = (struct tbr_C_GenerateKeyPair_params*)data;
359
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.pPublicKeyTemplate,p->params.ulPublicKeyAttributeCount,p->params.pPrivateKeyTemplate,p->params.ulPrivateKeyAttributeCount,p->params.phPublicKey,p->params.phPrivateKey );
360
+ return Qnil;
361
+ }
362
+
363
+ VALUE tbf_C_WrapKey( void *data ){
364
+ struct tbr_C_WrapKey_params *p = (struct tbr_C_WrapKey_params*)data;
365
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hWrappingKey,p->params.hKey,p->params.pWrappedKey,p->params.pulWrappedKeyLen );
366
+ return Qnil;
367
+ }
368
+
369
+ VALUE tbf_C_UnwrapKey( void *data ){
370
+ struct tbr_C_UnwrapKey_params *p = (struct tbr_C_UnwrapKey_params*)data;
371
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hUnwrappingKey,p->params.pWrappedKey,p->params.ulWrappedKeyLen,p->params.pTemplate,p->params.ulAttributeCount,p->params.phKey );
372
+ return Qnil;
373
+ }
374
+
375
+ VALUE tbf_C_DeriveKey( void *data ){
376
+ struct tbr_C_DeriveKey_params *p = (struct tbr_C_DeriveKey_params*)data;
377
+ p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hBaseKey,p->params.pTemplate,p->params.ulAttributeCount,p->params.phKey );
378
+ return Qnil;
379
+ }
380
+
381
+ VALUE tbf_C_SeedRandom( void *data ){
382
+ struct tbr_C_SeedRandom_params *p = (struct tbr_C_SeedRandom_params*)data;
383
+ p->retval = p->func( p->params.hSession,p->params.pSeed,p->params.ulSeedLen );
384
+ return Qnil;
385
+ }
386
+
387
+ VALUE tbf_C_GenerateRandom( void *data ){
388
+ struct tbr_C_GenerateRandom_params *p = (struct tbr_C_GenerateRandom_params*)data;
389
+ p->retval = p->func( p->params.hSession,p->params.RandomData,p->params.ulRandomLen );
390
+ return Qnil;
391
+ }
392
+
393
+ VALUE tbf_C_GetFunctionStatus( void *data ){
394
+ struct tbr_C_GetFunctionStatus_params *p = (struct tbr_C_GetFunctionStatus_params*)data;
395
+ p->retval = p->func( p->params.hSession );
396
+ return Qnil;
397
+ }
398
+
399
+ VALUE tbf_C_CancelFunction( void *data ){
400
+ struct tbr_C_CancelFunction_params *p = (struct tbr_C_CancelFunction_params*)data;
401
+ p->retval = p->func( p->params.hSession );
402
+ return Qnil;
403
+ }
404
+
405
+ VALUE tbf_C_WaitForSlotEvent( void *data ){
406
+ struct tbr_C_WaitForSlotEvent_params *p = (struct tbr_C_WaitForSlotEvent_params*)data;
407
+ p->retval = p->func( p->params.flags,p->params.pSlot,p->params.pRserved );
408
+ return Qnil;
409
+ }
410
+
411
+ #endif