PageRenderTime 105ms CodeModel.GetById 18ms app.highlight 77ms RepoModel.GetById 2ms app.codeStats 0ms

/security/nss/cmd/lib/pk11table.c

http://github.com/zpao/v8monkey
C | 1448 lines | 1379 code | 34 blank | 35 comment | 12 complexity | 5a1364245114790a084354be2786f161 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/* ***** BEGIN LICENSE BLOCK *****
   2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
   3 *
   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/
   8 *
   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
  12 * License.
  13 *
  14 * The Original Code is the Netscape security libraries.
  15 *
  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.
  20 *
  21 * Contributor(s):
  22 *
  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.
  34 *
  35 * ***** END LICENSE BLOCK ***** */
  36
  37#include "pk11table.h"
  38
  39const char *_valueString[] = {
  40    "None",
  41    "Variable",
  42    "CK_ULONG",
  43    "Data",
  44    "UTF8",
  45    "CK_INFO",
  46    "CK_SLOT_INFO",
  47    "CK_TOKEN_INFO",
  48    "CK_SESSION_INFO",
  49    "CK_ATTRIBUTE",
  50    "CK_MECHANISM",
  51    "CK_MECHANISM_INFO",
  52    "CK_C_INITIALIZE_ARGS",
  53    "CK_FUNCTION_LIST"
  54};
  55
  56const char **valueString = &_valueString[0];
  57const int valueCount = sizeof(_valueString)/sizeof(_valueString[0]);
  58
  59const char *_constTypeString[] = {
  60    "None",
  61    "Bool",
  62    "InfoFlags",
  63    "SlotFlags",
  64    "TokenFlags",
  65    "SessionFlags",
  66    "MechanismFlags",
  67    "InitializeFlags",
  68    "Users",
  69    "SessionState",
  70    "Object",
  71    "Hardware",
  72    "KeyType",
  73    "CertificateType",
  74    "Attribute",
  75    "Mechanism",
  76    "Result",
  77    "Trust",
  78    "AvailableSizes",
  79    "CurrentSize"
  80};
  81
  82const char **constTypeString = &_constTypeString[0];
  83const int constTypeCount = sizeof(_constTypeString)/sizeof(_constTypeString[0]);
  84
  85#define mkEntry(x,t) { #x, x, Const##t, ConstNone }
  86#define mkEntry2(x,t,t2) { #x, x, Const##t, Const##t2 }
  87
  88const Constant _consts[] = {
  89	mkEntry(CK_FALSE, Bool),
  90	mkEntry(CK_TRUE, Bool),
  91
  92	mkEntry(CKF_TOKEN_PRESENT, SlotFlags),
  93	mkEntry(CKF_REMOVABLE_DEVICE, SlotFlags),
  94	mkEntry(CKF_HW_SLOT, SlotFlags),
  95
  96	mkEntry(CKF_RNG, TokenFlags),
  97	mkEntry(CKF_WRITE_PROTECTED, TokenFlags),
  98	mkEntry(CKF_LOGIN_REQUIRED, TokenFlags),
  99	mkEntry(CKF_USER_PIN_INITIALIZED, TokenFlags),
 100	mkEntry(CKF_RESTORE_KEY_NOT_NEEDED, TokenFlags),
 101	mkEntry(CKF_CLOCK_ON_TOKEN, TokenFlags),
 102	mkEntry(CKF_PROTECTED_AUTHENTICATION_PATH, TokenFlags),
 103	mkEntry(CKF_DUAL_CRYPTO_OPERATIONS, TokenFlags),
 104	mkEntry(CKF_TOKEN_INITIALIZED, TokenFlags),
 105	mkEntry(CKF_SECONDARY_AUTHENTICATION, TokenFlags),
 106	mkEntry(CKF_USER_PIN_COUNT_LOW, TokenFlags),
 107	mkEntry(CKF_USER_PIN_FINAL_TRY, TokenFlags),
 108	mkEntry(CKF_USER_PIN_LOCKED, TokenFlags),
 109	mkEntry(CKF_USER_PIN_TO_BE_CHANGED, TokenFlags),
 110	mkEntry(CKF_SO_PIN_COUNT_LOW, TokenFlags),
 111	mkEntry(CKF_SO_PIN_FINAL_TRY, TokenFlags),
 112	mkEntry(CKF_SO_PIN_LOCKED, TokenFlags),
 113	mkEntry(CKF_SO_PIN_TO_BE_CHANGED, TokenFlags),
 114
 115	mkEntry(CKF_RW_SESSION, SessionFlags),
 116	mkEntry(CKF_SERIAL_SESSION, SessionFlags),
 117
 118	mkEntry(CKF_HW, MechanismFlags),
 119	mkEntry(CKF_ENCRYPT, MechanismFlags),
 120	mkEntry(CKF_DECRYPT, MechanismFlags),
 121	mkEntry(CKF_DIGEST, MechanismFlags),
 122	mkEntry(CKF_SIGN, MechanismFlags),
 123	mkEntry(CKF_SIGN_RECOVER, MechanismFlags),
 124	mkEntry(CKF_VERIFY, MechanismFlags),
 125	mkEntry(CKF_VERIFY_RECOVER, MechanismFlags),
 126	mkEntry(CKF_GENERATE, MechanismFlags),
 127	mkEntry(CKF_GENERATE_KEY_PAIR, MechanismFlags),
 128	mkEntry(CKF_WRAP, MechanismFlags),
 129	mkEntry(CKF_UNWRAP, MechanismFlags),
 130	mkEntry(CKF_DERIVE, MechanismFlags),
 131	mkEntry(CKF_EC_FP, MechanismFlags),
 132	mkEntry(CKF_EC_F_2M, MechanismFlags),
 133	mkEntry(CKF_EC_ECPARAMETERS, MechanismFlags),
 134	mkEntry(CKF_EC_NAMEDCURVE, MechanismFlags),
 135	mkEntry(CKF_EC_UNCOMPRESS, MechanismFlags),
 136	mkEntry(CKF_EC_COMPRESS, MechanismFlags),
 137
 138	mkEntry(CKF_LIBRARY_CANT_CREATE_OS_THREADS, InitializeFlags),
 139	mkEntry(CKF_OS_LOCKING_OK, InitializeFlags),
 140
 141	mkEntry(CKU_SO, Users),
 142	mkEntry(CKU_USER, Users),
 143
 144	mkEntry(CKS_RO_PUBLIC_SESSION, SessionState),
 145	mkEntry(CKS_RO_USER_FUNCTIONS, SessionState),
 146	mkEntry(CKS_RW_PUBLIC_SESSION, SessionState),
 147	mkEntry(CKS_RW_USER_FUNCTIONS, SessionState),
 148	mkEntry(CKS_RW_SO_FUNCTIONS, SessionState),
 149
 150	mkEntry(CKO_DATA, Object),
 151	mkEntry(CKO_CERTIFICATE, Object),
 152	mkEntry(CKO_PUBLIC_KEY, Object),
 153	mkEntry(CKO_PRIVATE_KEY, Object),
 154	mkEntry(CKO_SECRET_KEY, Object),
 155	mkEntry(CKO_HW_FEATURE, Object),
 156	mkEntry(CKO_DOMAIN_PARAMETERS, Object),
 157	mkEntry(CKO_KG_PARAMETERS, Object),
 158	mkEntry(CKO_NSS_CRL, Object),
 159	mkEntry(CKO_NSS_SMIME, Object),
 160	mkEntry(CKO_NSS_TRUST, Object),
 161	mkEntry(CKO_NSS_BUILTIN_ROOT_LIST, Object),
 162
 163	mkEntry(CKH_MONOTONIC_COUNTER, Hardware),
 164	mkEntry(CKH_CLOCK, Hardware),
 165
 166	mkEntry(CKK_RSA, KeyType),
 167	mkEntry(CKK_DSA, KeyType),
 168	mkEntry(CKK_DH, KeyType),
 169	mkEntry(CKK_ECDSA, KeyType),
 170	mkEntry(CKK_EC, KeyType),
 171	mkEntry(CKK_X9_42_DH, KeyType),
 172	mkEntry(CKK_KEA, KeyType),
 173	mkEntry(CKK_GENERIC_SECRET, KeyType),
 174	mkEntry(CKK_RC2, KeyType),
 175	mkEntry(CKK_RC4, KeyType),
 176	mkEntry(CKK_DES, KeyType),
 177	mkEntry(CKK_DES2, KeyType),
 178	mkEntry(CKK_DES3, KeyType),
 179	mkEntry(CKK_CAST, KeyType),
 180	mkEntry(CKK_CAST3, KeyType),
 181	mkEntry(CKK_CAST5, KeyType),
 182	mkEntry(CKK_CAST128, KeyType),
 183	mkEntry(CKK_RC5, KeyType),
 184	mkEntry(CKK_IDEA, KeyType),
 185	mkEntry(CKK_SKIPJACK, KeyType),
 186	mkEntry(CKK_BATON, KeyType),
 187	mkEntry(CKK_JUNIPER, KeyType),
 188	mkEntry(CKK_CDMF, KeyType),
 189	mkEntry(CKK_AES, KeyType),
 190	mkEntry(CKK_CAMELLIA, KeyType),
 191	mkEntry(CKK_NSS_PKCS8, KeyType),
 192
 193	mkEntry(CKC_X_509, CertType),
 194	mkEntry(CKC_X_509_ATTR_CERT, CertType),
 195
 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_NSS_URL, Attribute, None),
 256	mkEntry2(CKA_NSS_EMAIL, Attribute, None),
 257	mkEntry2(CKA_NSS_SMIME_INFO, Attribute, None),
 258	mkEntry2(CKA_NSS_SMIME_TIMESTAMP, Attribute, None),
 259	mkEntry2(CKA_NSS_PKCS8_SALT, Attribute, None),
 260	mkEntry2(CKA_NSS_PASSWORD_CHECK, Attribute, None),
 261	mkEntry2(CKA_NSS_EXPIRES, Attribute, None),
 262	mkEntry2(CKA_NSS_KRL, Attribute, None),
 263	mkEntry2(CKA_NSS_PQG_COUNTER, Attribute, None),
 264	mkEntry2(CKA_NSS_PQG_SEED, Attribute, None),
 265	mkEntry2(CKA_NSS_PQG_H, Attribute, None),
 266	mkEntry2(CKA_NSS_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),
 286
 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_CAMELLIA_KEY_GEN, Mechanism),
 480	mkEntry(CKM_CAMELLIA_ECB, Mechanism),
 481	mkEntry(CKM_CAMELLIA_CBC, Mechanism),
 482	mkEntry(CKM_CAMELLIA_MAC, Mechanism),
 483	mkEntry(CKM_CAMELLIA_MAC_GENERAL, Mechanism),
 484	mkEntry(CKM_CAMELLIA_CBC_PAD, Mechanism),
 485	mkEntry(CKM_SEED_KEY_GEN, Mechanism),
 486	mkEntry(CKM_SEED_ECB, Mechanism),
 487	mkEntry(CKM_SEED_CBC, Mechanism),
 488	mkEntry(CKM_SEED_MAC, Mechanism),
 489	mkEntry(CKM_SEED_MAC_GENERAL, Mechanism),
 490	mkEntry(CKM_SEED_CBC_PAD, Mechanism),
 491	mkEntry(CKM_SEED_ECB_ENCRYPT_DATA, Mechanism),
 492	mkEntry(CKM_SEED_CBC_ENCRYPT_DATA, Mechanism),
 493	mkEntry(CKM_DSA_PARAMETER_GEN, Mechanism),
 494	mkEntry(CKM_DH_PKCS_PARAMETER_GEN, Mechanism),
 495	mkEntry(CKM_NSS_AES_KEY_WRAP, Mechanism),
 496	mkEntry(CKM_NSS_AES_KEY_WRAP_PAD, Mechanism),
 497	mkEntry(CKM_NETSCAPE_PBE_SHA1_DES_CBC, Mechanism),
 498	mkEntry(CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC, Mechanism),
 499	mkEntry(CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC, Mechanism),
 500	mkEntry(CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC, Mechanism),
 501	mkEntry(CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4, Mechanism),
 502	mkEntry(CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4, Mechanism),
 503	mkEntry(CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC, Mechanism),
 504	mkEntry(CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN, Mechanism),
 505	mkEntry(CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN, Mechanism),
 506	mkEntry(CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN, Mechanism),
 507	mkEntry(CKM_TLS_PRF_GENERAL, Mechanism),
 508
 509	mkEntry(CKR_OK, Result),
 510	mkEntry(CKR_CANCEL, Result),
 511	mkEntry(CKR_HOST_MEMORY, Result),
 512	mkEntry(CKR_SLOT_ID_INVALID, Result),
 513	mkEntry(CKR_GENERAL_ERROR, Result),
 514	mkEntry(CKR_FUNCTION_FAILED, Result),
 515	mkEntry(CKR_ARGUMENTS_BAD, Result),
 516	mkEntry(CKR_NO_EVENT, Result),
 517	mkEntry(CKR_NEED_TO_CREATE_THREADS, Result),
 518	mkEntry(CKR_CANT_LOCK, Result),
 519	mkEntry(CKR_ATTRIBUTE_READ_ONLY, Result),
 520	mkEntry(CKR_ATTRIBUTE_SENSITIVE, Result),
 521	mkEntry(CKR_ATTRIBUTE_TYPE_INVALID, Result),
 522	mkEntry(CKR_ATTRIBUTE_VALUE_INVALID, Result),
 523	mkEntry(CKR_DATA_INVALID, Result),
 524	mkEntry(CKR_DATA_LEN_RANGE, Result),
 525	mkEntry(CKR_DEVICE_ERROR, Result),
 526	mkEntry(CKR_DEVICE_MEMORY, Result),
 527	mkEntry(CKR_DEVICE_REMOVED, Result),
 528	mkEntry(CKR_ENCRYPTED_DATA_INVALID, Result),
 529	mkEntry(CKR_ENCRYPTED_DATA_LEN_RANGE, Result),
 530	mkEntry(CKR_FUNCTION_CANCELED, Result),
 531	mkEntry(CKR_FUNCTION_NOT_PARALLEL, Result),
 532	mkEntry(CKR_FUNCTION_NOT_SUPPORTED, Result),
 533	mkEntry(CKR_KEY_HANDLE_INVALID, Result),
 534	mkEntry(CKR_KEY_SIZE_RANGE, Result),
 535	mkEntry(CKR_KEY_TYPE_INCONSISTENT, Result),
 536	mkEntry(CKR_KEY_NOT_NEEDED, Result),
 537	mkEntry(CKR_KEY_CHANGED, Result),
 538	mkEntry(CKR_KEY_NEEDED, Result),
 539	mkEntry(CKR_KEY_INDIGESTIBLE, Result),
 540	mkEntry(CKR_KEY_FUNCTION_NOT_PERMITTED, Result),
 541	mkEntry(CKR_KEY_NOT_WRAPPABLE, Result),
 542	mkEntry(CKR_KEY_UNEXTRACTABLE, Result),
 543	mkEntry(CKR_KEY_PARAMS_INVALID, Result),
 544	mkEntry(CKR_MECHANISM_INVALID, Result),
 545	mkEntry(CKR_MECHANISM_PARAM_INVALID, Result),
 546	mkEntry(CKR_OBJECT_HANDLE_INVALID, Result),
 547	mkEntry(CKR_OPERATION_ACTIVE, Result),
 548	mkEntry(CKR_OPERATION_NOT_INITIALIZED, Result),
 549	mkEntry(CKR_PIN_INCORRECT, Result),
 550	mkEntry(CKR_PIN_INVALID, Result),
 551	mkEntry(CKR_PIN_LEN_RANGE, Result),
 552	mkEntry(CKR_PIN_EXPIRED, Result),
 553	mkEntry(CKR_PIN_LOCKED, Result),
 554	mkEntry(CKR_SESSION_CLOSED, Result),
 555	mkEntry(CKR_SESSION_COUNT, Result),
 556	mkEntry(CKR_SESSION_HANDLE_INVALID, Result),
 557	mkEntry(CKR_SESSION_PARALLEL_NOT_SUPPORTED, Result),
 558	mkEntry(CKR_SESSION_READ_ONLY, Result),
 559	mkEntry(CKR_SESSION_EXISTS, Result),
 560	mkEntry(CKR_SESSION_READ_ONLY_EXISTS, Result),
 561	mkEntry(CKR_SESSION_READ_WRITE_SO_EXISTS, Result),
 562	mkEntry(CKR_SIGNATURE_INVALID, Result),
 563	mkEntry(CKR_SIGNATURE_LEN_RANGE, Result),
 564	mkEntry(CKR_TEMPLATE_INCOMPLETE, Result),
 565	mkEntry(CKR_TEMPLATE_INCONSISTENT, Result),
 566	mkEntry(CKR_TOKEN_NOT_PRESENT, Result),
 567	mkEntry(CKR_TOKEN_NOT_RECOGNIZED, Result),
 568	mkEntry(CKR_TOKEN_WRITE_PROTECTED, Result),
 569	mkEntry(CKR_UNWRAPPING_KEY_HANDLE_INVALID, Result),
 570	mkEntry(CKR_UNWRAPPING_KEY_SIZE_RANGE, Result),
 571	mkEntry(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT, Result),
 572	mkEntry(CKR_USER_ALREADY_LOGGED_IN, Result),
 573	mkEntry(CKR_USER_NOT_LOGGED_IN, Result),
 574	mkEntry(CKR_USER_PIN_NOT_INITIALIZED, Result),
 575	mkEntry(CKR_USER_TYPE_INVALID, Result),
 576	mkEntry(CKR_USER_ANOTHER_ALREADY_LOGGED_IN, Result),
 577	mkEntry(CKR_USER_TOO_MANY_TYPES, Result),
 578	mkEntry(CKR_WRAPPED_KEY_INVALID, Result),
 579	mkEntry(CKR_WRAPPED_KEY_LEN_RANGE, Result),
 580	mkEntry(CKR_WRAPPING_KEY_HANDLE_INVALID, Result),
 581	mkEntry(CKR_WRAPPING_KEY_SIZE_RANGE, Result),
 582	mkEntry(CKR_WRAPPING_KEY_TYPE_INCONSISTENT, Result),
 583	mkEntry(CKR_RANDOM_SEED_NOT_SUPPORTED, Result),
 584	mkEntry(CKR_RANDOM_NO_RNG, Result),
 585	mkEntry(CKR_DOMAIN_PARAMS_INVALID, Result),
 586	mkEntry(CKR_BUFFER_TOO_SMALL, Result),
 587	mkEntry(CKR_SAVED_STATE_INVALID, Result),
 588	mkEntry(CKR_INFORMATION_SENSITIVE, Result),
 589	mkEntry(CKR_STATE_UNSAVEABLE, Result),
 590	mkEntry(CKR_CRYPTOKI_NOT_INITIALIZED, Result),
 591	mkEntry(CKR_CRYPTOKI_ALREADY_INITIALIZED, Result),
 592	mkEntry(CKR_MUTEX_BAD, Result),
 593	mkEntry(CKR_MUTEX_NOT_LOCKED, Result),
 594	mkEntry(CKR_VENDOR_DEFINED, Result),
 595
 596	mkEntry(CKT_NSS_TRUSTED, Trust),
 597	mkEntry(CKT_NSS_TRUSTED_DELEGATOR, Trust),
 598	mkEntry(CKT_NSS_NOT_TRUSTED, Trust),
 599	mkEntry(CKT_NSS_MUST_VERIFY_TRUST, Trust),
 600	mkEntry(CKT_NSS_TRUST_UNKNOWN, Trust),
 601	mkEntry(CKT_NSS_VALID_DELEGATOR, Trust),
 602
 603	mkEntry(CK_EFFECTIVELY_INFINITE, AvailableSizes),
 604	mkEntry(CK_UNAVAILABLE_INFORMATION, CurrentSize),
 605};
 606
 607const Constant *consts = &_consts[0];
 608const int constCount = sizeof(_consts)/sizeof(_consts[0]);
 609
 610const Commands _commands[] = {
 611    {"C_Initialize", F_C_Initialize,
 612"C_Initialize pInitArgs\n\n"
 613"C_Initialize initializes the PKCS #11 library.\n"
 614"  pInitArgs  if this is not NULL_PTR it gets cast to and dereferenced\n",
 615	{ArgInitializeArgs, ArgNone, ArgNone, ArgNone, ArgNone,
 616	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 617    {"C_Finalize", F_C_Finalize,
 618"C_Finalize pReserved\n\n"
 619"C_Finalize indicates that an application is done with the PKCS #11 library.\n"
 620" pReserved  reserved. Should be NULL_PTR\n",
 621	{ArgInitializeArgs, ArgNone, ArgNone, ArgNone, ArgNone,
 622	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 623    {"C_GetInfo", F_C_GetInfo,
 624"C_GetInfo pInfo\n\n"
 625"C_GetInfo returns general information about PKCS #11.\n"
 626" pInfo   location that receives information\n",
 627	{ArgInfo|ArgOut,   ArgNone, ArgNone, ArgNone, ArgNone,
 628	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 629    {"C_GetFunctionList", F_C_GetFunctionList,
 630"C_GetFunctionList ppFunctionList\n\n"
 631"C_GetFunctionList returns the function list.\n"
 632" ppFunctionList   receives pointer to function list\n",
 633	{ArgFunctionList|ArgOut,   ArgNone, ArgNone, ArgNone, ArgNone,
 634	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 635    {"C_GetSlotList", F_C_GetSlotList,
 636"C_GetSlotList tokenPresent pSlotList pulCount\n\n"
 637"C_GetSlotList obtains a list of slots in the system.\n"
 638" tokenPresent    only slots with tokens?\n"
 639" pSlotList       receives array of slot IDs\n"
 640" pulCount        receives number of slots\n",
 641	{ArgULong, ArgULong|ArgArray|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
 642	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 643    {"C_GetSlotInfo", F_C_GetSlotInfo,
 644"C_GetSlotInfo slotID pInfo\n\n"
 645"C_GetSlotInfo obtains information about a particular slot in the system.\n"
 646" slotID    the ID of the slot\n"
 647" pInfo     receives the slot information\n",
 648	{ArgULong, ArgSlotInfo|ArgOut, ArgNone, ArgNone, ArgNone,
 649	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 650    {"C_GetTokenInfo", F_C_GetTokenInfo,
 651"C_GetTokenInfo slotID pInfo\n\n"
 652"C_GetTokenInfo obtains information about a particular token in the system.\n"
 653" slotID    ID of the token's slot\n"
 654" pInfo     receives the token information\n",
 655	{ArgULong, ArgTokenInfo|ArgOut, ArgNone, ArgNone, ArgNone,
 656	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 657    {"C_GetMechanismList", F_C_GetMechanismList,
 658"C_GetMechanismList slotID pMechanismList pulCount\n\n"
 659"C_GetMechanismList obtains a list of mechanism types supported by a token.\n"
 660" slotID            ID of token's slot\n"
 661" pMechanismList    gets mech. array\n"
 662" pulCount          gets # of mechs.\n",
 663	{ArgULong, ArgULong|ArgArray|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
 664	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 665    {"C_GetMechanismInfo", F_C_GetMechanismInfo,
 666"C_GetMechanismInfo slotID type pInfo\n\n"
 667"C_GetMechanismInfo obtains information about a particular mechanism possibly\n"
 668"supported by a token.\n"
 669" slotID    ID of the token's slot\n"
 670" type      type of mechanism\n"
 671" pInfo     receives mechanism info\n",
 672	{ArgULong, ArgULong, ArgMechanismInfo|ArgOut, ArgNone, ArgNone,
 673	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 674    {"C_InitToken", F_C_InitToken,
 675"C_InitToken slotID pPin ulPinLen pLabel\n\n"
 676"C_InitToken initializes a token.\n"
 677" slotID      ID of the token's slot\n"
 678" pPin        the SO's initial PIN\n"
 679" ulPinLen    length in bytes of the PIN\n"
 680" pLabel      32-byte token label (blank padded)\n",
 681	{ArgULong, ArgUTF8, ArgULong, ArgUTF8, ArgNone,
 682	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 683    {"C_InitPIN", F_C_InitPIN,
 684"C_InitPIN hSession pPin ulPinLen\n\n"
 685"C_InitPIN initializes the normal user's PIN.\n"
 686" hSession    the session's handle\n"
 687" pPin        the normal user's PIN\n"
 688" ulPinLen    length in bytes of the PIN\n",
 689	{ArgULong, ArgUTF8, ArgULong, ArgNone, ArgNone,
 690	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 691    {"C_SetPIN", F_C_SetPIN,
 692"C_SetPIN hSession pOldPin ulOldLen pNewPin ulNewLen\n\n"
 693"C_SetPIN modifies the PIN of the user who is logged in.\n"
 694" hSession    the session's handle\n"
 695" pOldPin     the old PIN\n"
 696" ulOldLen    length of the old PIN\n"
 697" pNewPin     the new PIN\n"
 698" ulNewLen    length of the new PIN\n",
 699	{ArgULong, ArgUTF8, ArgULong, ArgUTF8, ArgULong,
 700	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 701    {"C_OpenSession", F_C_OpenSession,
 702"C_OpenSession slotID flags phSession\n\n"
 703"C_OpenSession opens a session between an application and a token.\n"
 704" slotID          the slot's ID\n"
 705" flags           from\n"
 706" phSession       gets session handle\n",
 707	{ArgULong, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone,
 708	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 709    {"C_CloseSession", F_C_CloseSession,
 710"C_CloseSession hSession\n\n"
 711"C_CloseSession closes a session between an application and a token.\n"
 712" hSession   the session's handle\n",
 713	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
 714	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 715    {"C_CloseAllSessions", F_C_CloseAllSessions,
 716"C_CloseAllSessions slotID\n\n"
 717"C_CloseAllSessions closes all sessions with a token.\n"
 718" slotID   the token's slot\n",
 719	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
 720	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 721    {"C_GetSessionInfo", F_C_GetSessionInfo,
 722"C_GetSessionInfo hSession pInfo\n\n"
 723"C_GetSessionInfo obtains information about the session.\n"
 724" hSession    the session's handle\n"
 725" pInfo       receives session info\n",
 726	{ArgULong, ArgSessionInfo|ArgOut, ArgNone, ArgNone, ArgNone,
 727	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 728    {"C_GetOperationState", F_C_GetOperationState,
 729"C_GetOperationState hSession pOpState pulOpStateLen\n\n"
 730"C_GetOperationState obtains the state of the cryptographic operation in a\n"
 731"session.\n"
 732" hSession        session's handle\n"
 733" pOpState        gets state\n"
 734" pulOpStateLen   gets state length\n",
 735	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
 736	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 737    {"C_SetOperationState", F_C_SetOperationState,
 738"C_SetOperationState hSession pOpState ulOpStateLen hEncKey hAuthKey\n\n"
 739"C_SetOperationState restores the state of the cryptographic operation in a\n"
 740"session.\n"
 741" hSession        session's handle\n"
 742" pOpState        holds state\n"
 743" ulOpStateLen    holds state length\n"
 744" hEncKey         en/decryption key\n"
 745" hAuthnKey       sign/verify key\n",
 746	{ArgULong, ArgChar|ArgOut, ArgULong, ArgULong, ArgULong,
 747	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 748    {"C_Login", F_C_Login,
 749"C_Login hSession userType pPin ulPinLen\n\n"
 750"C_Login logs a user into a token.\n"
 751" hSession    the session's handle\n"
 752" userType    the user type\n"
 753" pPin        the user's PIN\n"
 754" ulPinLen    the length of the PIN\n",
 755	{ArgULong, ArgULong, ArgVar, ArgULong, ArgNone,
 756	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 757    {"C_Logout", F_C_Logout,
 758"C_Logout hSession\n\n"
 759"C_Logout logs a user out from a token.\n"
 760" hSession   the session's handle\n",
 761	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
 762	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 763    {"C_CreateObject", F_C_CreateObject,
 764"C_CreateObject hSession pTemplate ulCount phObject\n\n"
 765"C_CreateObject creates a new object.\n"
 766" hSession      the session's handle\n"
 767" pTemplate     the object's template\n"
 768" ulCount       attributes in template\n"
 769" phObject   gets new object's handle.\n",
 770	{ArgULong, ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut, ArgNone,
 771	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 772    {"C_CopyObject", F_C_CopyObject,
 773"C_CopyObject hSession hObject pTemplate ulCount phNewObject\n\n"
 774"C_CopyObject copies an object creating a new object for the copy.\n"
 775" hSession      the session's handle\n"
 776" hObject       the object's handle\n"
 777" pTemplate     template for new object\n"
 778" ulCount       attributes in template\n"
 779" phNewObject   receives handle of copy\n",
 780	{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut,
 781	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 782    {"C_DestroyObject", F_C_DestroyObject,
 783"C_DestroyObject hSession hObject\n\n"
 784"C_DestroyObject destroys an object.\n"
 785" hSession    the session's handle\n"
 786" hObject     the object's handle\n",
 787	{ArgULong, ArgULong, ArgNone, ArgNone, ArgNone,
 788	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 789    {"C_GetObjectSize", F_C_GetObjectSize,
 790"C_GetObjectSize hSession hObject pulSize\n\n"
 791"C_GetObjectSize gets the size of an object in bytes.\n"
 792" hSession    the session's handle\n"
 793" hObject     the object's handle\n"
 794" pulSize     receives size of object\n",
 795	{ArgULong, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone,
 796	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 797    {"C_GetAttributeValue", F_C_GetAttributeValue,
 798"C_GetAttributeValue hSession hObject pTemplate ulCount\n\n"
 799"C_GetAttributeValue obtains the value of one or more object attributes.\n"
 800" hSession     the session's handle\n"
 801" hObject      the object's handle\n"
 802" pTemplate    specifies attrs; gets vals\n"
 803" ulCount      attributes in template\n",
 804	{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone,
 805	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 806    {"C_SetAttributeValue", F_C_SetAttributeValue,
 807"C_SetAttributeValue hSession hObject pTemplate ulCount\n\n"
 808"C_SetAttributeValue modifies the value of one or more object attributes\n"
 809" hSession     the session's handle\n"
 810" hObject      the object's handle\n"
 811" pTemplate    specifies attrs and values\n"
 812" ulCount      attributes in template\n",
 813	{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone,
 814	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 815    {"C_FindObjectsInit", F_C_FindObjectsInit,
 816"C_FindObjectsInit hSession pTemplate ulCount\n\n"
 817"C_FindObjectsInit initializes a search for token and session objects that\n"
 818"match a template.\n"
 819" hSession     the session's handle\n"
 820" pTemplate    attribute values to match\n"
 821" ulCount      attrs in search template\n",
 822	{ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone, ArgNone,
 823	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 824    {"C_FindObjectsFinal", F_C_FindObjectsFinal,
 825"C_FindObjectsFinal hSession\n\n"
 826"C_FindObjectsFinal finishes a search for token and session objects.\n"
 827" hSession   the session's handle\n",
 828	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
 829	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 830    {"C_FindObjects", F_C_FindObjects,
 831"C_FindObjects hSession phObject ulMaxObjectCount pulObjectCount\n\n"
 832"C_FindObjects continues a search for token and session objects that match\n"
 833"a template obtaining additional object handles.\n"
 834" hSession            session's handle\n"
 835" phObject            gets obj. handles\n"
 836" ulMaxObjectCount    max handles to get\n"
 837" pulObjectCount      actual # returned\n",
 838	{ArgULong, ArgULong|ArgOut, ArgULong, ArgULong|ArgOut, ArgNone,
 839	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 840    {"C_EncryptInit", F_C_EncryptInit,
 841"C_EncryptInit hSession pMechanism hKey\n\n"
 842"C_EncryptInit initializes an encryption operation.\n"
 843" hSession      the session's handle\n"
 844" pMechanism    the encryption mechanism\n"
 845" hKey          handle of encryption key\n",
 846	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
 847	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 848    {"C_EncryptUpdate", F_C_EncryptUpdate,
 849"C_EncryptUpdate hSession pPart ulPartLen pEncryptedPart pulEncryptedPartLen\n"
 850"\n"
 851"C_EncryptUpdate continues a multiple-part encryption operation.\n"
 852" hSession             session's handle\n"
 853" pPart                the plaintext data\n"
 854" ulPartLen            plaintext data len\n"
 855" pEncryptedPart       gets ciphertext\n"
 856" pulEncryptedPartLen  gets c-text size\n",
 857	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 858	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 859    {"C_EncryptFinal", F_C_EncryptFinal,
 860"C_EncryptFinal hSession pLastEncryptedPart pulLastEncryptedPartLen\n\n"
 861"C_EncryptFinal finishes a multiple-part encryption operation.\n"
 862" hSession                  session handle\n"
 863" pLastEncryptedPart        last c-text\n"
 864" pulLastEncryptedPartLen   gets last size\n",
 865	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 866	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 867    {"C_Encrypt", F_C_Encrypt,
 868"C_Encrypt hSession pData ulDataLen pEncryptedData pulEncryptedDataLen\n\n"
 869"C_Encrypt encrypts single-part data.\n"
 870" hSession              session's handle\n"
 871" pData                 the plaintext data\n"
 872" ulDataLen             bytes of plaintext\n"
 873" pEncryptedData        gets ciphertext\n"
 874" pulEncryptedDataLen   gets c-text size\n",
 875	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 876	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 877    {"C_DecryptInit", F_C_DecryptInit,
 878"C_DecryptInit hSession pMechanism hKey\n\n"
 879"C_DecryptInit initializes a decryption operation.\n"
 880" hSession      the session's handle\n"
 881" pMechanism    the decryption mechanism\n"
 882" hKey          handle of decryption key\n",
 883	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
 884	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 885    {"C_DecryptUpdate", F_C_DecryptUpdate,
 886"C_DecryptUpdate hSession pEncryptedPart ulEncryptedPartLen pPart pulPartLen\n"
 887"\n"
 888"C_DecryptUpdate continues a multiple-part decryption operation.\n"
 889" hSession              session's handle\n"
 890" pEncryptedPart        encrypted data\n"
 891" ulEncryptedPartLen    input length\n"
 892" pPart                 gets plaintext\n"
 893" pulPartLen            p-text size\n",
 894	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 895	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 896    {"C_DecryptFinal", F_C_DecryptFinal,
 897"C_DecryptFinal hSession pLastPart pulLastPartLen\n\n"
 898"C_DecryptFinal finishes a multiple-part decryption operation.\n"
 899" hSession         the session's handle\n"
 900" pLastPart        gets plaintext\n"
 901" pulLastPartLen   p-text size\n",
 902	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 903	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 904    {"C_Decrypt", F_C_Decrypt,
 905"C_Decrypt hSession pEncryptedData ulEncryptedDataLen pData pulDataLen\n\n"
 906"C_Decrypt decrypts encrypted data in a single part.\n"
 907" hSession             session's handle\n"
 908" pEncryptedData       ciphertext\n"
 909" ulEncryptedDataLen   ciphertext length\n"
 910" pData                gets plaintext\n"
 911" pulDataLen           gets p-text size\n",
 912	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 913	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 914    {"C_DigestInit", F_C_DigestInit,
 915"C_DigestInit hSession pMechanism\n\n"
 916"C_DigestInit initializes a message-digesting operation.\n"
 917" hSession     the session's handle\n"
 918" pMechanism   the digesting mechanism\n",
 919	{ArgULong, ArgMechanism, ArgNone, ArgNone, ArgNone,
 920	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 921    {"C_DigestUpdate", F_C_DigestUpdate,
 922"C_DigestUpdate hSession pPart ulPartLen\n\n"
 923"C_DigestUpdate continues a multiple-part message-digesting operation.\n"
 924" hSession    the session's handle\n"
 925" pPart       data to be digested\n"
 926" ulPartLen   bytes of data to be digested\n",
 927	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 928	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 929    {"C_DigestKey", F_C_DigestKey,
 930"C_DigestKey hSession hKey\n\n"
 931"C_DigestKey continues a multi-part message-digesting operation by digesting\n"
 932"the value of a secret key as part of the data already digested.\n"
 933" hSession    the session's handle\n"
 934" hKey        secret key to digest\n",
 935	{ArgULong, ArgULong, ArgNone, ArgNone, ArgNone,
 936	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 937    {"C_DigestFinal", F_C_DigestFinal,
 938"C_DigestFinal hSession pDigest pulDigestLen\n\n"
 939"C_DigestFinal finishes a multiple-part message-digesting operation.\n"
 940" hSession       the session's handle\n"
 941" pDigest        gets the message digest\n"
 942" pulDigestLen   gets byte count of digest\n",
 943	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
 944	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 945    {"C_Digest", F_C_Digest,
 946"C_Digest hSession pData ulDataLen pDigest pulDigestLen\n\n"
 947"C_Digest digests data in a single part.\n"
 948" hSession       the session's handle\n"
 949" pData          data to be digested\n"
 950" ulDataLen      bytes of data to digest\n"
 951" pDigest        gets the message digest\n"
 952" pulDigestLen   gets digest length\n",
 953	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
 954	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 955    {"C_SignInit", F_C_SignInit,
 956"C_SignInit hSession pMechanism hKey\n\n"
 957"C_SignInit initializes a signature (private key encryption operation where\n"
 958"the signature is (will be) an appendix to the data and plaintext cannot be\n"
 959"recovered from the signature.\n"
 960" hSession      the session's handle\n"
 961" pMechanism    the signature mechanism\n"
 962" hKey          handle of signature key\n",
 963	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
 964	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 965    {"C_SignUpdate", F_C_SignUpdate,
 966"C_SignUpdate hSession pPart ulPartLen\n\n"
 967"C_SignUpdate continues a multiple-part signature operation where the\n"
 968"signature is (will be) an appendix to the data and plaintext cannot be\n"
 969"recovered from the signature.\n"
 970" hSession    the session's handle\n"
 971" pPart       the data to sign\n"
 972" ulPartLen   count of bytes to sign\n",
 973	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
 974	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 975    {"C_SignFinal", F_C_SignFinal,
 976"C_SignFinal hSession pSignature pulSignatureLen\n\n"
 977"C_SignFinal finishes a multiple-part signature operation returning the\n"
 978"signature.\n"
 979" hSession          the session's handle\n"
 980" pSignature        gets the signature\n"
 981" pulSignatureLen   gets signature length\n",
 982	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
 983	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 984    {"C_SignRecoverInit", F_C_SignRecoverInit,
 985"C_SignRecoverInit hSession pMechanism hKey\n\n"
 986"C_SignRecoverInit initializes a signature operation where the data can be\n"
 987"recovered from the signature.\n"
 988" hSession     the session's handle\n"
 989" pMechanism   the signature mechanism\n"
 990" hKey         handle of the signature key\n",
 991	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
 992	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
 993    {"C_SignRecover", F_C_SignRecover,
 994"C_SignRecover hSession pData ulDataLen pSignature pulSignatureLen\n\n"
 995"C_SignRecover signs data in a single operation where the data can be\n"
 996"recovered from the signature.\n"
 997" hSession          the session's handle\n"
 998" pData             the data to sign\n"
 999" ulDataLen         count of bytes to sign\n"
1000" pSignature        gets the signature\n"
1001" pulSignatureLen   gets signature length\n",
1002	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1003	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1004    {"C_Sign", F_C_Sign,
1005"C_Sign hSession pData ulDataLen pSignature pulSignatureLen\n\n"
1006"C_Sign signs (encrypts with private key) data in a single part where the\n"
1007"signature is (will be) an appendix to the data and plaintext cannot be\n"
1008"recovered from the signature.\n"
1009" hSession          the session's handle\n"
1010" pData             the data to sign\n"
1011" ulDataLen         count of bytes to sign\n"
1012" pSignature        gets the signature\n"
1013" pulSignatureLen   gets signature length\n",
1014	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1015	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1016    {"C_VerifyInit", F_C_VerifyInit,
1017"C_VerifyInit hSession pMechanism hKey\n\n"
1018"C_VerifyInit initializes a verification operation where the signature is an\n"
1019"appendix to the data and plaintext cannot cannot be recovered from the\n"
1020"signature (e.g. DSA).\n"
1021" hSession      the session's handle\n"
1022" pMechanism    the verification mechanism\n"
1023" hKey          verification key\n",
1024	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
1025	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1026    {"C_VerifyUpdate", F_C_VerifyUpdate,
1027"C_VerifyUpdate hSession pPart ulPartLen\n\n"
1028"C_VerifyUpdate continues a multiple-part verification operation where the\n"
1029"signature is an appendix to the data and plaintext cannot be recovered from\n"
1030"the signature.\n"
1031" hSession    the session's handle\n"
1032" pPart       signed data\n"
1033" ulPartLen   length of signed data\n",
1034	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
1035	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1036    {"C_VerifyFinal", F_C_VerifyFinal,
1037"C_VerifyFinal hSession pSignature ulSignatureLen\n\n"
1038"C_VerifyFinal finishes a multiple-part verification operation checking the\n"
1039"signature.\n"
1040" hSession         the session's handle\n"
1041" pSignature       signature to verify\n"
1042" ulSignatureLen   signature length\n",
1043	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
1044	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1045    {"C_VerifyRecoverInit", F_C_VerifyRecoverInit,
1046"C_VerifyRecoverInit hSession pMechanism hKey\n\n"
1047"C_VerifyRecoverInit initializes a signature verification operation where the\n"
1048"data is recovered from the signature.\n"
1049" hSession      the session's handle\n"
1050" pMechanism    the verification mechanism\n"
1051" hKey          verification key\n",
1052	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
1053	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1054    {"C_VerifyRecover", F_C_VerifyRecover,
1055"C_VerifyRecover hSession pSignature ulSignatureLen pData pulDataLen\n\n"
1056"C_VerifyRecover verifies a signature in a single-part operation where the\n"
1057"data is recovered from the signature.\n"
1058" hSession          the session's handle\n"
1059" pSignature        signature to verify\n"
1060" ulSignatureLen    signature length\n"
1061" pData             gets signed data\n"
1062" pulDataLen        gets signed data len\n",
1063	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1064	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1065    {"C_Verify", F_C_Verify,
1066"C_Verify hSession pData ulDataLen pSignature ulSignatureLen\n\n"
1067"C_Verify verifies a signature in a single-part operation where the signature\n"
1068"is an appendix to the data and plaintext cannot be recovered from the\n"
1069"signature.\n"
1070" hSession         the session's handle\n"
1071" pData            signed data\n"
1072" ulDataLen        length of signed data\n"
1073" pSignature       signature\n"
1074" ulSignatureLen   signature length*/\n",
1075	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1076	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1077    {"C_DigestEncryptUpdate", F_C_DigestEncryptUpdate,
1078"C_DigestEncryptUpdate hSession pPart ulPartLen pEncryptedPart \\\n"
1079"    pulEncryptedPartLen\n\n"
1080"C_DigestEncryptUpdate continues a multiple-part digesting and encryption\n"
1081"operation.\n"
1082" hSession              session's handle\n"
1083" pPart                 the plaintext data\n"
1084" ulPartLen             plaintext length\n"
1085" pEncryptedPart        gets ciphertext\n"
1086" pulEncryptedPartLen   gets c-text length\n",
1087	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1088	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1089    {"C_DecryptDigestUpdate", F_C_DecryptDigestUpdate,
1090"C_DecryptDigestUpdate hSession pEncryptedPart ulEncryptedPartLen pPart \\\n"
1091"    pulPartLen\n\n"
1092"C_DecryptDigestUpdate continues a multiple-part decryption and digesting\n"
1093"operation.\n"
1094" hSession              session's handle\n"
1095" pEncryptedPart        ciphertext\n"
1096" ulEncryptedPartLen    ciphertext length\n"
1097" pPart                 gets plaintext\n"
1098" pulPartLen            gets plaintext len\n",
1099	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1100	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1101    {"C_SignEncryptUpdate", F_C_SignEncryptUpdate,
1102"C_SignEncryptUpdate hSession pPart ulPartLen pEncryptedPart \\\n"
1103"    pulEncryptedPartLen\n\n"
1104"C_SignEncryptUpdate continues a multiple-part signing and encryption\n"
1105"operation.\n"
1106" hSession              session's handle\n"
1107" pPart                 the plaintext data\n"
1108" ulPartLen             plaintext length\n"
1109" pEncryptedPart        gets ciphertext\n"
1110" pulEncryptedPartLen   gets c-text length\n",
1111	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1112	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1113    {"C_DecryptVerifyUpdate", F_C_DecryptVerifyUpdate,
1114"C_DecryptVerifyUpdate hSession pEncryptedPart ulEncryptedPartLen pPart \\\n"
1115"    pulPartLen\n\n"
1116"C_DecryptVerifyUpdate continues a multiple-part decryption and verify\n"
1117"operation.\n"
1118" hSession              session's handle\n"
1119" pEncryptedPart        ciphertext\n"
1120" ulEncryptedPartLen    ciphertext length\n"
1121" pPart                 gets plaintext\n"
1122" pulPartLen            gets p-text length\n",
1123	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
1124	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1125    {"C_GenerateKeyPair", F_C_GenerateKeyPair,
1126"C_GenerateKeyPair hSession pMechanism pPublicKeyTemplate \\\n"
1127"    ulPublicKeyAttributeCount pPrivateKeyTemplate ulPrivateKeyAttributeCount \\\n"
1128"    phPublicKey phPrivateKey\n\n"
1129"C_GenerateKeyPair generates a public-key/private-key pair creating new key\n"
1130"objects.\n"
1131" hSession                      sessionhandle\n"
1132" pMechanism                    key-genmech.\n"
1133" pPublicKeyTemplate            templatefor pub. key\n"
1134" ulPublicKeyAttributeCount     # pub. attrs.\n"
1135" pPrivateKeyTemplate           templatefor priv. key\n"
1136" ulPrivateKeyAttributeCount    # priv. attrs.\n"
1137" phPublicKey                   gets pub. keyhandle\n"
1138" phPrivateKey                  getspriv. keyhandle\n",
1139	{ArgULong, ArgMechanism, ArgAttribute|ArgArray, ArgULong, 
1140						ArgAttribute|ArgArray,
1141	 ArgULong, ArgULong|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone }},
1142    {"C_GenerateKey", F_C_GenerateKey,
1143"C_GenerateKey hSession pMechanism pTemplate ulCount phKey\n\n"
1144"C_GenerateKey generates a secret key creating a new key object.\n"
1145" hSession      the session's handle\n"
1146" pMechanism    key generation mech.\n"
1147" pTemplate     template for new key\n"
1148" ulCount       # of attrs in template\n"
1149" phKey         gets handle of new key\n",
1150	{ArgULong, ArgMechanism, ArgAttribute|ArgArray, ArgULong, 
1151	 					ArgULong|ArgOut,
1152	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
1153    {"C_WrapKey", F_C_WrapKey,
1154"C_WrapKey hSession pMechanism hWrappingKey hKey pWrappedKey pulWrappedKe…

Large files files are truncated, but you can click here to view the full file