1
/* ***** BEGIN LICENSE BLOCK *****
2
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
4
* The contents of this file are subject to the Mozilla Public License Version
5
* 1.1 (the "License"); you may not use this file except in compliance with
6
* the License. You may obtain a copy of the License at
7
* http://www.mozilla.org/MPL/
9
* Software distributed under the License is distributed on an "AS IS" basis,
10
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
* for the specific language governing rights and limitations under the
14
* The Original Code is the Netscape security libraries.
16
* The Initial Developer of the Original Code is
17
* Netscape Communications Corporation.
18
* Portions created by the Initial Developer are Copyright (C) 1994-2000
19
* the Initial Developer. All Rights Reserved.
23
* Alternatively, the contents of this file may be used under the terms of
24
* either the GNU General Public License Version 2 or later (the "GPL"), or
25
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26
* in which case the provisions of the GPL or the LGPL are applicable instead
27
* of those above. If you wish to allow use of your version of this file only
28
* under the terms of either the GPL or the LGPL, and not to allow others to
29
* use your version of this file under the terms of the MPL, indicate your
30
* decision by deleting the provisions above and replace them with the notice
31
* and other provisions required by the GPL or the LGPL. If you do not delete
32
* the provisions above, a recipient may use your version of this file under
33
* the terms of any one of the MPL, the GPL or the LGPL.
35
* ***** END LICENSE BLOCK ***** */
40
const char *_valueString[] = {
53
"CK_C_INITIALIZE_ARGS",
57
const char **valueString = &_valueString[0];
58
const int valueCount = sizeof(_valueString)/sizeof(_valueString[0]);
60
const char *_constTypeString[] = {
83
const char **constTypeString = &_constTypeString[0];
84
const int constTypeCount = sizeof(_constTypeString)/sizeof(_constTypeString[0]);
86
#define mkEntry(x,t) { #x, x, Const##t, ConstNone }
87
#define mkEntry2(x,t,t2) { #x, x, Const##t, Const##t2 }
89
const Constant _consts[] = {
90
mkEntry(CK_FALSE, Bool),
91
mkEntry(CK_TRUE, Bool),
93
mkEntry(CKF_TOKEN_PRESENT, SlotFlags),
94
mkEntry(CKF_REMOVABLE_DEVICE, SlotFlags),
95
mkEntry(CKF_HW_SLOT, SlotFlags),
97
mkEntry(CKF_RNG, TokenFlags),
98
mkEntry(CKF_WRITE_PROTECTED, TokenFlags),
99
mkEntry(CKF_LOGIN_REQUIRED, TokenFlags),
100
mkEntry(CKF_USER_PIN_INITIALIZED, TokenFlags),
101
mkEntry(CKF_RESTORE_KEY_NOT_NEEDED, TokenFlags),
102
mkEntry(CKF_CLOCK_ON_TOKEN, TokenFlags),
103
mkEntry(CKF_PROTECTED_AUTHENTICATION_PATH, TokenFlags),
104
mkEntry(CKF_DUAL_CRYPTO_OPERATIONS, TokenFlags),
105
mkEntry(CKF_TOKEN_INITIALIZED, TokenFlags),
106
mkEntry(CKF_SECONDARY_AUTHENTICATION, TokenFlags),
107
mkEntry(CKF_USER_PIN_COUNT_LOW, TokenFlags),
108
mkEntry(CKF_USER_PIN_FINAL_TRY, TokenFlags),
109
mkEntry(CKF_USER_PIN_LOCKED, TokenFlags),
110
mkEntry(CKF_USER_PIN_TO_BE_CHANGED, TokenFlags),
111
mkEntry(CKF_SO_PIN_COUNT_LOW, TokenFlags),
112
mkEntry(CKF_SO_PIN_FINAL_TRY, TokenFlags),
113
mkEntry(CKF_SO_PIN_LOCKED, TokenFlags),
114
mkEntry(CKF_SO_PIN_TO_BE_CHANGED, TokenFlags),
116
mkEntry(CKF_RW_SESSION, SessionFlags),
117
mkEntry(CKF_SERIAL_SESSION, SessionFlags),
119
mkEntry(CKF_HW, MechanismFlags),
120
mkEntry(CKF_ENCRYPT, MechanismFlags),
121
mkEntry(CKF_DECRYPT, MechanismFlags),
122
mkEntry(CKF_DIGEST, MechanismFlags),
123
mkEntry(CKF_SIGN, MechanismFlags),
124
mkEntry(CKF_SIGN_RECOVER, MechanismFlags),
125
mkEntry(CKF_VERIFY, MechanismFlags),
126
mkEntry(CKF_VERIFY_RECOVER, MechanismFlags),
127
mkEntry(CKF_GENERATE, MechanismFlags),
128
mkEntry(CKF_GENERATE_KEY_PAIR, MechanismFlags),
129
mkEntry(CKF_WRAP, MechanismFlags),
130
mkEntry(CKF_UNWRAP, MechanismFlags),
131
mkEntry(CKF_DERIVE, MechanismFlags),
132
mkEntry(CKF_EC_FP, MechanismFlags),
133
mkEntry(CKF_EC_F_2M, MechanismFlags),
134
mkEntry(CKF_EC_ECPARAMETERS, MechanismFlags),
135
mkEntry(CKF_EC_NAMEDCURVE, MechanismFlags),
136
mkEntry(CKF_EC_UNCOMPRESS, MechanismFlags),
137
mkEntry(CKF_EC_COMPRESS, MechanismFlags),
139
mkEntry(CKF_LIBRARY_CANT_CREATE_OS_THREADS, InitializeFlags),
140
mkEntry(CKF_OS_LOCKING_OK, InitializeFlags),
142
mkEntry(CKU_SO, Users),
143
mkEntry(CKU_USER, Users),
145
mkEntry(CKS_RO_PUBLIC_SESSION, SessionState),
146
mkEntry(CKS_RO_USER_FUNCTIONS, SessionState),
147
mkEntry(CKS_RW_PUBLIC_SESSION, SessionState),
148
mkEntry(CKS_RW_USER_FUNCTIONS, SessionState),
149
mkEntry(CKS_RW_SO_FUNCTIONS, SessionState),
151
mkEntry(CKO_DATA, Object),
152
mkEntry(CKO_CERTIFICATE, Object),
153
mkEntry(CKO_PUBLIC_KEY, Object),
154
mkEntry(CKO_PRIVATE_KEY, Object),
155
mkEntry(CKO_SECRET_KEY, Object),
156
mkEntry(CKO_HW_FEATURE, Object),
157
mkEntry(CKO_DOMAIN_PARAMETERS, Object),
158
mkEntry(CKO_KG_PARAMETERS, Object),
159
mkEntry(CKO_NETSCAPE_CRL, Object),
160
mkEntry(CKO_NETSCAPE_SMIME, Object),
161
mkEntry(CKO_NETSCAPE_TRUST, Object),
162
mkEntry(CKO_NETSCAPE_BUILTIN_ROOT_LIST, Object),
164
mkEntry(CKH_MONOTONIC_COUNTER, Hardware),
165
mkEntry(CKH_CLOCK, Hardware),
167
mkEntry(CKK_RSA, KeyType),
168
mkEntry(CKK_DSA, KeyType),
169
mkEntry(CKK_DH, KeyType),
170
mkEntry(CKK_ECDSA, KeyType),
171
mkEntry(CKK_EC, KeyType),
172
mkEntry(CKK_X9_42_DH, KeyType),
173
mkEntry(CKK_KEA, KeyType),
174
mkEntry(CKK_GENERIC_SECRET, KeyType),
175
mkEntry(CKK_RC2, KeyType),
176
mkEntry(CKK_RC4, KeyType),
177
mkEntry(CKK_DES, KeyType),
178
mkEntry(CKK_DES2, KeyType),
179
mkEntry(CKK_DES3, KeyType),
180
mkEntry(CKK_CAST, KeyType),
181
mkEntry(CKK_CAST3, KeyType),
182
mkEntry(CKK_CAST5, KeyType),
183
mkEntry(CKK_CAST128, KeyType),
184
mkEntry(CKK_RC5, KeyType),
185
mkEntry(CKK_IDEA, KeyType),
186
mkEntry(CKK_SKIPJACK, KeyType),
187
mkEntry(CKK_BATON, KeyType),
188
mkEntry(CKK_JUNIPER, KeyType),
189
mkEntry(CKK_CDMF, KeyType),
190
mkEntry(CKK_AES, KeyType),
191
mkEntry(CKK_NETSCAPE_PKCS8, KeyType),
193
mkEntry(CKC_X_509, CertType),
194
mkEntry(CKC_X_509_ATTR_CERT, CertType),
196
mkEntry2(CKA_CLASS, Attribute, Object),
197
mkEntry2(CKA_TOKEN, Attribute, Bool),
198
mkEntry2(CKA_PRIVATE, Attribute, Bool),
199
mkEntry2(CKA_LABEL, Attribute, None),
200
mkEntry2(CKA_APPLICATION, Attribute, None),
201
mkEntry2(CKA_VALUE, Attribute, None),
202
mkEntry2(CKA_OBJECT_ID, Attribute, None),
203
mkEntry2(CKA_CERTIFICATE_TYPE, Attribute, CertType),
204
mkEntry2(CKA_ISSUER, Attribute, None),
205
mkEntry2(CKA_SERIAL_NUMBER, Attribute, None),
206
mkEntry2(CKA_AC_ISSUER, Attribute, None),
207
mkEntry2(CKA_OWNER, Attribute, None),
208
mkEntry2(CKA_ATTR_TYPES, Attribute, None),
209
mkEntry2(CKA_TRUSTED, Attribute, Bool),
210
mkEntry2(CKA_KEY_TYPE, Attribute, KeyType),
211
mkEntry2(CKA_SUBJECT, Attribute, None),
212
mkEntry2(CKA_ID, Attribute, None),
213
mkEntry2(CKA_SENSITIVE, Attribute, Bool),
214
mkEntry2(CKA_ENCRYPT, Attribute, Bool),
215
mkEntry2(CKA_DECRYPT, Attribute, Bool),
216
mkEntry2(CKA_WRAP, Attribute, Bool),
217
mkEntry2(CKA_UNWRAP, Attribute, Bool),
218
mkEntry2(CKA_SIGN, Attribute, Bool),
219
mkEntry2(CKA_SIGN_RECOVER, Attribute, Bool),
220
mkEntry2(CKA_VERIFY, Attribute, Bool),
221
mkEntry2(CKA_VERIFY_RECOVER, Attribute, Bool),
222
mkEntry2(CKA_DERIVE, Attribute, Bool),
223
mkEntry2(CKA_START_DATE, Attribute, None),
224
mkEntry2(CKA_END_DATE, Attribute, None),
225
mkEntry2(CKA_MODULUS, Attribute, None),
226
mkEntry2(CKA_MODULUS_BITS, Attribute, None),
227
mkEntry2(CKA_PUBLIC_EXPONENT, Attribute, None),
228
mkEntry2(CKA_PRIVATE_EXPONENT, Attribute, None),
229
mkEntry2(CKA_PRIME_1, Attribute, None),
230
mkEntry2(CKA_PRIME_2, Attribute, None),
231
mkEntry2(CKA_EXPONENT_1, Attribute, None),
232
mkEntry2(CKA_EXPONENT_2, Attribute, None),
233
mkEntry2(CKA_COEFFICIENT, Attribute, None),
234
mkEntry2(CKA_PRIME, Attribute, None),
235
mkEntry2(CKA_SUBPRIME, Attribute, None),
236
mkEntry2(CKA_BASE, Attribute, None),
237
mkEntry2(CKA_PRIME_BITS, Attribute, None),
238
mkEntry2(CKA_SUB_PRIME_BITS, Attribute, None),
239
mkEntry2(CKA_VALUE_BITS, Attribute, None),
240
mkEntry2(CKA_VALUE_LEN, Attribute, None),
241
mkEntry2(CKA_EXTRACTABLE, Attribute, Bool),
242
mkEntry2(CKA_LOCAL, Attribute, Bool),
243
mkEntry2(CKA_NEVER_EXTRACTABLE, Attribute, Bool),
244
mkEntry2(CKA_ALWAYS_SENSITIVE, Attribute, Bool),
245
mkEntry2(CKA_KEY_GEN_MECHANISM, Attribute, Mechanism),
246
mkEntry2(CKA_MODIFIABLE, Attribute, Bool),
247
mkEntry2(CKA_ECDSA_PARAMS, Attribute, None),
248
mkEntry2(CKA_EC_PARAMS, Attribute, None),
249
mkEntry2(CKA_EC_POINT, Attribute, None),
250
mkEntry2(CKA_SECONDARY_AUTH, Attribute, None),
251
mkEntry2(CKA_AUTH_PIN_FLAGS, Attribute, None),
252
mkEntry2(CKA_HW_FEATURE_TYPE, Attribute, Hardware),
253
mkEntry2(CKA_RESET_ON_INIT, Attribute, Bool),
254
mkEntry2(CKA_HAS_RESET, Attribute, Bool),
255
mkEntry2(CKA_NETSCAPE_URL, Attribute, None),
256
mkEntry2(CKA_NETSCAPE_EMAIL, Attribute, None),
257
mkEntry2(CKA_NETSCAPE_SMIME_INFO, Attribute, None),
258
mkEntry2(CKA_NETSCAPE_SMIME_TIMESTAMP, Attribute, None),
259
mkEntry2(CKA_NETSCAPE_PKCS8_SALT, Attribute, None),
260
mkEntry2(CKA_NETSCAPE_PASSWORD_CHECK, Attribute, None),
261
mkEntry2(CKA_NETSCAPE_EXPIRES, Attribute, None),
262
mkEntry2(CKA_NETSCAPE_KRL, Attribute, None),
263
mkEntry2(CKA_NETSCAPE_PQG_COUNTER, Attribute, None),
264
mkEntry2(CKA_NETSCAPE_PQG_SEED, Attribute, None),
265
mkEntry2(CKA_NETSCAPE_PQG_H, Attribute, None),
266
mkEntry2(CKA_NETSCAPE_PQG_SEED_BITS, Attribute, None),
267
mkEntry2(CKA_TRUST_DIGITAL_SIGNATURE, Attribute, Trust),
268
mkEntry2(CKA_TRUST_NON_REPUDIATION, Attribute, Trust),
269
mkEntry2(CKA_TRUST_KEY_ENCIPHERMENT, Attribute, Trust),
270
mkEntry2(CKA_TRUST_DATA_ENCIPHERMENT, Attribute, Trust),
271
mkEntry2(CKA_TRUST_KEY_AGREEMENT, Attribute, Trust),
272
mkEntry2(CKA_TRUST_KEY_CERT_SIGN, Attribute, Trust),
273
mkEntry2(CKA_TRUST_CRL_SIGN, Attribute, Trust),
274
mkEntry2(CKA_TRUST_SERVER_AUTH, Attribute, Trust),
275
mkEntry2(CKA_TRUST_CLIENT_AUTH, Attribute, Trust),
276
mkEntry2(CKA_TRUST_CODE_SIGNING, Attribute, Trust),
277
mkEntry2(CKA_TRUST_EMAIL_PROTECTION, Attribute, Trust),
278
mkEntry2(CKA_TRUST_IPSEC_END_SYSTEM, Attribute, Trust),
279
mkEntry2(CKA_TRUST_IPSEC_TUNNEL, Attribute, Trust),
280
mkEntry2(CKA_TRUST_IPSEC_USER, Attribute, Trust),
281
mkEntry2(CKA_TRUST_TIME_STAMPING, Attribute, Trust),
282
mkEntry2(CKA_CERT_SHA1_HASH, Attribute, None),
283
mkEntry2(CKA_CERT_MD5_HASH, Attribute, None),
284
mkEntry2(CKA_NETSCAPE_DB, Attribute, None),
285
mkEntry2(CKA_NETSCAPE_TRUST, Attribute, Trust),
287
mkEntry(CKM_RSA_PKCS, Mechanism),
288
mkEntry(CKM_RSA_9796, Mechanism),
289
mkEntry(CKM_RSA_X_509, Mechanism),
290
mkEntry(CKM_RSA_PKCS_KEY_PAIR_GEN, Mechanism),
291
mkEntry(CKM_MD2_RSA_PKCS, Mechanism),
292
mkEntry(CKM_MD5_RSA_PKCS, Mechanism),
293
mkEntry(CKM_SHA1_RSA_PKCS, Mechanism),
294
mkEntry(CKM_RIPEMD128_RSA_PKCS, Mechanism),
295
mkEntry(CKM_RIPEMD160_RSA_PKCS, Mechanism),
296
mkEntry(CKM_RSA_PKCS_OAEP, Mechanism),
297
mkEntry(CKM_RSA_X9_31_KEY_PAIR_GEN, Mechanism),
298
mkEntry(CKM_RSA_X9_31, Mechanism),
299
mkEntry(CKM_SHA1_RSA_X9_31, Mechanism),
300
mkEntry(CKM_DSA_KEY_PAIR_GEN, Mechanism),
301
mkEntry(CKM_DSA, Mechanism),
302
mkEntry(CKM_DSA_SHA1, Mechanism),
303
mkEntry(CKM_DH_PKCS_KEY_PAIR_GEN, Mechanism),
304
mkEntry(CKM_DH_PKCS_DERIVE, Mechanism),
305
mkEntry(CKM_X9_42_DH_DERIVE, Mechanism),
306
mkEntry(CKM_X9_42_DH_HYBRID_DERIVE, Mechanism),
307
mkEntry(CKM_X9_42_MQV_DERIVE, Mechanism),
308
mkEntry(CKM_SHA256_RSA_PKCS, Mechanism),
309
mkEntry(CKM_SHA384_RSA_PKCS, Mechanism),
310
mkEntry(CKM_SHA512_RSA_PKCS, Mechanism),
311
mkEntry(CKM_RC2_KEY_GEN, Mechanism),
312
mkEntry(CKM_RC2_ECB, Mechanism),
313
mkEntry(CKM_RC2_CBC, Mechanism),
314
mkEntry(CKM_RC2_MAC, Mechanism),
315
mkEntry(CKM_RC2_MAC_GENERAL, Mechanism),
316
mkEntry(CKM_RC2_CBC_PAD, Mechanism),
317
mkEntry(CKM_RC4_KEY_GEN, Mechanism),
318
mkEntry(CKM_RC4, Mechanism),
319
mkEntry(CKM_DES_KEY_GEN, Mechanism),
320
mkEntry(CKM_DES_ECB, Mechanism),
321
mkEntry(CKM_DES_CBC, Mechanism),
322
mkEntry(CKM_DES_MAC, Mechanism),
323
mkEntry(CKM_DES_MAC_GENERAL, Mechanism),
324
mkEntry(CKM_DES_CBC_PAD, Mechanism),
325
mkEntry(CKM_DES2_KEY_GEN, Mechanism),
326
mkEntry(CKM_DES3_KEY_GEN, Mechanism),
327
mkEntry(CKM_DES3_ECB, Mechanism),
328
mkEntry(CKM_DES3_CBC, Mechanism),
329
mkEntry(CKM_DES3_MAC, Mechanism),
330
mkEntry(CKM_DES3_MAC_GENERAL, Mechanism),
331
mkEntry(CKM_DES3_CBC_PAD, Mechanism),
332
mkEntry(CKM_CDMF_KEY_GEN, Mechanism),
333
mkEntry(CKM_CDMF_ECB, Mechanism),
334
mkEntry(CKM_CDMF_CBC, Mechanism),
335
mkEntry(CKM_CDMF_MAC, Mechanism),
336
mkEntry(CKM_CDMF_MAC_GENERAL, Mechanism),
337
mkEntry(CKM_CDMF_CBC_PAD, Mechanism),
338
mkEntry(CKM_MD2, Mechanism),
339
mkEntry(CKM_MD2_HMAC, Mechanism),
340
mkEntry(CKM_MD2_HMAC_GENERAL, Mechanism),
341
mkEntry(CKM_MD5, Mechanism),
342
mkEntry(CKM_MD5_HMAC, Mechanism),
343
mkEntry(CKM_MD5_HMAC_GENERAL, Mechanism),
344
mkEntry(CKM_SHA_1, Mechanism),
345
mkEntry(CKM_SHA_1_HMAC, Mechanism),
346
mkEntry(CKM_SHA_1_HMAC_GENERAL, Mechanism),
347
mkEntry(CKM_RIPEMD128, Mechanism),
348
mkEntry(CKM_RIPEMD128_HMAC, Mechanism),
349
mkEntry(CKM_RIPEMD128_HMAC_GENERAL, Mechanism),
350
mkEntry(CKM_RIPEMD160, Mechanism),
351
mkEntry(CKM_RIPEMD160_HMAC, Mechanism),
352
mkEntry(CKM_RIPEMD160_HMAC_GENERAL, Mechanism),
353
mkEntry(CKM_SHA256, Mechanism),
354
mkEntry(CKM_SHA256_HMAC_GENERAL, Mechanism),
355
mkEntry(CKM_SHA256_HMAC, Mechanism),
356
mkEntry(CKM_SHA384, Mechanism),
357
mkEntry(CKM_SHA384_HMAC_GENERAL, Mechanism),
358
mkEntry(CKM_SHA384_HMAC, Mechanism),
359
mkEntry(CKM_SHA512, Mechanism),
360
mkEntry(CKM_SHA512_HMAC_GENERAL, Mechanism),
361
mkEntry(CKM_SHA512_HMAC, Mechanism),
362
mkEntry(CKM_CAST_KEY_GEN, Mechanism),
363
mkEntry(CKM_CAST_ECB, Mechanism),
364
mkEntry(CKM_CAST_CBC, Mechanism),
365
mkEntry(CKM_CAST_MAC, Mechanism),
366
mkEntry(CKM_CAST_MAC_GENERAL, Mechanism),
367
mkEntry(CKM_CAST_CBC_PAD, Mechanism),
368
mkEntry(CKM_CAST3_KEY_GEN, Mechanism),
369
mkEntry(CKM_CAST3_ECB, Mechanism),
370
mkEntry(CKM_CAST3_CBC, Mechanism),
371
mkEntry(CKM_CAST3_MAC, Mechanism),
372
mkEntry(CKM_CAST3_MAC_GENERAL, Mechanism),
373
mkEntry(CKM_CAST3_CBC_PAD, Mechanism),
374
mkEntry(CKM_CAST5_KEY_GEN, Mechanism),
375
mkEntry(CKM_CAST128_KEY_GEN, Mechanism),
376
mkEntry(CKM_CAST5_ECB, Mechanism),
377
mkEntry(CKM_CAST128_ECB, Mechanism),
378
mkEntry(CKM_CAST5_CBC, Mechanism),
379
mkEntry(CKM_CAST128_CBC, Mechanism),
380
mkEntry(CKM_CAST5_MAC, Mechanism),
381
mkEntry(CKM_CAST128_MAC, Mechanism),
382
mkEntry(CKM_CAST5_MAC_GENERAL, Mechanism),
383
mkEntry(CKM_CAST128_MAC_GENERAL, Mechanism),
384
mkEntry(CKM_CAST5_CBC_PAD, Mechanism),
385
mkEntry(CKM_CAST128_CBC_PAD, Mechanism),
386
mkEntry(CKM_RC5_KEY_GEN, Mechanism),
387
mkEntry(CKM_RC5_ECB, Mechanism),
388
mkEntry(CKM_RC5_CBC, Mechanism),
389
mkEntry(CKM_RC5_MAC, Mechanism),
390
mkEntry(CKM_RC5_MAC_GENERAL, Mechanism),
391
mkEntry(CKM_RC5_CBC_PAD, Mechanism),
392
mkEntry(CKM_IDEA_KEY_GEN, Mechanism),
393
mkEntry(CKM_IDEA_ECB, Mechanism),
394
mkEntry(CKM_IDEA_CBC, Mechanism),
395
mkEntry(CKM_IDEA_MAC, Mechanism),
396
mkEntry(CKM_IDEA_MAC_GENERAL, Mechanism),
397
mkEntry(CKM_IDEA_CBC_PAD, Mechanism),
398
mkEntry(CKM_GENERIC_SECRET_KEY_GEN, Mechanism),
399
mkEntry(CKM_CONCATENATE_BASE_AND_KEY, Mechanism),
400
mkEntry(CKM_CONCATENATE_BASE_AND_DATA, Mechanism),
401
mkEntry(CKM_CONCATENATE_DATA_AND_BASE, Mechanism),
402
mkEntry(CKM_XOR_BASE_AND_DATA, Mechanism),
403
mkEntry(CKM_EXTRACT_KEY_FROM_KEY, Mechanism),
404
mkEntry(CKM_SSL3_PRE_MASTER_KEY_GEN, Mechanism),
405
mkEntry(CKM_SSL3_MASTER_KEY_DERIVE, Mechanism),
406
mkEntry(CKM_SSL3_KEY_AND_MAC_DERIVE, Mechanism),
407
mkEntry(CKM_SSL3_MASTER_KEY_DERIVE_DH, Mechanism),
408
mkEntry(CKM_TLS_PRE_MASTER_KEY_GEN, Mechanism),
409
mkEntry(CKM_TLS_MASTER_KEY_DERIVE, Mechanism),
410
mkEntry(CKM_TLS_KEY_AND_MAC_DERIVE, Mechanism),
411
mkEntry(CKM_TLS_MASTER_KEY_DERIVE_DH, Mechanism),
412
mkEntry(CKM_SSL3_MD5_MAC, Mechanism),
413
mkEntry(CKM_SSL3_SHA1_MAC, Mechanism),
414
mkEntry(CKM_MD5_KEY_DERIVATION, Mechanism),
415
mkEntry(CKM_MD2_KEY_DERIVATION, Mechanism),
416
mkEntry(CKM_SHA1_KEY_DERIVATION, Mechanism),
417
mkEntry(CKM_SHA256_KEY_DERIVATION, Mechanism),
418
mkEntry(CKM_SHA384_KEY_DERIVATION, Mechanism),
419
mkEntry(CKM_SHA512_KEY_DERIVATION, Mechanism),
420
mkEntry(CKM_PBE_MD2_DES_CBC, Mechanism),
421
mkEntry(CKM_PBE_MD5_DES_CBC, Mechanism),
422
mkEntry(CKM_PBE_MD5_CAST_CBC, Mechanism),
423
mkEntry(CKM_PBE_MD5_CAST3_CBC, Mechanism),
424
mkEntry(CKM_PBE_MD5_CAST5_CBC, Mechanism),
425
mkEntry(CKM_PBE_MD5_CAST128_CBC, Mechanism),
426
mkEntry(CKM_PBE_SHA1_CAST5_CBC, Mechanism),
427
mkEntry(CKM_PBE_SHA1_CAST128_CBC, Mechanism),
428
mkEntry(CKM_PBE_SHA1_RC4_128, Mechanism),
429
mkEntry(CKM_PBE_SHA1_RC4_40, Mechanism),
430
mkEntry(CKM_PBE_SHA1_DES3_EDE_CBC, Mechanism),
431
mkEntry(CKM_PBE_SHA1_DES2_EDE_CBC, Mechanism),
432
mkEntry(CKM_PBE_SHA1_RC2_128_CBC, Mechanism),
433
mkEntry(CKM_PBE_SHA1_RC2_40_CBC, Mechanism),
434
mkEntry(CKM_PKCS5_PBKD2, Mechanism),
435
mkEntry(CKM_PBA_SHA1_WITH_SHA1_HMAC, Mechanism),
436
mkEntry(CKM_KEY_WRAP_LYNKS, Mechanism),
437
mkEntry(CKM_KEY_WRAP_SET_OAEP, Mechanism),
438
mkEntry(CKM_SKIPJACK_KEY_GEN, Mechanism),
439
mkEntry(CKM_SKIPJACK_ECB64, Mechanism),
440
mkEntry(CKM_SKIPJACK_CBC64, Mechanism),
441
mkEntry(CKM_SKIPJACK_OFB64, Mechanism),
442
mkEntry(CKM_SKIPJACK_CFB64, Mechanism),
443
mkEntry(CKM_SKIPJACK_CFB32, Mechanism),
444
mkEntry(CKM_SKIPJACK_CFB16, Mechanism),
445
mkEntry(CKM_SKIPJACK_CFB8, Mechanism),
446
mkEntry(CKM_SKIPJACK_WRAP, Mechanism),
447
mkEntry(CKM_SKIPJACK_PRIVATE_WRAP, Mechanism),
448
mkEntry(CKM_SKIPJACK_RELAYX, Mechanism),
449
mkEntry(CKM_KEA_KEY_PAIR_GEN, Mechanism),
450
mkEntry(CKM_KEA_KEY_DERIVE, Mechanism),
451
mkEntry(CKM_FORTEZZA_TIMESTAMP, Mechanism),
452
mkEntry(CKM_BATON_KEY_GEN, Mechanism),
453
mkEntry(CKM_BATON_ECB128, Mechanism),
454
mkEntry(CKM_BATON_ECB96, Mechanism),
455
mkEntry(CKM_BATON_CBC128, Mechanism),
456
mkEntry(CKM_BATON_COUNTER, Mechanism),
457
mkEntry(CKM_BATON_SHUFFLE, Mechanism),
458
mkEntry(CKM_BATON_WRAP, Mechanism),
459
mkEntry(CKM_ECDSA_KEY_PAIR_GEN, Mechanism),
460
mkEntry(CKM_EC_KEY_PAIR_GEN, Mechanism),
461
mkEntry(CKM_ECDSA, Mechanism),
462
mkEntry(CKM_ECDSA_SHA1, Mechanism),
463
mkEntry(CKM_ECDH1_DERIVE, Mechanism),
464
mkEntry(CKM_ECDH1_COFACTOR_DERIVE, Mechanism),
465
mkEntry(CKM_ECMQV_DERIVE, Mechanism),
466
mkEntry(CKM_JUNIPER_KEY_GEN, Mechanism),
467
mkEntry(CKM_JUNIPER_ECB128, Mechanism),
468
mkEntry(CKM_JUNIPER_CBC128, Mechanism),
469
mkEntry(CKM_JUNIPER_COUNTER, Mechanism),
470
mkEntry(CKM_JUNIPER_SHUFFLE, Mechanism),
471
mkEntry(CKM_JUNIPER_WRAP, Mechanism),
472
mkEntry(CKM_FASTHASH, Mechanism),
473
mkEntry(CKM_AES_KEY_GEN, Mechanism),
474
mkEntry(CKM_AES_ECB, Mechanism),
475
mkEntry(CKM_AES_CBC, Mechanism),
476
mkEntry(CKM_AES_MAC, Mechanism),
477
mkEntry(CKM_AES_MAC_GENERAL, Mechanism),
478
mkEntry(CKM_AES_CBC_PAD, Mechanism),
479
mkEntry(CKM_DSA_PARAMETER_GEN, Mechanism),
480
mkEntry(CKM_DH_PKCS_PARAMETER_GEN, Mechanism),
481
mkEntry(CKM_NETSCAPE_AES_KEY_WRAP, Mechanism),
482
mkEntry(CKM_NETSCAPE_AES_KEY_WRAP_PAD, Mechanism),
483
mkEntry(CKM_NETSCAPE_PBE_SHA1_DES_CBC, Mechanism),
484
mkEntry(CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC, Mechanism),
485
mkEntry(CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC, Mechanism),
486
mkEntry(CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC, Mechanism),
487
mkEntry(CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4, Mechanism),
488
mkEntry(CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4, Mechanism),
489
mkEntry(CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC, Mechanism),
490
mkEntry(CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN, Mechanism),
491
mkEntry(CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN, Mechanism),
492
mkEntry(CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN, Mechanism),
493
mkEntry(CKM_TLS_PRF_GENERAL, Mechanism),
495
mkEntry(CKR_OK, Result),
496
mkEntry(CKR_CANCEL, Result),
497
mkEntry(CKR_HOST_MEMORY, Result),
498
mkEntry(CKR_SLOT_ID_INVALID, Result),
499
mkEntry(CKR_GENERAL_ERROR, Result),
500
mkEntry(CKR_FUNCTION_FAILED, Result),
501
mkEntry(CKR_ARGUMENTS_BAD, Result),
502
mkEntry(CKR_NO_EVENT, Result),
503
mkEntry(CKR_NEED_TO_CREATE_THREADS, Result),
504
mkEntry(CKR_CANT_LOCK, Result),
505
mkEntry(CKR_ATTRIBUTE_READ_ONLY, Result),
506
mkEntry(CKR_ATTRIBUTE_SENSITIVE, Result),
507
mkEntry(CKR_ATTRIBUTE_TYPE_INVALID, Result),
508
mkEntry(CKR_ATTRIBUTE_VALUE_INVALID, Result),
509
mkEntry(CKR_DATA_INVALID, Result),
510
mkEntry(CKR_DATA_LEN_RANGE, Result),
511
mkEntry(CKR_DEVICE_ERROR, Result),
512
mkEntry(CKR_DEVICE_MEMORY, Result),
513
mkEntry(CKR_DEVICE_REMOVED, Result),
514
mkEntry(CKR_ENCRYPTED_DATA_INVALID, Result),
515
mkEntry(CKR_ENCRYPTED_DATA_LEN_RANGE, Result),
516
mkEntry(CKR_FUNCTION_CANCELED, Result),
517
mkEntry(CKR_FUNCTION_NOT_PARALLEL, Result),
518
mkEntry(CKR_FUNCTION_NOT_SUPPORTED, Result),
519
mkEntry(CKR_KEY_HANDLE_INVALID, Result),
520
mkEntry(CKR_KEY_SIZE_RANGE, Result),
521
mkEntry(CKR_KEY_TYPE_INCONSISTENT, Result),
522
mkEntry(CKR_KEY_NOT_NEEDED, Result),
523
mkEntry(CKR_KEY_CHANGED, Result),
524
mkEntry(CKR_KEY_NEEDED, Result),
525
mkEntry(CKR_KEY_INDIGESTIBLE, Result),
526
mkEntry(CKR_KEY_FUNCTION_NOT_PERMITTED, Result),
527
mkEntry(CKR_KEY_NOT_WRAPPABLE, Result),
528
mkEntry(CKR_KEY_UNEXTRACTABLE, Result),
529
mkEntry(CKR_KEY_PARAMS_INVALID, Result),
530
mkEntry(CKR_MECHANISM_INVALID, Result),
531
mkEntry(CKR_MECHANISM_PARAM_INVALID, Result),
532
mkEntry(CKR_OBJECT_HANDLE_INVALID, Result),
533
mkEntry(CKR_OPERATION_ACTIVE, Result),
534
mkEntry(CKR_OPERATION_NOT_INITIALIZED, Result),
535
mkEntry(CKR_PIN_INCORRECT, Result),
536
mkEntry(CKR_PIN_INVALID, Result),
537
mkEntry(CKR_PIN_LEN_RANGE, Result),
538
mkEntry(CKR_PIN_EXPIRED, Result),
539
mkEntry(CKR_PIN_LOCKED, Result),
540
mkEntry(CKR_SESSION_CLOSED, Result),
541
mkEntry(CKR_SESSION_COUNT, Result),
542
mkEntry(CKR_SESSION_HANDLE_INVALID, Result),
543
mkEntry(CKR_SESSION_PARALLEL_NOT_SUPPORTED, Result),
544
mkEntry(CKR_SESSION_READ_ONLY, Result),
545
mkEntry(CKR_SESSION_EXISTS, Result),
546
mkEntry(CKR_SESSION_READ_ONLY_EXISTS, Result),
547
mkEntry(CKR_SESSION_READ_WRITE_SO_EXISTS, Result),
548
mkEntry(CKR_SIGNATURE_INVALID, Result),
549
mkEntry(CKR_SIGNATURE_LEN_RANGE, Result),
550
mkEntry(CKR_TEMPLATE_INCOMPLETE, Result),
551
mkEntry(CKR_TEMPLATE_INCONSISTENT, Result),
552
mkEntry(CKR_TOKEN_NOT_PRESENT, Result),
553
mkEntry(CKR_TOKEN_NOT_RECOGNIZED, Result),
554
mkEntry(CKR_TOKEN_WRITE_PROTECTED, Result),
555
mkEntry(CKR_UNWRAPPING_KEY_HANDLE_INVALID, Result),
556
mkEntry(CKR_UNWRAPPING_KEY_SIZE_RANGE, Result),
557
mkEntry(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT, Result),
558
mkEntry(CKR_USER_ALREADY_LOGGED_IN, Result),
559
mkEntry(CKR_USER_NOT_LOGGED_IN, Result),
560
mkEntry(CKR_USER_PIN_NOT_INITIALIZED, Result),
561
mkEntry(CKR_USER_TYPE_INVALID, Result),
562
mkEntry(CKR_USER_ANOTHER_ALREADY_LOGGED_IN, Result),
563
mkEntry(CKR_USER_TOO_MANY_TYPES, Result),
564
mkEntry(CKR_WRAPPED_KEY_INVALID, Result),
565
mkEntry(CKR_WRAPPED_KEY_LEN_RANGE, Result),
566
mkEntry(CKR_WRAPPING_KEY_HANDLE_INVALID, Result),
567
mkEntry(CKR_WRAPPING_KEY_SIZE_RANGE, Result),
568
mkEntry(CKR_WRAPPING_KEY_TYPE_INCONSISTENT, Result),
569
mkEntry(CKR_RANDOM_SEED_NOT_SUPPORTED, Result),
570
mkEntry(CKR_RANDOM_NO_RNG, Result),
571
mkEntry(CKR_DOMAIN_PARAMS_INVALID, Result),
572
mkEntry(CKR_BUFFER_TOO_SMALL, Result),
573
mkEntry(CKR_SAVED_STATE_INVALID, Result),
574
mkEntry(CKR_INFORMATION_SENSITIVE, Result),
575
mkEntry(CKR_STATE_UNSAVEABLE, Result),
576
mkEntry(CKR_CRYPTOKI_NOT_INITIALIZED, Result),
577
mkEntry(CKR_CRYPTOKI_ALREADY_INITIALIZED, Result),
578
mkEntry(CKR_MUTEX_BAD, Result),
579
mkEntry(CKR_MUTEX_NOT_LOCKED, Result),
580
mkEntry(CKR_VENDOR_DEFINED, Result),
582
mkEntry(CKT_NETSCAPE_TRUSTED, Trust),
583
mkEntry(CKT_NETSCAPE_TRUSTED_DELEGATOR, Trust),
584
mkEntry(CKT_NETSCAPE_UNTRUSTED, Trust),
585
mkEntry(CKT_NETSCAPE_MUST_VERIFY, Trust),
586
mkEntry(CKT_NETSCAPE_TRUST_UNKNOWN, Trust),
587
mkEntry(CKT_NETSCAPE_VALID, Trust),
588
mkEntry(CKT_NETSCAPE_VALID_DELEGATOR, Trust),
590
mkEntry(CK_EFFECTIVELY_INFINITE, AvailableSizes),
591
mkEntry(CK_UNAVAILABLE_INFORMATION, CurrentSize),
594
const Constant *consts = &_consts[0];
595
const int constCount = sizeof(_consts)/sizeof(_consts[0]);
597
const Commands _commands[] = {
598
{"C_Initialize", F_C_Initialize,
599
"C_Initialize pInitArgs\n\n"
600
"C_Initialize initializes the PKCS #11 library.\n"
601
" pInitArgs if this is not NULL_PTR it gets cast to and dereferenced\n",
602
{ArgInitializeArgs, ArgNone, ArgNone, ArgNone, ArgNone,
603
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
604
{"C_Finalize", F_C_Finalize,
605
"C_Finalize pReserved\n\n"
606
"C_Finalize indicates that an application is done with the PKCS #11 library.\n"
607
" pReserved reserved. Should be NULL_PTR\n",
608
{ArgInitializeArgs, ArgNone, ArgNone, ArgNone, ArgNone,
609
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
610
{"C_GetInfo", F_C_GetInfo,
611
"C_GetInfo pInfo\n\n"
612
"C_GetInfo returns general information about PKCS #11.\n"
613
" pInfo location that receives information\n",
614
{ArgInfo|ArgOut, ArgNone, ArgNone, ArgNone, ArgNone,
615
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
616
{"C_GetFunctionList", F_C_GetFunctionList,
617
"C_GetFunctionList ppFunctionList\n\n"
618
"C_GetFunctionList returns the function list.\n"
619
" ppFunctionList receives pointer to function list\n",
620
{ArgFunctionList|ArgOut, ArgNone, ArgNone, ArgNone, ArgNone,
621
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
622
{"C_GetSlotList", F_C_GetSlotList,
623
"C_GetSlotList tokenPresent pSlotList pulCount\n\n"
624
"C_GetSlotList obtains a list of slots in the system.\n"
625
" tokenPresent only slots with tokens?\n"
626
" pSlotList receives array of slot IDs\n"
627
" pulCount receives number of slots\n",
628
{ArgULong, ArgULong|ArgArray|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
629
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
630
{"C_GetSlotInfo", F_C_GetSlotInfo,
631
"C_GetSlotInfo slotID pInfo\n\n"
632
"C_GetSlotInfo obtains information about a particular slot in the system.\n"
633
" slotID the ID of the slot\n"
634
" pInfo receives the slot information\n",
635
{ArgULong, ArgSlotInfo|ArgOut, ArgNone, ArgNone, ArgNone,
636
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
637
{"C_GetTokenInfo", F_C_GetTokenInfo,
638
"C_GetTokenInfo slotID pInfo\n\n"
639
"C_GetTokenInfo obtains information about a particular token in the system.\n"
640
" slotID ID of the token's slot\n"
641
" pInfo receives the token information\n",
642
{ArgULong, ArgTokenInfo|ArgOut, ArgNone, ArgNone, ArgNone,
643
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
644
{"C_GetMechanismList", F_C_GetMechanismList,
645
"C_GetMechanismList slotID pMechanismList pulCount\n\n"
646
"C_GetMechanismList obtains a list of mechanism types supported by a token.\n"
647
" slotID ID of token's slot\n"
648
" pMechanismList gets mech. array\n"
649
" pulCount gets # of mechs.\n",
650
{ArgULong, ArgULong|ArgArray|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
651
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
652
{"C_GetMechanismInfo", F_C_GetMechanismInfo,
653
"C_GetMechanismInfo slotID type pInfo\n\n"
654
"C_GetMechanismInfo obtains information about a particular mechanism possibly\n"
655
"supported by a token.\n"
656
" slotID ID of the token's slot\n"
657
" type type of mechanism\n"
658
" pInfo receives mechanism info\n",
659
{ArgULong, ArgULong, ArgMechanismInfo|ArgOut, ArgNone, ArgNone,
660
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
661
{"C_InitToken", F_C_InitToken,
662
"C_InitToken slotID pPin ulPinLen pLabel\n\n"
663
"C_InitToken initializes a token.\n"
664
" slotID ID of the token's slot\n"
665
" pPin the SO's initial PIN\n"
666
" ulPinLen length in bytes of the PIN\n"
667
" pLabel 32-byte token label (blank padded)\n",
668
{ArgULong, ArgUTF8, ArgULong, ArgUTF8, ArgNone,
669
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
670
{"C_InitPIN", F_C_InitPIN,
671
"C_InitPIN hSession pPin ulPinLen\n\n"
672
"C_InitPIN initializes the normal user's PIN.\n"
673
" hSession the session's handle\n"
674
" pPin the normal user's PIN\n"
675
" ulPinLen length in bytes of the PIN\n",
676
{ArgULong, ArgUTF8, ArgULong, ArgNone, ArgNone,
677
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
678
{"C_SetPIN", F_C_SetPIN,
679
"C_SetPIN hSession pOldPin ulOldLen pNewPin ulNewLen\n\n"
680
"C_SetPIN modifies the PIN of the user who is logged in.\n"
681
" hSession the session's handle\n"
682
" pOldPin the old PIN\n"
683
" ulOldLen length of the old PIN\n"
684
" pNewPin the new PIN\n"
685
" ulNewLen length of the new PIN\n",
686
{ArgULong, ArgUTF8, ArgULong, ArgUTF8, ArgULong,
687
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
688
{"C_OpenSession", F_C_OpenSession,
689
"C_OpenSession slotID flags phSession\n\n"
690
"C_OpenSession opens a session between an application and a token.\n"
691
" slotID the slot's ID\n"
693
" phSession gets session handle\n",
694
{ArgULong, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone,
695
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
696
{"C_CloseSession", F_C_CloseSession,
697
"C_CloseSession hSession\n\n"
698
"C_CloseSession closes a session between an application and a token.\n"
699
" hSession the session's handle\n",
700
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
701
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
702
{"C_CloseAllSessions", F_C_CloseAllSessions,
703
"C_CloseAllSessions slotID\n\n"
704
"C_CloseAllSessions closes all sessions with a token.\n"
705
" slotID the token's slot\n",
706
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
707
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
708
{"C_GetSessionInfo", F_C_GetSessionInfo,
709
"C_GetSessionInfo hSession pInfo\n\n"
710
"C_GetSessionInfo obtains information about the session.\n"
711
" hSession the session's handle\n"
712
" pInfo receives session info\n",
713
{ArgULong, ArgSessionInfo|ArgOut, ArgNone, ArgNone, ArgNone,
714
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
715
{"C_GetOperationState", F_C_GetOperationState,
716
"C_GetOperationState hSession pOpState pulOpStateLen\n\n"
717
"C_GetOperationState obtains the state of the cryptographic operation in a\n"
719
" hSession session's handle\n"
720
" pOpState gets state\n"
721
" pulOpStateLen gets state length\n",
722
{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
723
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
724
{"C_SetOperationState", F_C_SetOperationState,
725
"C_SetOperationState hSession pOpState ulOpStateLen hEncKey hAuthKey\n\n"
726
"C_SetOperationState restores the state of the cryptographic operation in a\n"
728
" hSession session's handle\n"
729
" pOpState holds state\n"
730
" ulOpStateLen holds state length\n"
731
" hEncKey en/decryption key\n"
732
" hAuthnKey sign/verify key\n",
733
{ArgULong, ArgChar|ArgOut, ArgULong, ArgULong, ArgULong,
734
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
735
{"C_Login", F_C_Login,
736
"C_Login hSession userType pPin ulPinLen\n\n"
737
"C_Login logs a user into a token.\n"
738
" hSession the session's handle\n"
739
" userType the user type\n"
740
" pPin the user's PIN\n"
741
" ulPinLen the length of the PIN\n",
742
{ArgULong, ArgULong, ArgVar, ArgULong, ArgNone,
743
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
744
{"C_Logout", F_C_Logout,
745
"C_Logout hSession\n\n"
746
"C_Logout logs a user out from a token.\n"
747
" hSession the session's handle\n",
748
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
749
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
750
{"C_CreateObject", F_C_CreateObject,
751
"C_CreateObject hSession pTemplate ulCount phObject\n\n"
752
"C_CreateObject creates a new object.\n"
753
" hSession the session's handle\n"
754
" pTemplate the object's template\n"
755
" ulCount attributes in template\n"
756
" phObject gets new object's handle.\n",
757
{ArgULong, ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut, ArgNone,
758
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
759
{"C_CopyObject", F_C_CopyObject,
760
"C_CopyObject hSession hObject pTemplate ulCount phNewObject\n\n"
761
"C_CopyObject copies an object creating a new object for the copy.\n"
762
" hSession the session's handle\n"
763
" hObject the object's handle\n"
764
" pTemplate template for new object\n"
765
" ulCount attributes in template\n"
766
" phNewObject receives handle of copy\n",
767
{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut,
768
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
769
{"C_DestroyObject", F_C_DestroyObject,
770
"C_DestroyObject hSession hObject\n\n"
771
"C_DestroyObject destroys an object.\n"
772
" hSession the session's handle\n"
773
" hObject the object's handle\n",
774
{ArgULong, ArgULong, ArgNone, ArgNone, ArgNone,
775
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
776
{"C_GetObjectSize", F_C_GetObjectSize,
777
"C_GetObjectSize hSession hObject pulSize\n\n"
778
"C_GetObjectSize gets the size of an object in bytes.\n"
779
" hSession the session's handle\n"
780
" hObject the object's handle\n"
781
" pulSize receives size of object\n",
782
{ArgULong, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone,
783
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
784
{"C_GetAttributeValue", F_C_GetAttributeValue,
785
"C_GetAttributeValue hSession hObject pTemplate ulCount\n\n"
786
"C_GetAttributeValue obtains the value of one or more object attributes.\n"
787
" hSession the session's handle\n"
788
" hObject the object's handle\n"
789
" pTemplate specifies attrs; gets vals\n"
790
" ulCount attributes in template\n",
791
{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone,
792
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
793
{"C_SetAttributeValue", F_C_SetAttributeValue,
794
"C_SetAttributeValue hSession hObject pTemplate ulCount\n\n"
795
"C_SetAttributeValue modifies the value of one or more object attributes\n"
796
" hSession the session's handle\n"
797
" hObject the object's handle\n"
798
" pTemplate specifies attrs and values\n"
799
" ulCount attributes in template\n",
800
{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone,
801
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
802
{"C_FindObjectsInit", F_C_FindObjectsInit,
803
"C_FindObjectsInit hSession pTemplate ulCount\n\n"
804
"C_FindObjectsInit initializes a search for token and session objects that\n"
805
"match a template.\n"
806
" hSession the session's handle\n"
807
" pTemplate attribute values to match\n"
808
" ulCount attrs in search template\n",
809
{ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone, ArgNone,
810
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
811
{"C_FindObjectsFinal", F_C_FindObjectsFinal,
812
"C_FindObjectsFinal hSession\n\n"
813
"C_FindObjectsFinal finishes a search for token and session objects.\n"
814
" hSession the session's handle\n",
815
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
816
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
817
{"C_FindObjects", F_C_FindObjects,
818
"C_FindObjects hSession phObject ulMaxObjectCount pulObjectCount\n\n"
819
"C_FindObjects continues a search for token and session objects that match\n"
820
"a template obtaining additional object handles.\n"
821
" hSession session's handle\n"
822
" phObject gets obj. handles\n"
823
" ulMaxObjectCount max handles to get\n"
824
" pulObjectCount actual # returned\n",
825
{ArgULong, ArgULong|ArgOut, ArgULong, ArgULong|ArgOut, ArgNone,
826
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
827
{"C_EncryptInit", F_C_EncryptInit,
828
"C_EncryptInit hSession pMechanism hKey\n\n"
829
"C_EncryptInit initializes an encryption operation.\n"
830
" hSession the session's handle\n"
831
" pMechanism the encryption mechanism\n"
832
" hKey handle of encryption key\n",
833
{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
834
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
835
{"C_EncryptUpdate", F_C_EncryptUpdate,
836
"C_EncryptUpdate hSession pPart ulPartLen pEncryptedPart pulEncryptedPartLen\n"
838
"C_EncryptUpdate continues a multiple-part encryption operation.\n"
839
" hSession session's handle\n"
840
" pPart the plaintext data\n"
841
" ulPartLen plaintext data len\n"
842
" pEncryptedPart gets ciphertext\n"
843
" pulEncryptedPartLen gets c-text size\n",
844
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
845
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
846
{"C_EncryptFinal", F_C_EncryptFinal,
847
"C_EncryptFinal hSession pLastEncryptedPart pulLastEncryptedPartLen\n\n"
848
"C_EncryptFinal finishes a multiple-part encryption operation.\n"
849
" hSession session handle\n"
850
" pLastEncryptedPart last c-text\n"
851
" pulLastEncryptedPartLen gets last size\n",
852
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
853
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
854
{"C_Encrypt", F_C_Encrypt,
855
"C_Encrypt hSession pData ulDataLen pEncryptedData pulEncryptedDataLen\n\n"
856
"C_Encrypt encrypts single-part data.\n"
857
" hSession session's handle\n"
858
" pData the plaintext data\n"
859
" ulDataLen bytes of plaintext\n"
860
" pEncryptedData gets ciphertext\n"
861
" pulEncryptedDataLen gets c-text size\n",
862
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
863
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
864
{"C_DecryptInit", F_C_DecryptInit,
865
"C_DecryptInit hSession pMechanism hKey\n\n"
866
"C_DecryptInit initializes a decryption operation.\n"
867
" hSession the session's handle\n"
868
" pMechanism the decryption mechanism\n"
869
" hKey handle of decryption key\n",
870
{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
871
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
872
{"C_DecryptUpdate", F_C_DecryptUpdate,
873
"C_DecryptUpdate hSession pEncryptedPart ulEncryptedPartLen pPart pulPartLen\n"
875
"C_DecryptUpdate continues a multiple-part decryption operation.\n"
876
" hSession session's handle\n"
877
" pEncryptedPart encrypted data\n"
878
" ulEncryptedPartLen input length\n"
879
" pPart gets plaintext\n"
880
" pulPartLen p-text size\n",
881
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
882
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
883
{"C_DecryptFinal", F_C_DecryptFinal,
884
"C_DecryptFinal hSession pLastPart pulLastPartLen\n\n"
885
"C_DecryptFinal finishes a multiple-part decryption operation.\n"
886
" hSession the session's handle\n"
887
" pLastPart gets plaintext\n"
888
" pulLastPartLen p-text size\n",
889
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
890
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
891
{"C_Decrypt", F_C_Decrypt,
892
"C_Decrypt hSession pEncryptedData ulEncryptedDataLen pData pulDataLen\n\n"
893
"C_Decrypt decrypts encrypted data in a single part.\n"
894
" hSession session's handle\n"
895
" pEncryptedData ciphertext\n"
896
" ulEncryptedDataLen ciphertext length\n"
897
" pData gets plaintext\n"
898
" pulDataLen gets p-text size\n",
899
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
900
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
901
{"C_DigestInit", F_C_DigestInit,
902
"C_DigestInit hSession pMechanism\n\n"
903
"C_DigestInit initializes a message-digesting operation.\n"
904
" hSession the session's handle\n"
905
" pMechanism the digesting mechanism\n",
906
{ArgULong, ArgMechanism, ArgNone, ArgNone, ArgNone,
907
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
908
{"C_DigestUpdate", F_C_DigestUpdate,
909
"C_DigestUpdate hSession pPart ulPartLen\n\n"
910
"C_DigestUpdate continues a multiple-part message-digesting operation.\n"
911
" hSession the session's handle\n"
912
" pPart data to be digested\n"
913
" ulPartLen bytes of data to be digested\n",
914
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
915
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
916
{"C_DigestKey", F_C_DigestKey,
917
"C_DigestKey hSession hKey\n\n"
918
"C_DigestKey continues a multi-part message-digesting operation by digesting\n"
919
"the value of a secret key as part of the data already digested.\n"
920
" hSession the session's handle\n"
921
" hKey secret key to digest\n",
922
{ArgULong, ArgULong, ArgNone, ArgNone, ArgNone,
923
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
924
{"C_DigestFinal", F_C_DigestFinal,
925
"C_DigestFinal hSession pDigest pulDigestLen\n\n"
926
"C_DigestFinal finishes a multiple-part message-digesting operation.\n"
927
" hSession the session's handle\n"
928
" pDigest gets the message digest\n"
929
" pulDigestLen gets byte count of digest\n",
930
{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
931
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
932
{"C_Digest", F_C_Digest,
933
"C_Digest hSession pData ulDataLen pDigest pulDigestLen\n\n"
934
"C_Digest digests data in a single part.\n"
935
" hSession the session's handle\n"
936
" pData data to be digested\n"
937
" ulDataLen bytes of data to digest\n"
938
" pDigest gets the message digest\n"
939
" pulDigestLen gets digest length\n",
940
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
941
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
942
{"C_SignInit", F_C_SignInit,
943
"C_SignInit hSession pMechanism hKey\n\n"
944
"C_SignInit initializes a signature (private key encryption operation where\n"
945
"the signature is (will be) an appendix to the data and plaintext cannot be\n"
946
"recovered from the signature.\n"
947
" hSession the session's handle\n"
948
" pMechanism the signature mechanism\n"
949
" hKey handle of signature key\n",
950
{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
951
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
952
{"C_SignUpdate", F_C_SignUpdate,
953
"C_SignUpdate hSession pPart ulPartLen\n\n"
954
"C_SignUpdate continues a multiple-part signature operation where the\n"
955
"signature is (will be) an appendix to the data and plaintext cannot be\n"
956
"recovered from the signature.\n"
957
" hSession the session's handle\n"
958
" pPart the data to sign\n"
959
" ulPartLen count of bytes to sign\n",
960
{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
961
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
962
{"C_SignFinal", F_C_SignFinal,
963
"C_SignFinal hSession pSignature pulSignatureLen\n\n"
964
"C_SignFinal finishes a multiple-part signature operation returning the\n"
966
" hSession the session's handle\n"
967
" pSignature gets the signature\n"
968
" pulSignatureLen gets signature length\n",
969
{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
970
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
971
{"C_SignRecoverInit", F_C_SignRecoverInit,
972
"C_SignRecoverInit hSession pMechanism hKey\n\n"
973
"C_SignRecoverInit initializes a signature operation where the data can be\n"
974
"recovered from the signature.\n"
975
" hSession the session's handle\n"
976
" pMechanism the signature mechanism\n"
977
" hKey handle of the signature key\n",
978
{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
979
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
980
{"C_SignRecover", F_C_SignRecover,
981
"C_SignRecover hSession pData ulDataLen pSignature pulSignatureLen\n\n"
982
"C_SignRecover signs data in a single operation where the data can be\n"
983
"recovered from the signature.\n"
984
" hSession the session's handle\n"
985
" pData the data to sign\n"
986
" ulDataLen count of bytes to sign\n"
987
" pSignature gets the signature\n"
988
" pulSignatureLen gets signature length\n",
989
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
990
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
992
"C_Sign hSession pData ulDataLen pSignature pulSignatureLen\n\n"
993
"C_Sign signs (encrypts with private key) data in a single part where the\n"
994
"signature is (will be) an appendix to the data and plaintext cannot be\n"
995
"recovered from the signature.\n"
996
" hSession the session's handle\n"
997
" pData the data to sign\n"
998
" ulDataLen count of bytes to sign\n"
999
" pSignature gets the signature\n"
1000
" pulSignatureLen gets signature length\n",
1001
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1002
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1003
{"C_VerifyInit", F_C_VerifyInit,
1004
"C_VerifyInit hSession pMechanism hKey\n\n"
1005
"C_VerifyInit initializes a verification operation where the signature is an\n"
1006
"appendix to the data and plaintext cannot cannot be recovered from the\n"
1007
"signature (e.g. DSA).\n"
1008
" hSession the session's handle\n"
1009
" pMechanism the verification mechanism\n"
1010
" hKey verification key\n",
1011
{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
1012
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1013
{"C_VerifyUpdate", F_C_VerifyUpdate,
1014
"C_VerifyUpdate hSession pPart ulPartLen\n\n"
1015
"C_VerifyUpdate continues a multiple-part verification operation where the\n"
1016
"signature is an appendix to the data and plaintext cannot be recovered from\n"
1018
" hSession the session's handle\n"
1019
" pPart signed data\n"
1020
" ulPartLen length of signed data\n",
1021
{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
1022
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1023
{"C_VerifyFinal", F_C_VerifyFinal,
1024
"C_VerifyFinal hSession pSignature ulSignatureLen\n\n"
1025
"C_VerifyFinal finishes a multiple-part verification operation checking the\n"
1027
" hSession the session's handle\n"
1028
" pSignature signature to verify\n"
1029
" ulSignatureLen signature length\n",
1030
{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
1031
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1032
{"C_VerifyRecoverInit", F_C_VerifyRecoverInit,
1033
"C_VerifyRecoverInit hSession pMechanism hKey\n\n"
1034
"C_VerifyRecoverInit initializes a signature verification operation where the\n"
1035
"data is recovered from the signature.\n"
1036
" hSession the session's handle\n"
1037
" pMechanism the verification mechanism\n"
1038
" hKey verification key\n",
1039
{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
1040
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1041
{"C_VerifyRecover", F_C_VerifyRecover,
1042
"C_VerifyRecover hSession pSignature ulSignatureLen pData pulDataLen\n\n"
1043
"C_VerifyRecover verifies a signature in a single-part operation where the\n"
1044
"data is recovered from the signature.\n"
1045
" hSession the session's handle\n"
1046
" pSignature signature to verify\n"
1047
" ulSignatureLen signature length\n"
1048
" pData gets signed data\n"
1049
" pulDataLen gets signed data len\n",
1050
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1051
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1052
{"C_Verify", F_C_Verify,
1053
"C_Verify hSession pData ulDataLen pSignature ulSignatureLen\n\n"
1054
"C_Verify verifies a signature in a single-part operation where the signature\n"
1055
"is an appendix to the data and plaintext cannot be recovered from the\n"
1057
" hSession the session's handle\n"
1058
" pData signed data\n"
1059
" ulDataLen length of signed data\n"
1060
" pSignature signature\n"
1061
" ulSignatureLen signature length*/\n",
1062
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1063
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1064
{"C_DigestEncryptUpdate", F_C_DigestEncryptUpdate,
1065
"C_DigestEncryptUpdate hSession pPart ulPartLen pEncryptedPart \\\n"
1066
" pulEncryptedPartLen\n\n"
1067
"C_DigestEncryptUpdate continues a multiple-part digesting and encryption\n"
1069
" hSession session's handle\n"
1070
" pPart the plaintext data\n"
1071
" ulPartLen plaintext length\n"
1072
" pEncryptedPart gets ciphertext\n"
1073
" pulEncryptedPartLen gets c-text length\n",
1074
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1075
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1076
{"C_DecryptDigestUpdate", F_C_DecryptDigestUpdate,
1077
"C_DecryptDigestUpdate hSession pEncryptedPart ulEncryptedPartLen pPart \\\n"
1079
"C_DecryptDigestUpdate continues a multiple-part decryption and digesting\n"
1081
" hSession session's handle\n"
1082
" pEncryptedPart ciphertext\n"
1083
" ulEncryptedPartLen ciphertext length\n"
1084
" pPart gets plaintext\n"
1085
" pulPartLen gets plaintext len\n",
1086
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1087
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1088
{"C_SignEncryptUpdate", F_C_SignEncryptUpdate,
1089
"C_SignEncryptUpdate hSession pPart ulPartLen pEncryptedPart \\\n"
1090
" pulEncryptedPartLen\n\n"
1091
"C_SignEncryptUpdate continues a multiple-part signing and encryption\n"
1093
" hSession session's handle\n"
1094
" pPart the plaintext data\n"
1095
" ulPartLen plaintext length\n"
1096
" pEncryptedPart gets ciphertext\n"
1097
" pulEncryptedPartLen gets c-text length\n",
1098
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1099
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1100
{"C_DecryptVerifyUpdate", F_C_DecryptVerifyUpdate,
1101
"C_DecryptVerifyUpdate hSession pEncryptedPart ulEncryptedPartLen pPart \\\n"
1103
"C_DecryptVerifyUpdate continues a multiple-part decryption and verify\n"
1105
" hSession session's handle\n"
1106
" pEncryptedPart ciphertext\n"
1107
" ulEncryptedPartLen ciphertext length\n"
1108
" pPart gets plaintext\n"
1109
" pulPartLen gets p-text length\n",
1110
{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1111
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1112
{"C_GenerateKeyPair", F_C_GenerateKeyPair,
1113
"C_GenerateKeyPair hSession pMechanism pPublicKeyTemplate \\\n"
1114
" ulPublicKeyAttributeCount pPrivateKeyTemplate ulPrivateKeyAttributeCount \\\n"
1115
" phPublicKey phPrivateKey\n\n"
1116
"C_GenerateKeyPair generates a public-key/private-key pair creating new key\n"
1118
" hSession sessionhandle\n"
1119
" pMechanism key-genmech.\n"
1120
" pPublicKeyTemplate templatefor pub. key\n"
1121
" ulPublicKeyAttributeCount # pub. attrs.\n"
1122
" pPrivateKeyTemplate templatefor priv. key\n"
1123
" ulPrivateKeyAttributeCount # priv. attrs.\n"
1124
" phPublicKey gets pub. keyhandle\n"
1125
" phPrivateKey getspriv. keyhandle\n",
1126
{ArgULong, ArgMechanism, ArgAttribute|ArgArray, ArgULong,
1127
ArgAttribute|ArgArray,
1128
ArgULong, ArgULong|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone }},
1129
{"C_GenerateKey", F_C_GenerateKey,
1130
"C_GenerateKey hSession pMechanism pTemplate ulCount phKey\n\n"
1131
"C_GenerateKey generates a secret key creating a new key object.\n"
1132
" hSession the session's handle\n"
1133
" pMechanism key generation mech.\n"
1134
" pTemplate template for new key\n"
1135
" ulCount # of attrs in template\n"
1136
" phKey gets handle of new key\n",
1137
{ArgULong, ArgMechanism, ArgAttribute|ArgArray, ArgULong,
1139
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1140
{"C_WrapKey", F_C_WrapKey,
1141
"C_WrapKey hSession pMechanism hWrappingKey hKey pWrappedKey pulWrappedKeyLen\n\n"
1142
"C_WrapKey wraps (i.e. encrypts) a key.\n"
1143
" hSession the session's handle\n"
1144
" pMechanism the wrapping mechanism\n"
1145
" hWrappingKey wrapping key\n"
1146
" hKey key to be wrapped\n"
1147
" pWrappedKey gets wrapped key\n"
1148
" pulWrappedKeyLen gets wrapped key size\n",
1149
{ArgULong, ArgMechanism, ArgULong, ArgULong, ArgULong,
1150
ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone, ArgNone }},
1151
{"C_UnwrapKey", F_C_UnwrapKey,
1152
"C_UnwrapKey hSession pMechanism hUnwrappingKey pWrappedKey ulWrappedKeyLen \\\n"
1153
" pTemplate ulAttributeCount phKey\n\n"
1154
"C_UnwrapKey unwraps (decrypts) a wrapped key creating a new key object.\n"
1155
" hSession session's handle\n"
1156
" pMechanism unwrapping mech.\n"
1157
" hUnwrappingKey unwrapping key\n"
1158
" pWrappedKey the wrapped key\n"
1159
" ulWrappedKeyLen wrapped key len\n"
1160
" pTemplate new key template\n"
1161
" ulAttributeCount template length\n"
1162
" phKey gets new handle\n",
1163
{ArgULong, ArgMechanism, ArgULong, ArgChar, ArgULong,
1164
ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone }},
1165
{"C_DeriveKey", F_C_DeriveKey,
1166
"C_DeriveKey hSession pMechanism hBaseKey pTemplate ulAttributeCount phKey\n\n"
1167
"C_DeriveKey derives a key from a base key creating a new key object.\n"
1168
" hSession session's handle\n"
1169
" pMechanism key deriv. mech.\n"
1170
" hBaseKey base key\n"
1171
" pTemplate new key template\n"
1172
" ulAttributeCount template length\n"
1173
" phKey gets new handle\n",
1174
{ArgULong, ArgMechanism, ArgULong, ArgAttribute|ArgArray, ArgULong,
1175
ArgULong|ArgOut, ArgNone, ArgNone, ArgNone, ArgNone }},
1176
{"C_SeedRandom", F_C_SeedRandom,
1177
"C_SeedRandom hSession pSeed ulSeedLen\n\n"
1178
"C_SeedRandom mixes additional seed material into the token's random number\n"
1180
" hSession the session's handle\n"
1181
" pSeed the seed material\n"
1182
" ulSeedLen length of seed material\n",
1183
{ArgULong, ArgChar, ArgULong, ArgNone, ArgNone,
1184
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1185
{"C_GenerateRandom", F_C_GenerateRandom,
1186
"C_GenerateRandom hSession RandomData ulRandomLen\n\n"
1187
"C_GenerateRandom generates random data.\n"
1188
" hSession the session's handle\n"
1189
" RandomData receives the random data\n"
1190
" ulRandomLen # of bytes to generate\n",
1191
{ArgULong, ArgChar, ArgULong, ArgNone, ArgNone,
1192
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1193
{"C_GetFunctionStatus", F_C_GetFunctionStatus,
1194
"C_GetFunctionStatus hSession\n\n"
1195
"C_GetFunctionStatus is a legacy function; it obtains an updated status of\n"
1196
"a function running in parallel with an application.\n"
1197
" hSession the session's handle\n",
1198
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
1199
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1200
{"C_CancelFunction", F_C_CancelFunction,
1201
"C_CancelFunction hSession\n\n"
1202
"C_CancelFunction is a legacy function; it cancels a function running in\n"
1204
" hSession the session's handle\n",
1205
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
1206
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1207
{"C_WaitForSlotEvent", F_C_WaitForSlotEvent,
1208
"C_WaitForSlotEvent flags pSlot pRserved\n\n"
1209
"C_WaitForSlotEvent waits for a slot event (token insertion removal etc.)\n"
1211
" flags blocking/nonblocking flag\n"
1212
" pSlot location that receives the slot ID\n"
1213
" pRserved reserved. Should be NULL_PTR\n",
1214
{ArgULong, ArgULong|ArgArray, ArgVar, ArgNone, ArgNone,
1215
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1216
{"NewArray", F_NewArray,
1217
"NewArray varName varType array size\n\n"
1218
"Creates a new array variable.\n"
1219
" varName variable name of the new array\n"
1220
" varType data type of the new array\n"
1221
" size number of elements in the array\n",
1222
{ArgVar|ArgNew, ArgVar, ArgULong, ArgNone, ArgNone,
1223
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1224
{"NewInitArg", F_NewInitializeArgs,
1225
"NewInitArg varName string\n\n"
1226
"Creates a new init variable.\n"
1227
" varName variable name of the new initArg\n"
1228
" string string parameter for init arg\n",
1229
{ArgVar|ArgNew, ArgULong, ArgVar|ArgNew, ArgNone, ArgNone,
1230
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1231
{"NewTemplate", F_NewTemplate,
1232
"NewTemplate varName attributeList\n\n"
1233
"Create a new empty template and populate the attribute list\n"
1234
" varName variable name of the new template\n"
1235
" attributeList comma separated list of CKA_ATTRIBUTE types\n",
1236
{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone,
1237
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1238
{"NewMechanism", F_NewMechanism,
1239
"NewMechanism varName mechanismType\n\n"
1240
"Create a new CK_MECHANISM object with type NULL paramters and specified type\n"
1241
" varName variable name of the new mechansim\n"
1242
" mechanismType CKM_ mechanism type value to set int the type field\n",
1243
{ArgVar|ArgNew, ArgULong, ArgNone, ArgNone, ArgNone,
1244
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1245
{"BuildTemplate", F_BuildTemplate,
1246
"BuildTemplate template\n\n"
1247
"Allocates space for the value in a template which has the sizes filled in,\n"
1248
"but no values allocated yet.\n"
1249
" template variable name of the template\n",
1250
{ArgAttribute, ArgNone, ArgNone, ArgNone, ArgNone,
1251
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1252
{"SetTemplate", F_SetTemplate,
1253
"SetTemplate template index value\n\n"
1254
"Sets a particular element of a template to a CK_ULONG\n"
1255
" template variable name of the template\n"
1256
" index index into the template to the element to change\n"
1257
" value 32 bit value to set in the template\n",
1258
{ArgAttribute, ArgULong, ArgULong, ArgNone, ArgNone,
1259
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1260
{"SetString", F_SetStringVar,
1261
"SetString varName string\n\n"
1262
"Sets a particular variable to a string value\n"
1263
" variable variable name of new string\n"
1264
" string String to set the variable to\n",
1265
{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone,
1266
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1268
"Set varName value\n\n"
1269
"Sets a particular variable to CK_ULONG\n"
1270
" variable name of the new variable\n"
1271
" value 32 bit value to set variable to\n",
1272
{ArgVar|ArgNew, ArgULong, ArgNone, ArgNone, ArgNone,
1273
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1276
"prints a variable\n"
1277
" variable name of the variable to print\n",
1278
{ArgVar, ArgNone, ArgNone, ArgNone, ArgNone,
1279
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1280
{"Delete", F_Delete,
1281
"Delete varName\n\n"
1282
"delete a variable\n"
1283
" variable name of the variable to delete\n",
1284
{ArgVar|ArgNew, ArgNone, ArgNone, ArgNone, ArgNone,
1285
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1287
"load libraryName\n\n"
1288
"load a pkcs #11 module\n"
1289
" libraryName Name of a shared library\n",
1290
{ArgVar, ArgNone, ArgNone, ArgNone, ArgNone,
1291
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1293
"Save filename variable\n\n"
1294
"Saves the binary value of 'variable' in file 'filename'\n"
1295
" fileName target file to save the variable in\n"
1296
" variable variable to save\n",
1297
{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone,
1298
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1299
{"Restore", F_RestoreVar,
1300
"Restore filename variable\n\n"
1301
"Restores a variable from a file\n"
1302
" fileName target file to restore the variable from\n"
1303
" variable variable to restore\n",
1304
{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone,
1305
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1306
{"Increment", F_Increment,
1307
"Increment variable value\n\n"
1308
"Increment a variable by value\n",
1309
{ArgVar, ArgULong, ArgNone, ArgNone, ArgNone,
1310
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1311
{"Decrement", F_Decrement,
1312
"Decrement variable value\n\n"
1313
"Decrement a variable by value\n",
1314
{ArgVar, ArgULong, ArgNone, ArgNone, ArgNone,
1315
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1317
"List all the variables\n",
1318
{ArgNone, ArgNone, ArgNone, ArgNone, ArgNone,
1319
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1320
{"Unload", F_Unload,
1321
"Unload the currrently loaded PKCS #11 library\n",
1322
{ArgNone, ArgNone, ArgNone, ArgNone, ArgNone,
1323
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1326
"reads filename as script of commands to execute\n",
1327
{ArgVar|ArgNew, ArgNone, ArgNone, ArgNone, ArgNone,
1328
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1330
"Time pkcs11 command\n\n"
1331
"Execute a pkcs #11 command and time the results\n",
1332
{ArgVar|ArgFull, ArgNone, ArgNone, ArgNone, ArgNone,
1333
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1334
{"System", F_System,
1336
{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
1337
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1339
"LoopRun filename var start end step\n\n"
1340
"Run in a loop. Loop exit if scrip does and explicit quit (Quit QuitIf etc.)",
1341
{ArgVar|ArgNew, ArgVar|ArgNew, ArgULong, ArgULong, ArgULong,
1342
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1344
"Help [command]\n\n"
1345
"print general help, or help for a specific command\n",
1346
{ArgVar|ArgOpt, ArgNone, ArgNone, ArgNone, ArgNone,
1347
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1348
{"QuitIf", F_QuitIf,
1349
"QuitIf arg1 comparator arg2\n\n"
1350
"Exit from this program if Condition is valid, valid comparators:\n"
1351
" < > <= >= = !=\n",
1352
{ArgULong, ArgVar|ArgNew, ArgULong, ArgNone, ArgNone,
1353
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1354
{"QuitIfString", F_QuitIfString,
1355
"QuitIfString arg1 comparator arg2\n\n"
1356
"Exit from this program if Condition is valid, valid comparators:\n"
1358
{ArgVar|ArgNew, ArgVar|ArgNew, ArgVar|ArgNew, ArgNone, ArgNone,
1359
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1361
"Exit from this program",
1362
{ArgNone, ArgNone, ArgNone, ArgNone, ArgNone,
1363
ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1366
const Commands *commands= &_commands[0];
1367
const int commandCount = sizeof(_commands) / sizeof(_commands[0]);
1369
const Topics _topics[] = {
1371
"Variables are random strings of characters. These should begin with alpha\n"
1372
" characters, and should not contain any spaces, nor should they match any\n"
1373
" built-in constants. There is some checking in the code for these things,\n"
1374
" but it's not 100% and using invalid variable names can cause problems.\n"
1375
" Variables are created by any 'OUT' parameter. If the variable does not\n"
1376
" exist, it will be created. For in parameters variables must already exist.\n"
1379
"pk11util recognizes *lots* of constants. All CKA_, CKF_, CKO_, CKU_, CKS_,\n"
1380
" CKC_, CKK_, CKH_, CKM_, CKT_ values from the PKCS #11 spec are recognized.\n"
1381
" Constants can be specified with their fully qualified CK?_ value, or the\n"
1382
" prefix can be dropped. Constants are matched case insensitve.\n"
1385
"Arrays are special variables which represent 'C' arrays. Each array \n"
1386
" variable can be referenced as a group (using just the name), or as \n"
1387
" individual elements (with the [int] operator). Example:\n"
1388
" print myArray # prints the full array.\n"
1389
" print myArray[3] # prints the 3rd elemement of the array \n"
1392
"Size operaters returns the size in bytes of a variable, or the number of\n"
1393
" elements in an array.\n"
1394
" size(var) and sizeof(var) return the size of var in bytes.\n"
1395
" sizea(var) and sizeofarray(var) return the number of elements in var.\n"
1396
" If var is not an array, sizea(var) returns 1.\n"
1400
const Topics *topics=&_topics[0];
1401
const int topicCount = sizeof(_topics)/sizeof(_topics[0]);