security/nss/cmd/lib/pk11table.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/cmd/lib/pk11table.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1420 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "pk11table.h"
     1.9 +
    1.10 +const char *_valueString[] = {
    1.11 +    "None",
    1.12 +    "Variable",
    1.13 +    "CK_ULONG",
    1.14 +    "Data",
    1.15 +    "UTF8",
    1.16 +    "CK_INFO",
    1.17 +    "CK_SLOT_INFO",
    1.18 +    "CK_TOKEN_INFO",
    1.19 +    "CK_SESSION_INFO",
    1.20 +    "CK_ATTRIBUTE",
    1.21 +    "CK_MECHANISM",
    1.22 +    "CK_MECHANISM_INFO",
    1.23 +    "CK_C_INITIALIZE_ARGS",
    1.24 +    "CK_FUNCTION_LIST"
    1.25 +};
    1.26 +
    1.27 +const char **valueString = &_valueString[0];
    1.28 +const int valueCount = sizeof(_valueString)/sizeof(_valueString[0]);
    1.29 +
    1.30 +const char *_constTypeString[] = {
    1.31 +    "None",
    1.32 +    "Bool",
    1.33 +    "InfoFlags",
    1.34 +    "SlotFlags",
    1.35 +    "TokenFlags",
    1.36 +    "SessionFlags",
    1.37 +    "MechanismFlags",
    1.38 +    "InitializeFlags",
    1.39 +    "Users",
    1.40 +    "SessionState",
    1.41 +    "Object",
    1.42 +    "Hardware",
    1.43 +    "KeyType",
    1.44 +    "CertificateType",
    1.45 +    "Attribute",
    1.46 +    "Mechanism",
    1.47 +    "Result",
    1.48 +    "Trust",
    1.49 +    "AvailableSizes",
    1.50 +    "CurrentSize"
    1.51 +};
    1.52 +
    1.53 +const char **constTypeString = &_constTypeString[0];
    1.54 +const int constTypeCount = sizeof(_constTypeString)/sizeof(_constTypeString[0]);
    1.55 +
    1.56 +#define mkEntry(x,t) { #x, x, Const##t, ConstNone }
    1.57 +#define mkEntry2(x,t,t2) { #x, x, Const##t, Const##t2 }
    1.58 +
    1.59 +const Constant _consts[] = {
    1.60 +	mkEntry(CK_FALSE, Bool),
    1.61 +	mkEntry(CK_TRUE, Bool),
    1.62 +
    1.63 +	mkEntry(CKF_TOKEN_PRESENT, SlotFlags),
    1.64 +	mkEntry(CKF_REMOVABLE_DEVICE, SlotFlags),
    1.65 +	mkEntry(CKF_HW_SLOT, SlotFlags),
    1.66 +
    1.67 +	mkEntry(CKF_RNG, TokenFlags),
    1.68 +	mkEntry(CKF_WRITE_PROTECTED, TokenFlags),
    1.69 +	mkEntry(CKF_LOGIN_REQUIRED, TokenFlags),
    1.70 +	mkEntry(CKF_USER_PIN_INITIALIZED, TokenFlags),
    1.71 +	mkEntry(CKF_RESTORE_KEY_NOT_NEEDED, TokenFlags),
    1.72 +	mkEntry(CKF_CLOCK_ON_TOKEN, TokenFlags),
    1.73 +	mkEntry(CKF_PROTECTED_AUTHENTICATION_PATH, TokenFlags),
    1.74 +	mkEntry(CKF_DUAL_CRYPTO_OPERATIONS, TokenFlags),
    1.75 +	mkEntry(CKF_TOKEN_INITIALIZED, TokenFlags),
    1.76 +	mkEntry(CKF_SECONDARY_AUTHENTICATION, TokenFlags),
    1.77 +	mkEntry(CKF_USER_PIN_COUNT_LOW, TokenFlags),
    1.78 +	mkEntry(CKF_USER_PIN_FINAL_TRY, TokenFlags),
    1.79 +	mkEntry(CKF_USER_PIN_LOCKED, TokenFlags),
    1.80 +	mkEntry(CKF_USER_PIN_TO_BE_CHANGED, TokenFlags),
    1.81 +	mkEntry(CKF_SO_PIN_COUNT_LOW, TokenFlags),
    1.82 +	mkEntry(CKF_SO_PIN_FINAL_TRY, TokenFlags),
    1.83 +	mkEntry(CKF_SO_PIN_LOCKED, TokenFlags),
    1.84 +	mkEntry(CKF_SO_PIN_TO_BE_CHANGED, TokenFlags),
    1.85 +
    1.86 +	mkEntry(CKF_RW_SESSION, SessionFlags),
    1.87 +	mkEntry(CKF_SERIAL_SESSION, SessionFlags),
    1.88 +
    1.89 +	mkEntry(CKF_HW, MechanismFlags),
    1.90 +	mkEntry(CKF_ENCRYPT, MechanismFlags),
    1.91 +	mkEntry(CKF_DECRYPT, MechanismFlags),
    1.92 +	mkEntry(CKF_DIGEST, MechanismFlags),
    1.93 +	mkEntry(CKF_SIGN, MechanismFlags),
    1.94 +	mkEntry(CKF_SIGN_RECOVER, MechanismFlags),
    1.95 +	mkEntry(CKF_VERIFY, MechanismFlags),
    1.96 +	mkEntry(CKF_VERIFY_RECOVER, MechanismFlags),
    1.97 +	mkEntry(CKF_GENERATE, MechanismFlags),
    1.98 +	mkEntry(CKF_GENERATE_KEY_PAIR, MechanismFlags),
    1.99 +	mkEntry(CKF_WRAP, MechanismFlags),
   1.100 +	mkEntry(CKF_UNWRAP, MechanismFlags),
   1.101 +	mkEntry(CKF_DERIVE, MechanismFlags),
   1.102 +	mkEntry(CKF_EC_FP, MechanismFlags),
   1.103 +	mkEntry(CKF_EC_F_2M, MechanismFlags),
   1.104 +	mkEntry(CKF_EC_ECPARAMETERS, MechanismFlags),
   1.105 +	mkEntry(CKF_EC_NAMEDCURVE, MechanismFlags),
   1.106 +	mkEntry(CKF_EC_UNCOMPRESS, MechanismFlags),
   1.107 +	mkEntry(CKF_EC_COMPRESS, MechanismFlags),
   1.108 +
   1.109 +	mkEntry(CKF_LIBRARY_CANT_CREATE_OS_THREADS, InitializeFlags),
   1.110 +	mkEntry(CKF_OS_LOCKING_OK, InitializeFlags),
   1.111 +
   1.112 +	mkEntry(CKU_SO, Users),
   1.113 +	mkEntry(CKU_USER, Users),
   1.114 +
   1.115 +	mkEntry(CKS_RO_PUBLIC_SESSION, SessionState),
   1.116 +	mkEntry(CKS_RO_USER_FUNCTIONS, SessionState),
   1.117 +	mkEntry(CKS_RW_PUBLIC_SESSION, SessionState),
   1.118 +	mkEntry(CKS_RW_USER_FUNCTIONS, SessionState),
   1.119 +	mkEntry(CKS_RW_SO_FUNCTIONS, SessionState),
   1.120 +
   1.121 +	mkEntry(CKO_DATA, Object),
   1.122 +	mkEntry(CKO_CERTIFICATE, Object),
   1.123 +	mkEntry(CKO_PUBLIC_KEY, Object),
   1.124 +	mkEntry(CKO_PRIVATE_KEY, Object),
   1.125 +	mkEntry(CKO_SECRET_KEY, Object),
   1.126 +	mkEntry(CKO_HW_FEATURE, Object),
   1.127 +	mkEntry(CKO_DOMAIN_PARAMETERS, Object),
   1.128 +	mkEntry(CKO_KG_PARAMETERS, Object),
   1.129 +	mkEntry(CKO_NSS_CRL, Object),
   1.130 +	mkEntry(CKO_NSS_SMIME, Object),
   1.131 +	mkEntry(CKO_NSS_TRUST, Object),
   1.132 +	mkEntry(CKO_NSS_BUILTIN_ROOT_LIST, Object),
   1.133 +
   1.134 +	mkEntry(CKH_MONOTONIC_COUNTER, Hardware),
   1.135 +	mkEntry(CKH_CLOCK, Hardware),
   1.136 +
   1.137 +	mkEntry(CKK_RSA, KeyType),
   1.138 +	mkEntry(CKK_DSA, KeyType),
   1.139 +	mkEntry(CKK_DH, KeyType),
   1.140 +	mkEntry(CKK_ECDSA, KeyType),
   1.141 +	mkEntry(CKK_EC, KeyType),
   1.142 +	mkEntry(CKK_X9_42_DH, KeyType),
   1.143 +	mkEntry(CKK_KEA, KeyType),
   1.144 +	mkEntry(CKK_GENERIC_SECRET, KeyType),
   1.145 +	mkEntry(CKK_RC2, KeyType),
   1.146 +	mkEntry(CKK_RC4, KeyType),
   1.147 +	mkEntry(CKK_DES, KeyType),
   1.148 +	mkEntry(CKK_DES2, KeyType),
   1.149 +	mkEntry(CKK_DES3, KeyType),
   1.150 +	mkEntry(CKK_CAST, KeyType),
   1.151 +	mkEntry(CKK_CAST3, KeyType),
   1.152 +	mkEntry(CKK_CAST5, KeyType),
   1.153 +	mkEntry(CKK_CAST128, KeyType),
   1.154 +	mkEntry(CKK_RC5, KeyType),
   1.155 +	mkEntry(CKK_IDEA, KeyType),
   1.156 +	mkEntry(CKK_SKIPJACK, KeyType),
   1.157 +	mkEntry(CKK_BATON, KeyType),
   1.158 +	mkEntry(CKK_JUNIPER, KeyType),
   1.159 +	mkEntry(CKK_CDMF, KeyType),
   1.160 +	mkEntry(CKK_AES, KeyType),
   1.161 +	mkEntry(CKK_CAMELLIA, KeyType),
   1.162 +	mkEntry(CKK_NSS_PKCS8, KeyType),
   1.163 +
   1.164 +	mkEntry(CKC_X_509, CertType),
   1.165 +	mkEntry(CKC_X_509_ATTR_CERT, CertType),
   1.166 +
   1.167 +	mkEntry2(CKA_CLASS, Attribute, Object),
   1.168 +	mkEntry2(CKA_TOKEN, Attribute, Bool),
   1.169 +	mkEntry2(CKA_PRIVATE, Attribute, Bool),
   1.170 +	mkEntry2(CKA_LABEL, Attribute, None),
   1.171 +	mkEntry2(CKA_APPLICATION, Attribute, None),
   1.172 +	mkEntry2(CKA_VALUE, Attribute, None),
   1.173 +	mkEntry2(CKA_OBJECT_ID, Attribute, None),
   1.174 +	mkEntry2(CKA_CERTIFICATE_TYPE, Attribute, CertType),
   1.175 +	mkEntry2(CKA_ISSUER, Attribute, None),
   1.176 +	mkEntry2(CKA_SERIAL_NUMBER, Attribute, None),
   1.177 +	mkEntry2(CKA_AC_ISSUER, Attribute, None),
   1.178 +	mkEntry2(CKA_OWNER, Attribute, None),
   1.179 +	mkEntry2(CKA_ATTR_TYPES, Attribute, None),
   1.180 +	mkEntry2(CKA_TRUSTED, Attribute, Bool),
   1.181 +	mkEntry2(CKA_KEY_TYPE, Attribute, KeyType),
   1.182 +	mkEntry2(CKA_SUBJECT, Attribute, None),
   1.183 +	mkEntry2(CKA_ID, Attribute, None),
   1.184 +	mkEntry2(CKA_SENSITIVE, Attribute, Bool),
   1.185 +	mkEntry2(CKA_ENCRYPT, Attribute, Bool),
   1.186 +	mkEntry2(CKA_DECRYPT, Attribute, Bool),
   1.187 +	mkEntry2(CKA_WRAP, Attribute, Bool),
   1.188 +	mkEntry2(CKA_UNWRAP, Attribute, Bool),
   1.189 +	mkEntry2(CKA_SIGN, Attribute, Bool),
   1.190 +	mkEntry2(CKA_SIGN_RECOVER, Attribute, Bool),
   1.191 +	mkEntry2(CKA_VERIFY, Attribute, Bool),
   1.192 +	mkEntry2(CKA_VERIFY_RECOVER, Attribute, Bool),
   1.193 +	mkEntry2(CKA_DERIVE, Attribute, Bool),
   1.194 +	mkEntry2(CKA_START_DATE, Attribute, None),
   1.195 +	mkEntry2(CKA_END_DATE, Attribute, None),
   1.196 +	mkEntry2(CKA_MODULUS, Attribute, None),
   1.197 +	mkEntry2(CKA_MODULUS_BITS, Attribute, None),
   1.198 +	mkEntry2(CKA_PUBLIC_EXPONENT, Attribute, None),
   1.199 +	mkEntry2(CKA_PRIVATE_EXPONENT, Attribute, None),
   1.200 +	mkEntry2(CKA_PRIME_1, Attribute, None),
   1.201 +	mkEntry2(CKA_PRIME_2, Attribute, None),
   1.202 +	mkEntry2(CKA_EXPONENT_1, Attribute, None),
   1.203 +	mkEntry2(CKA_EXPONENT_2, Attribute, None),
   1.204 +	mkEntry2(CKA_COEFFICIENT, Attribute, None),
   1.205 +	mkEntry2(CKA_PRIME, Attribute, None),
   1.206 +	mkEntry2(CKA_SUBPRIME, Attribute, None),
   1.207 +	mkEntry2(CKA_BASE, Attribute, None),
   1.208 +	mkEntry2(CKA_PRIME_BITS, Attribute, None),
   1.209 +	mkEntry2(CKA_SUB_PRIME_BITS, Attribute, None),
   1.210 +	mkEntry2(CKA_VALUE_BITS, Attribute, None),
   1.211 +	mkEntry2(CKA_VALUE_LEN, Attribute, None),
   1.212 +	mkEntry2(CKA_EXTRACTABLE, Attribute, Bool),
   1.213 +	mkEntry2(CKA_LOCAL, Attribute, Bool),
   1.214 +	mkEntry2(CKA_NEVER_EXTRACTABLE, Attribute, Bool),
   1.215 +	mkEntry2(CKA_ALWAYS_SENSITIVE, Attribute, Bool),
   1.216 +	mkEntry2(CKA_KEY_GEN_MECHANISM, Attribute, Mechanism),
   1.217 +	mkEntry2(CKA_MODIFIABLE, Attribute, Bool),
   1.218 +	mkEntry2(CKA_ECDSA_PARAMS, Attribute, None),
   1.219 +	mkEntry2(CKA_EC_PARAMS, Attribute, None),
   1.220 +	mkEntry2(CKA_EC_POINT, Attribute, None),
   1.221 +	mkEntry2(CKA_SECONDARY_AUTH, Attribute, None),
   1.222 +	mkEntry2(CKA_AUTH_PIN_FLAGS, Attribute, None),
   1.223 +	mkEntry2(CKA_HW_FEATURE_TYPE, Attribute, Hardware),
   1.224 +	mkEntry2(CKA_RESET_ON_INIT, Attribute, Bool),
   1.225 +	mkEntry2(CKA_HAS_RESET, Attribute, Bool),
   1.226 +	mkEntry2(CKA_NSS_URL, Attribute, None),
   1.227 +	mkEntry2(CKA_NSS_EMAIL, Attribute, None),
   1.228 +	mkEntry2(CKA_NSS_SMIME_INFO, Attribute, None),
   1.229 +	mkEntry2(CKA_NSS_SMIME_TIMESTAMP, Attribute, None),
   1.230 +	mkEntry2(CKA_NSS_PKCS8_SALT, Attribute, None),
   1.231 +	mkEntry2(CKA_NSS_PASSWORD_CHECK, Attribute, None),
   1.232 +	mkEntry2(CKA_NSS_EXPIRES, Attribute, None),
   1.233 +	mkEntry2(CKA_NSS_KRL, Attribute, None),
   1.234 +	mkEntry2(CKA_NSS_PQG_COUNTER, Attribute, None),
   1.235 +	mkEntry2(CKA_NSS_PQG_SEED, Attribute, None),
   1.236 +	mkEntry2(CKA_NSS_PQG_H, Attribute, None),
   1.237 +	mkEntry2(CKA_NSS_PQG_SEED_BITS, Attribute, None),
   1.238 +	mkEntry2(CKA_TRUST_DIGITAL_SIGNATURE, Attribute, Trust),
   1.239 +	mkEntry2(CKA_TRUST_NON_REPUDIATION, Attribute, Trust),
   1.240 +	mkEntry2(CKA_TRUST_KEY_ENCIPHERMENT, Attribute, Trust),
   1.241 +	mkEntry2(CKA_TRUST_DATA_ENCIPHERMENT, Attribute, Trust),
   1.242 +	mkEntry2(CKA_TRUST_KEY_AGREEMENT, Attribute, Trust),
   1.243 +	mkEntry2(CKA_TRUST_KEY_CERT_SIGN, Attribute, Trust),
   1.244 +	mkEntry2(CKA_TRUST_CRL_SIGN, Attribute, Trust),
   1.245 +	mkEntry2(CKA_TRUST_SERVER_AUTH, Attribute, Trust),
   1.246 +	mkEntry2(CKA_TRUST_CLIENT_AUTH, Attribute, Trust),
   1.247 +	mkEntry2(CKA_TRUST_CODE_SIGNING, Attribute, Trust),
   1.248 +	mkEntry2(CKA_TRUST_EMAIL_PROTECTION, Attribute, Trust),
   1.249 +	mkEntry2(CKA_TRUST_IPSEC_END_SYSTEM, Attribute, Trust),
   1.250 +	mkEntry2(CKA_TRUST_IPSEC_TUNNEL, Attribute, Trust),
   1.251 +	mkEntry2(CKA_TRUST_IPSEC_USER, Attribute, Trust),
   1.252 +	mkEntry2(CKA_TRUST_TIME_STAMPING, Attribute, Trust),
   1.253 +	mkEntry2(CKA_CERT_SHA1_HASH, Attribute, None),
   1.254 +	mkEntry2(CKA_CERT_MD5_HASH, Attribute, None),
   1.255 +	mkEntry2(CKA_NETSCAPE_DB, Attribute, None),
   1.256 +	mkEntry2(CKA_NETSCAPE_TRUST, Attribute, Trust),
   1.257 +
   1.258 +	mkEntry(CKM_RSA_PKCS, Mechanism),
   1.259 +	mkEntry(CKM_RSA_9796, Mechanism),
   1.260 +	mkEntry(CKM_RSA_X_509, Mechanism),
   1.261 +	mkEntry(CKM_RSA_PKCS_KEY_PAIR_GEN, Mechanism),
   1.262 +	mkEntry(CKM_MD2_RSA_PKCS, Mechanism),
   1.263 +	mkEntry(CKM_MD5_RSA_PKCS, Mechanism),
   1.264 +	mkEntry(CKM_SHA1_RSA_PKCS, Mechanism),
   1.265 +	mkEntry(CKM_RIPEMD128_RSA_PKCS, Mechanism),
   1.266 +	mkEntry(CKM_RIPEMD160_RSA_PKCS, Mechanism),
   1.267 +	mkEntry(CKM_RSA_PKCS_OAEP, Mechanism),
   1.268 +	mkEntry(CKM_RSA_X9_31_KEY_PAIR_GEN, Mechanism),
   1.269 +	mkEntry(CKM_RSA_X9_31, Mechanism),
   1.270 +	mkEntry(CKM_SHA1_RSA_X9_31, Mechanism),
   1.271 +	mkEntry(CKM_DSA_KEY_PAIR_GEN, Mechanism),
   1.272 +	mkEntry(CKM_DSA, Mechanism),
   1.273 +	mkEntry(CKM_DSA_SHA1, Mechanism),
   1.274 +	mkEntry(CKM_DH_PKCS_KEY_PAIR_GEN, Mechanism),
   1.275 +	mkEntry(CKM_DH_PKCS_DERIVE, Mechanism),
   1.276 +	mkEntry(CKM_X9_42_DH_DERIVE, Mechanism),
   1.277 +	mkEntry(CKM_X9_42_DH_HYBRID_DERIVE, Mechanism),
   1.278 +	mkEntry(CKM_X9_42_MQV_DERIVE, Mechanism),
   1.279 +	mkEntry(CKM_SHA256_RSA_PKCS, Mechanism),
   1.280 +	mkEntry(CKM_SHA384_RSA_PKCS, Mechanism),
   1.281 +	mkEntry(CKM_SHA512_RSA_PKCS, Mechanism),
   1.282 +	mkEntry(CKM_RC2_KEY_GEN, Mechanism),
   1.283 +	mkEntry(CKM_RC2_ECB, Mechanism),
   1.284 +	mkEntry(CKM_RC2_CBC, Mechanism),
   1.285 +	mkEntry(CKM_RC2_MAC, Mechanism),
   1.286 +	mkEntry(CKM_RC2_MAC_GENERAL, Mechanism),
   1.287 +	mkEntry(CKM_RC2_CBC_PAD, Mechanism),
   1.288 +	mkEntry(CKM_RC4_KEY_GEN, Mechanism),
   1.289 +	mkEntry(CKM_RC4, Mechanism),
   1.290 +	mkEntry(CKM_DES_KEY_GEN, Mechanism),
   1.291 +	mkEntry(CKM_DES_ECB, Mechanism),
   1.292 +	mkEntry(CKM_DES_CBC, Mechanism),
   1.293 +	mkEntry(CKM_DES_MAC, Mechanism),
   1.294 +	mkEntry(CKM_DES_MAC_GENERAL, Mechanism),
   1.295 +	mkEntry(CKM_DES_CBC_PAD, Mechanism),
   1.296 +	mkEntry(CKM_DES2_KEY_GEN, Mechanism),
   1.297 +	mkEntry(CKM_DES3_KEY_GEN, Mechanism),
   1.298 +	mkEntry(CKM_DES3_ECB, Mechanism),
   1.299 +	mkEntry(CKM_DES3_CBC, Mechanism),
   1.300 +	mkEntry(CKM_DES3_MAC, Mechanism),
   1.301 +	mkEntry(CKM_DES3_MAC_GENERAL, Mechanism),
   1.302 +	mkEntry(CKM_DES3_CBC_PAD, Mechanism),
   1.303 +	mkEntry(CKM_CDMF_KEY_GEN, Mechanism),
   1.304 +	mkEntry(CKM_CDMF_ECB, Mechanism),
   1.305 +	mkEntry(CKM_CDMF_CBC, Mechanism),
   1.306 +	mkEntry(CKM_CDMF_MAC, Mechanism),
   1.307 +	mkEntry(CKM_CDMF_MAC_GENERAL, Mechanism),
   1.308 +	mkEntry(CKM_CDMF_CBC_PAD, Mechanism),
   1.309 +	mkEntry(CKM_MD2, Mechanism),
   1.310 +	mkEntry(CKM_MD2_HMAC, Mechanism),
   1.311 +	mkEntry(CKM_MD2_HMAC_GENERAL, Mechanism),
   1.312 +	mkEntry(CKM_MD5, Mechanism),
   1.313 +	mkEntry(CKM_MD5_HMAC, Mechanism),
   1.314 +	mkEntry(CKM_MD5_HMAC_GENERAL, Mechanism),
   1.315 +	mkEntry(CKM_SHA_1, Mechanism),
   1.316 +	mkEntry(CKM_SHA_1_HMAC, Mechanism),
   1.317 +	mkEntry(CKM_SHA_1_HMAC_GENERAL, Mechanism),
   1.318 +	mkEntry(CKM_RIPEMD128, Mechanism),
   1.319 +	mkEntry(CKM_RIPEMD128_HMAC, Mechanism),
   1.320 +	mkEntry(CKM_RIPEMD128_HMAC_GENERAL, Mechanism),
   1.321 +	mkEntry(CKM_RIPEMD160, Mechanism),
   1.322 +	mkEntry(CKM_RIPEMD160_HMAC, Mechanism),
   1.323 +	mkEntry(CKM_RIPEMD160_HMAC_GENERAL, Mechanism),
   1.324 +	mkEntry(CKM_SHA256, Mechanism),
   1.325 +	mkEntry(CKM_SHA256_HMAC_GENERAL, Mechanism),
   1.326 +	mkEntry(CKM_SHA256_HMAC, Mechanism),
   1.327 +	mkEntry(CKM_SHA384, Mechanism),
   1.328 +	mkEntry(CKM_SHA384_HMAC_GENERAL, Mechanism),
   1.329 +	mkEntry(CKM_SHA384_HMAC, Mechanism),
   1.330 +	mkEntry(CKM_SHA512, Mechanism),
   1.331 +	mkEntry(CKM_SHA512_HMAC_GENERAL, Mechanism),
   1.332 +	mkEntry(CKM_SHA512_HMAC, Mechanism),
   1.333 +	mkEntry(CKM_CAST_KEY_GEN, Mechanism),
   1.334 +	mkEntry(CKM_CAST_ECB, Mechanism),
   1.335 +	mkEntry(CKM_CAST_CBC, Mechanism),
   1.336 +	mkEntry(CKM_CAST_MAC, Mechanism),
   1.337 +	mkEntry(CKM_CAST_MAC_GENERAL, Mechanism),
   1.338 +	mkEntry(CKM_CAST_CBC_PAD, Mechanism),
   1.339 +	mkEntry(CKM_CAST3_KEY_GEN, Mechanism),
   1.340 +	mkEntry(CKM_CAST3_ECB, Mechanism),
   1.341 +	mkEntry(CKM_CAST3_CBC, Mechanism),
   1.342 +	mkEntry(CKM_CAST3_MAC, Mechanism),
   1.343 +	mkEntry(CKM_CAST3_MAC_GENERAL, Mechanism),
   1.344 +	mkEntry(CKM_CAST3_CBC_PAD, Mechanism),
   1.345 +	mkEntry(CKM_CAST5_KEY_GEN, Mechanism),
   1.346 +	mkEntry(CKM_CAST128_KEY_GEN, Mechanism),
   1.347 +	mkEntry(CKM_CAST5_ECB, Mechanism),
   1.348 +	mkEntry(CKM_CAST128_ECB, Mechanism),
   1.349 +	mkEntry(CKM_CAST5_CBC, Mechanism),
   1.350 +	mkEntry(CKM_CAST128_CBC, Mechanism),
   1.351 +	mkEntry(CKM_CAST5_MAC, Mechanism),
   1.352 +	mkEntry(CKM_CAST128_MAC, Mechanism),
   1.353 +	mkEntry(CKM_CAST5_MAC_GENERAL, Mechanism),
   1.354 +	mkEntry(CKM_CAST128_MAC_GENERAL, Mechanism),
   1.355 +	mkEntry(CKM_CAST5_CBC_PAD, Mechanism),
   1.356 +	mkEntry(CKM_CAST128_CBC_PAD, Mechanism),
   1.357 +	mkEntry(CKM_RC5_KEY_GEN, Mechanism),
   1.358 +	mkEntry(CKM_RC5_ECB, Mechanism),
   1.359 +	mkEntry(CKM_RC5_CBC, Mechanism),
   1.360 +	mkEntry(CKM_RC5_MAC, Mechanism),
   1.361 +	mkEntry(CKM_RC5_MAC_GENERAL, Mechanism),
   1.362 +	mkEntry(CKM_RC5_CBC_PAD, Mechanism),
   1.363 +	mkEntry(CKM_IDEA_KEY_GEN, Mechanism),
   1.364 +	mkEntry(CKM_IDEA_ECB, Mechanism),
   1.365 +	mkEntry(CKM_IDEA_CBC, Mechanism),
   1.366 +	mkEntry(CKM_IDEA_MAC, Mechanism),
   1.367 +	mkEntry(CKM_IDEA_MAC_GENERAL, Mechanism),
   1.368 +	mkEntry(CKM_IDEA_CBC_PAD, Mechanism),
   1.369 +	mkEntry(CKM_GENERIC_SECRET_KEY_GEN, Mechanism),
   1.370 +	mkEntry(CKM_CONCATENATE_BASE_AND_KEY, Mechanism),
   1.371 +	mkEntry(CKM_CONCATENATE_BASE_AND_DATA, Mechanism),
   1.372 +	mkEntry(CKM_CONCATENATE_DATA_AND_BASE, Mechanism),
   1.373 +	mkEntry(CKM_XOR_BASE_AND_DATA, Mechanism),
   1.374 +	mkEntry(CKM_EXTRACT_KEY_FROM_KEY, Mechanism),
   1.375 +	mkEntry(CKM_SSL3_PRE_MASTER_KEY_GEN, Mechanism),
   1.376 +	mkEntry(CKM_SSL3_MASTER_KEY_DERIVE, Mechanism),
   1.377 +	mkEntry(CKM_SSL3_KEY_AND_MAC_DERIVE, Mechanism),
   1.378 +	mkEntry(CKM_SSL3_MASTER_KEY_DERIVE_DH, Mechanism),
   1.379 +	mkEntry(CKM_TLS_PRE_MASTER_KEY_GEN, Mechanism),
   1.380 +	mkEntry(CKM_TLS_MASTER_KEY_DERIVE, Mechanism),
   1.381 +	mkEntry(CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256, Mechanism),
   1.382 +	mkEntry(CKM_TLS_KEY_AND_MAC_DERIVE, Mechanism),
   1.383 +	mkEntry(CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256, Mechanism),
   1.384 +	mkEntry(CKM_TLS_MASTER_KEY_DERIVE_DH, Mechanism),
   1.385 +	mkEntry(CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256, Mechanism),
   1.386 +	mkEntry(CKM_SSL3_MD5_MAC, Mechanism),
   1.387 +	mkEntry(CKM_SSL3_SHA1_MAC, Mechanism),
   1.388 +	mkEntry(CKM_MD5_KEY_DERIVATION, Mechanism),
   1.389 +	mkEntry(CKM_MD2_KEY_DERIVATION, Mechanism),
   1.390 +	mkEntry(CKM_SHA1_KEY_DERIVATION, Mechanism),
   1.391 +	mkEntry(CKM_SHA256_KEY_DERIVATION, Mechanism),
   1.392 +	mkEntry(CKM_SHA384_KEY_DERIVATION, Mechanism),
   1.393 +	mkEntry(CKM_SHA512_KEY_DERIVATION, Mechanism),
   1.394 +	mkEntry(CKM_PBE_MD2_DES_CBC, Mechanism),
   1.395 +	mkEntry(CKM_PBE_MD5_DES_CBC, Mechanism),
   1.396 +	mkEntry(CKM_PBE_MD5_CAST_CBC, Mechanism),
   1.397 +	mkEntry(CKM_PBE_MD5_CAST3_CBC, Mechanism),
   1.398 +	mkEntry(CKM_PBE_MD5_CAST5_CBC, Mechanism),
   1.399 +	mkEntry(CKM_PBE_MD5_CAST128_CBC, Mechanism),
   1.400 +	mkEntry(CKM_PBE_SHA1_CAST5_CBC, Mechanism),
   1.401 +	mkEntry(CKM_PBE_SHA1_CAST128_CBC, Mechanism),
   1.402 +	mkEntry(CKM_PBE_SHA1_RC4_128, Mechanism),
   1.403 +	mkEntry(CKM_PBE_SHA1_RC4_40, Mechanism),
   1.404 +	mkEntry(CKM_PBE_SHA1_DES3_EDE_CBC, Mechanism),
   1.405 +	mkEntry(CKM_PBE_SHA1_DES2_EDE_CBC, Mechanism),
   1.406 +	mkEntry(CKM_PBE_SHA1_RC2_128_CBC, Mechanism),
   1.407 +	mkEntry(CKM_PBE_SHA1_RC2_40_CBC, Mechanism),
   1.408 +	mkEntry(CKM_PKCS5_PBKD2, Mechanism),
   1.409 +	mkEntry(CKM_PBA_SHA1_WITH_SHA1_HMAC, Mechanism),
   1.410 +	mkEntry(CKM_KEY_WRAP_LYNKS, Mechanism),
   1.411 +	mkEntry(CKM_KEY_WRAP_SET_OAEP, Mechanism),
   1.412 +	mkEntry(CKM_SKIPJACK_KEY_GEN, Mechanism),
   1.413 +	mkEntry(CKM_SKIPJACK_ECB64, Mechanism),
   1.414 +	mkEntry(CKM_SKIPJACK_CBC64, Mechanism),
   1.415 +	mkEntry(CKM_SKIPJACK_OFB64, Mechanism),
   1.416 +	mkEntry(CKM_SKIPJACK_CFB64, Mechanism),
   1.417 +	mkEntry(CKM_SKIPJACK_CFB32, Mechanism),
   1.418 +	mkEntry(CKM_SKIPJACK_CFB16, Mechanism),
   1.419 +	mkEntry(CKM_SKIPJACK_CFB8, Mechanism),
   1.420 +	mkEntry(CKM_SKIPJACK_WRAP, Mechanism),
   1.421 +	mkEntry(CKM_SKIPJACK_PRIVATE_WRAP, Mechanism),
   1.422 +	mkEntry(CKM_SKIPJACK_RELAYX, Mechanism),
   1.423 +	mkEntry(CKM_KEA_KEY_PAIR_GEN, Mechanism),
   1.424 +	mkEntry(CKM_KEA_KEY_DERIVE, Mechanism),
   1.425 +	mkEntry(CKM_FORTEZZA_TIMESTAMP, Mechanism),
   1.426 +	mkEntry(CKM_BATON_KEY_GEN, Mechanism),
   1.427 +	mkEntry(CKM_BATON_ECB128, Mechanism),
   1.428 +	mkEntry(CKM_BATON_ECB96, Mechanism),
   1.429 +	mkEntry(CKM_BATON_CBC128, Mechanism),
   1.430 +	mkEntry(CKM_BATON_COUNTER, Mechanism),
   1.431 +	mkEntry(CKM_BATON_SHUFFLE, Mechanism),
   1.432 +	mkEntry(CKM_BATON_WRAP, Mechanism),
   1.433 +	mkEntry(CKM_ECDSA_KEY_PAIR_GEN, Mechanism),
   1.434 +	mkEntry(CKM_EC_KEY_PAIR_GEN, Mechanism),
   1.435 +	mkEntry(CKM_ECDSA, Mechanism),
   1.436 +	mkEntry(CKM_ECDSA_SHA1, Mechanism),
   1.437 +	mkEntry(CKM_ECDH1_DERIVE, Mechanism),
   1.438 +	mkEntry(CKM_ECDH1_COFACTOR_DERIVE, Mechanism),
   1.439 +	mkEntry(CKM_ECMQV_DERIVE, Mechanism),
   1.440 +	mkEntry(CKM_JUNIPER_KEY_GEN, Mechanism),
   1.441 +	mkEntry(CKM_JUNIPER_ECB128, Mechanism),
   1.442 +	mkEntry(CKM_JUNIPER_CBC128, Mechanism),
   1.443 +	mkEntry(CKM_JUNIPER_COUNTER, Mechanism),
   1.444 +	mkEntry(CKM_JUNIPER_SHUFFLE, Mechanism),
   1.445 +	mkEntry(CKM_JUNIPER_WRAP, Mechanism),
   1.446 +	mkEntry(CKM_FASTHASH, Mechanism),
   1.447 +	mkEntry(CKM_AES_KEY_GEN, Mechanism),
   1.448 +	mkEntry(CKM_AES_ECB, Mechanism),
   1.449 +	mkEntry(CKM_AES_CBC, Mechanism),
   1.450 +	mkEntry(CKM_AES_MAC, Mechanism),
   1.451 +	mkEntry(CKM_AES_MAC_GENERAL, Mechanism),
   1.452 +	mkEntry(CKM_AES_CBC_PAD, Mechanism),
   1.453 +	mkEntry(CKM_CAMELLIA_KEY_GEN, Mechanism),
   1.454 +	mkEntry(CKM_CAMELLIA_ECB, Mechanism),
   1.455 +	mkEntry(CKM_CAMELLIA_CBC, Mechanism),
   1.456 +	mkEntry(CKM_CAMELLIA_MAC, Mechanism),
   1.457 +	mkEntry(CKM_CAMELLIA_MAC_GENERAL, Mechanism),
   1.458 +	mkEntry(CKM_CAMELLIA_CBC_PAD, Mechanism),
   1.459 +	mkEntry(CKM_SEED_KEY_GEN, Mechanism),
   1.460 +	mkEntry(CKM_SEED_ECB, Mechanism),
   1.461 +	mkEntry(CKM_SEED_CBC, Mechanism),
   1.462 +	mkEntry(CKM_SEED_MAC, Mechanism),
   1.463 +	mkEntry(CKM_SEED_MAC_GENERAL, Mechanism),
   1.464 +	mkEntry(CKM_SEED_CBC_PAD, Mechanism),
   1.465 +	mkEntry(CKM_SEED_ECB_ENCRYPT_DATA, Mechanism),
   1.466 +	mkEntry(CKM_SEED_CBC_ENCRYPT_DATA, Mechanism),
   1.467 +	mkEntry(CKM_DSA_PARAMETER_GEN, Mechanism),
   1.468 +	mkEntry(CKM_DH_PKCS_PARAMETER_GEN, Mechanism),
   1.469 +	mkEntry(CKM_NSS_AES_KEY_WRAP, Mechanism),
   1.470 +	mkEntry(CKM_NSS_AES_KEY_WRAP_PAD, Mechanism),
   1.471 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_DES_CBC, Mechanism),
   1.472 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC, Mechanism),
   1.473 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC, Mechanism),
   1.474 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC, Mechanism),
   1.475 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4, Mechanism),
   1.476 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4, Mechanism),
   1.477 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC, Mechanism),
   1.478 +	mkEntry(CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN, Mechanism),
   1.479 +	mkEntry(CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN, Mechanism),
   1.480 +	mkEntry(CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN, Mechanism),
   1.481 +	mkEntry(CKM_TLS_PRF_GENERAL, Mechanism),
   1.482 +	mkEntry(CKM_NSS_TLS_PRF_GENERAL_SHA256, Mechanism),
   1.483 +
   1.484 +	mkEntry(CKR_OK, Result),
   1.485 +	mkEntry(CKR_CANCEL, Result),
   1.486 +	mkEntry(CKR_HOST_MEMORY, Result),
   1.487 +	mkEntry(CKR_SLOT_ID_INVALID, Result),
   1.488 +	mkEntry(CKR_GENERAL_ERROR, Result),
   1.489 +	mkEntry(CKR_FUNCTION_FAILED, Result),
   1.490 +	mkEntry(CKR_ARGUMENTS_BAD, Result),
   1.491 +	mkEntry(CKR_NO_EVENT, Result),
   1.492 +	mkEntry(CKR_NEED_TO_CREATE_THREADS, Result),
   1.493 +	mkEntry(CKR_CANT_LOCK, Result),
   1.494 +	mkEntry(CKR_ATTRIBUTE_READ_ONLY, Result),
   1.495 +	mkEntry(CKR_ATTRIBUTE_SENSITIVE, Result),
   1.496 +	mkEntry(CKR_ATTRIBUTE_TYPE_INVALID, Result),
   1.497 +	mkEntry(CKR_ATTRIBUTE_VALUE_INVALID, Result),
   1.498 +	mkEntry(CKR_DATA_INVALID, Result),
   1.499 +	mkEntry(CKR_DATA_LEN_RANGE, Result),
   1.500 +	mkEntry(CKR_DEVICE_ERROR, Result),
   1.501 +	mkEntry(CKR_DEVICE_MEMORY, Result),
   1.502 +	mkEntry(CKR_DEVICE_REMOVED, Result),
   1.503 +	mkEntry(CKR_ENCRYPTED_DATA_INVALID, Result),
   1.504 +	mkEntry(CKR_ENCRYPTED_DATA_LEN_RANGE, Result),
   1.505 +	mkEntry(CKR_FUNCTION_CANCELED, Result),
   1.506 +	mkEntry(CKR_FUNCTION_NOT_PARALLEL, Result),
   1.507 +	mkEntry(CKR_FUNCTION_NOT_SUPPORTED, Result),
   1.508 +	mkEntry(CKR_KEY_HANDLE_INVALID, Result),
   1.509 +	mkEntry(CKR_KEY_SIZE_RANGE, Result),
   1.510 +	mkEntry(CKR_KEY_TYPE_INCONSISTENT, Result),
   1.511 +	mkEntry(CKR_KEY_NOT_NEEDED, Result),
   1.512 +	mkEntry(CKR_KEY_CHANGED, Result),
   1.513 +	mkEntry(CKR_KEY_NEEDED, Result),
   1.514 +	mkEntry(CKR_KEY_INDIGESTIBLE, Result),
   1.515 +	mkEntry(CKR_KEY_FUNCTION_NOT_PERMITTED, Result),
   1.516 +	mkEntry(CKR_KEY_NOT_WRAPPABLE, Result),
   1.517 +	mkEntry(CKR_KEY_UNEXTRACTABLE, Result),
   1.518 +	mkEntry(CKR_KEY_PARAMS_INVALID, Result),
   1.519 +	mkEntry(CKR_MECHANISM_INVALID, Result),
   1.520 +	mkEntry(CKR_MECHANISM_PARAM_INVALID, Result),
   1.521 +	mkEntry(CKR_OBJECT_HANDLE_INVALID, Result),
   1.522 +	mkEntry(CKR_OPERATION_ACTIVE, Result),
   1.523 +	mkEntry(CKR_OPERATION_NOT_INITIALIZED, Result),
   1.524 +	mkEntry(CKR_PIN_INCORRECT, Result),
   1.525 +	mkEntry(CKR_PIN_INVALID, Result),
   1.526 +	mkEntry(CKR_PIN_LEN_RANGE, Result),
   1.527 +	mkEntry(CKR_PIN_EXPIRED, Result),
   1.528 +	mkEntry(CKR_PIN_LOCKED, Result),
   1.529 +	mkEntry(CKR_SESSION_CLOSED, Result),
   1.530 +	mkEntry(CKR_SESSION_COUNT, Result),
   1.531 +	mkEntry(CKR_SESSION_HANDLE_INVALID, Result),
   1.532 +	mkEntry(CKR_SESSION_PARALLEL_NOT_SUPPORTED, Result),
   1.533 +	mkEntry(CKR_SESSION_READ_ONLY, Result),
   1.534 +	mkEntry(CKR_SESSION_EXISTS, Result),
   1.535 +	mkEntry(CKR_SESSION_READ_ONLY_EXISTS, Result),
   1.536 +	mkEntry(CKR_SESSION_READ_WRITE_SO_EXISTS, Result),
   1.537 +	mkEntry(CKR_SIGNATURE_INVALID, Result),
   1.538 +	mkEntry(CKR_SIGNATURE_LEN_RANGE, Result),
   1.539 +	mkEntry(CKR_TEMPLATE_INCOMPLETE, Result),
   1.540 +	mkEntry(CKR_TEMPLATE_INCONSISTENT, Result),
   1.541 +	mkEntry(CKR_TOKEN_NOT_PRESENT, Result),
   1.542 +	mkEntry(CKR_TOKEN_NOT_RECOGNIZED, Result),
   1.543 +	mkEntry(CKR_TOKEN_WRITE_PROTECTED, Result),
   1.544 +	mkEntry(CKR_UNWRAPPING_KEY_HANDLE_INVALID, Result),
   1.545 +	mkEntry(CKR_UNWRAPPING_KEY_SIZE_RANGE, Result),
   1.546 +	mkEntry(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT, Result),
   1.547 +	mkEntry(CKR_USER_ALREADY_LOGGED_IN, Result),
   1.548 +	mkEntry(CKR_USER_NOT_LOGGED_IN, Result),
   1.549 +	mkEntry(CKR_USER_PIN_NOT_INITIALIZED, Result),
   1.550 +	mkEntry(CKR_USER_TYPE_INVALID, Result),
   1.551 +	mkEntry(CKR_USER_ANOTHER_ALREADY_LOGGED_IN, Result),
   1.552 +	mkEntry(CKR_USER_TOO_MANY_TYPES, Result),
   1.553 +	mkEntry(CKR_WRAPPED_KEY_INVALID, Result),
   1.554 +	mkEntry(CKR_WRAPPED_KEY_LEN_RANGE, Result),
   1.555 +	mkEntry(CKR_WRAPPING_KEY_HANDLE_INVALID, Result),
   1.556 +	mkEntry(CKR_WRAPPING_KEY_SIZE_RANGE, Result),
   1.557 +	mkEntry(CKR_WRAPPING_KEY_TYPE_INCONSISTENT, Result),
   1.558 +	mkEntry(CKR_RANDOM_SEED_NOT_SUPPORTED, Result),
   1.559 +	mkEntry(CKR_RANDOM_NO_RNG, Result),
   1.560 +	mkEntry(CKR_DOMAIN_PARAMS_INVALID, Result),
   1.561 +	mkEntry(CKR_BUFFER_TOO_SMALL, Result),
   1.562 +	mkEntry(CKR_SAVED_STATE_INVALID, Result),
   1.563 +	mkEntry(CKR_INFORMATION_SENSITIVE, Result),
   1.564 +	mkEntry(CKR_STATE_UNSAVEABLE, Result),
   1.565 +	mkEntry(CKR_CRYPTOKI_NOT_INITIALIZED, Result),
   1.566 +	mkEntry(CKR_CRYPTOKI_ALREADY_INITIALIZED, Result),
   1.567 +	mkEntry(CKR_MUTEX_BAD, Result),
   1.568 +	mkEntry(CKR_MUTEX_NOT_LOCKED, Result),
   1.569 +	mkEntry(CKR_VENDOR_DEFINED, Result),
   1.570 +
   1.571 +	mkEntry(CKT_NSS_TRUSTED, Trust),
   1.572 +	mkEntry(CKT_NSS_TRUSTED_DELEGATOR, Trust),
   1.573 +	mkEntry(CKT_NSS_NOT_TRUSTED, Trust),
   1.574 +	mkEntry(CKT_NSS_MUST_VERIFY_TRUST, Trust),
   1.575 +	mkEntry(CKT_NSS_TRUST_UNKNOWN, Trust),
   1.576 +	mkEntry(CKT_NSS_VALID_DELEGATOR, Trust),
   1.577 +
   1.578 +	mkEntry(CK_EFFECTIVELY_INFINITE, AvailableSizes),
   1.579 +	mkEntry(CK_UNAVAILABLE_INFORMATION, CurrentSize),
   1.580 +};
   1.581 +
   1.582 +const Constant *consts = &_consts[0];
   1.583 +const int constCount = sizeof(_consts)/sizeof(_consts[0]);
   1.584 +
   1.585 +const Commands _commands[] = {
   1.586 +    {"C_Initialize", F_C_Initialize,
   1.587 +"C_Initialize pInitArgs\n\n"
   1.588 +"C_Initialize initializes the PKCS #11 library.\n"
   1.589 +"  pInitArgs  if this is not NULL_PTR it gets cast to and dereferenced\n",
   1.590 +	{ArgInitializeArgs, ArgNone, ArgNone, ArgNone, ArgNone,
   1.591 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.592 +    {"C_Finalize", F_C_Finalize,
   1.593 +"C_Finalize pReserved\n\n"
   1.594 +"C_Finalize indicates that an application is done with the PKCS #11 library.\n"
   1.595 +" pReserved  reserved. Should be NULL_PTR\n",
   1.596 +	{ArgInitializeArgs, ArgNone, ArgNone, ArgNone, ArgNone,
   1.597 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.598 +    {"C_GetInfo", F_C_GetInfo,
   1.599 +"C_GetInfo pInfo\n\n"
   1.600 +"C_GetInfo returns general information about PKCS #11.\n"
   1.601 +" pInfo   location that receives information\n",
   1.602 +	{ArgInfo|ArgOut,   ArgNone, ArgNone, ArgNone, ArgNone,
   1.603 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.604 +    {"C_GetFunctionList", F_C_GetFunctionList,
   1.605 +"C_GetFunctionList ppFunctionList\n\n"
   1.606 +"C_GetFunctionList returns the function list.\n"
   1.607 +" ppFunctionList   receives pointer to function list\n",
   1.608 +	{ArgFunctionList|ArgOut,   ArgNone, ArgNone, ArgNone, ArgNone,
   1.609 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.610 +    {"C_GetSlotList", F_C_GetSlotList,
   1.611 +"C_GetSlotList tokenPresent pSlotList pulCount\n\n"
   1.612 +"C_GetSlotList obtains a list of slots in the system.\n"
   1.613 +" tokenPresent    only slots with tokens?\n"
   1.614 +" pSlotList       receives array of slot IDs\n"
   1.615 +" pulCount        receives number of slots\n",
   1.616 +	{ArgULong, ArgULong|ArgArray|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
   1.617 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.618 +    {"C_GetSlotInfo", F_C_GetSlotInfo,
   1.619 +"C_GetSlotInfo slotID pInfo\n\n"
   1.620 +"C_GetSlotInfo obtains information about a particular slot in the system.\n"
   1.621 +" slotID    the ID of the slot\n"
   1.622 +" pInfo     receives the slot information\n",
   1.623 +	{ArgULong, ArgSlotInfo|ArgOut, ArgNone, ArgNone, ArgNone,
   1.624 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.625 +    {"C_GetTokenInfo", F_C_GetTokenInfo,
   1.626 +"C_GetTokenInfo slotID pInfo\n\n"
   1.627 +"C_GetTokenInfo obtains information about a particular token in the system.\n"
   1.628 +" slotID    ID of the token's slot\n"
   1.629 +" pInfo     receives the token information\n",
   1.630 +	{ArgULong, ArgTokenInfo|ArgOut, ArgNone, ArgNone, ArgNone,
   1.631 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.632 +    {"C_GetMechanismList", F_C_GetMechanismList,
   1.633 +"C_GetMechanismList slotID pMechanismList pulCount\n\n"
   1.634 +"C_GetMechanismList obtains a list of mechanism types supported by a token.\n"
   1.635 +" slotID            ID of token's slot\n"
   1.636 +" pMechanismList    gets mech. array\n"
   1.637 +" pulCount          gets # of mechs.\n",
   1.638 +	{ArgULong, ArgULong|ArgArray|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
   1.639 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.640 +    {"C_GetMechanismInfo", F_C_GetMechanismInfo,
   1.641 +"C_GetMechanismInfo slotID type pInfo\n\n"
   1.642 +"C_GetMechanismInfo obtains information about a particular mechanism possibly\n"
   1.643 +"supported by a token.\n"
   1.644 +" slotID    ID of the token's slot\n"
   1.645 +" type      type of mechanism\n"
   1.646 +" pInfo     receives mechanism info\n",
   1.647 +	{ArgULong, ArgULong, ArgMechanismInfo|ArgOut, ArgNone, ArgNone,
   1.648 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.649 +    {"C_InitToken", F_C_InitToken,
   1.650 +"C_InitToken slotID pPin ulPinLen pLabel\n\n"
   1.651 +"C_InitToken initializes a token.\n"
   1.652 +" slotID      ID of the token's slot\n"
   1.653 +" pPin        the SO's initial PIN\n"
   1.654 +" ulPinLen    length in bytes of the PIN\n"
   1.655 +" pLabel      32-byte token label (blank padded)\n",
   1.656 +	{ArgULong, ArgUTF8, ArgULong, ArgUTF8, ArgNone,
   1.657 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.658 +    {"C_InitPIN", F_C_InitPIN,
   1.659 +"C_InitPIN hSession pPin ulPinLen\n\n"
   1.660 +"C_InitPIN initializes the normal user's PIN.\n"
   1.661 +" hSession    the session's handle\n"
   1.662 +" pPin        the normal user's PIN\n"
   1.663 +" ulPinLen    length in bytes of the PIN\n",
   1.664 +	{ArgULong, ArgUTF8, ArgULong, ArgNone, ArgNone,
   1.665 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.666 +    {"C_SetPIN", F_C_SetPIN,
   1.667 +"C_SetPIN hSession pOldPin ulOldLen pNewPin ulNewLen\n\n"
   1.668 +"C_SetPIN modifies the PIN of the user who is logged in.\n"
   1.669 +" hSession    the session's handle\n"
   1.670 +" pOldPin     the old PIN\n"
   1.671 +" ulOldLen    length of the old PIN\n"
   1.672 +" pNewPin     the new PIN\n"
   1.673 +" ulNewLen    length of the new PIN\n",
   1.674 +	{ArgULong, ArgUTF8, ArgULong, ArgUTF8, ArgULong,
   1.675 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.676 +    {"C_OpenSession", F_C_OpenSession,
   1.677 +"C_OpenSession slotID flags phSession\n\n"
   1.678 +"C_OpenSession opens a session between an application and a token.\n"
   1.679 +" slotID          the slot's ID\n"
   1.680 +" flags           from\n"
   1.681 +" phSession       gets session handle\n",
   1.682 +	{ArgULong, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone,
   1.683 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.684 +    {"C_CloseSession", F_C_CloseSession,
   1.685 +"C_CloseSession hSession\n\n"
   1.686 +"C_CloseSession closes a session between an application and a token.\n"
   1.687 +" hSession   the session's handle\n",
   1.688 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
   1.689 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.690 +    {"C_CloseAllSessions", F_C_CloseAllSessions,
   1.691 +"C_CloseAllSessions slotID\n\n"
   1.692 +"C_CloseAllSessions closes all sessions with a token.\n"
   1.693 +" slotID   the token's slot\n",
   1.694 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
   1.695 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.696 +    {"C_GetSessionInfo", F_C_GetSessionInfo,
   1.697 +"C_GetSessionInfo hSession pInfo\n\n"
   1.698 +"C_GetSessionInfo obtains information about the session.\n"
   1.699 +" hSession    the session's handle\n"
   1.700 +" pInfo       receives session info\n",
   1.701 +	{ArgULong, ArgSessionInfo|ArgOut, ArgNone, ArgNone, ArgNone,
   1.702 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.703 +    {"C_GetOperationState", F_C_GetOperationState,
   1.704 +"C_GetOperationState hSession pOpState pulOpStateLen\n\n"
   1.705 +"C_GetOperationState obtains the state of the cryptographic operation in a\n"
   1.706 +"session.\n"
   1.707 +" hSession        session's handle\n"
   1.708 +" pOpState        gets state\n"
   1.709 +" pulOpStateLen   gets state length\n",
   1.710 +	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
   1.711 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.712 +    {"C_SetOperationState", F_C_SetOperationState,
   1.713 +"C_SetOperationState hSession pOpState ulOpStateLen hEncKey hAuthKey\n\n"
   1.714 +"C_SetOperationState restores the state of the cryptographic operation in a\n"
   1.715 +"session.\n"
   1.716 +" hSession        session's handle\n"
   1.717 +" pOpState        holds state\n"
   1.718 +" ulOpStateLen    holds state length\n"
   1.719 +" hEncKey         en/decryption key\n"
   1.720 +" hAuthnKey       sign/verify key\n",
   1.721 +	{ArgULong, ArgChar|ArgOut, ArgULong, ArgULong, ArgULong,
   1.722 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.723 +    {"C_Login", F_C_Login,
   1.724 +"C_Login hSession userType pPin ulPinLen\n\n"
   1.725 +"C_Login logs a user into a token.\n"
   1.726 +" hSession    the session's handle\n"
   1.727 +" userType    the user type\n"
   1.728 +" pPin        the user's PIN\n"
   1.729 +" ulPinLen    the length of the PIN\n",
   1.730 +	{ArgULong, ArgULong, ArgVar, ArgULong, ArgNone,
   1.731 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.732 +    {"C_Logout", F_C_Logout,
   1.733 +"C_Logout hSession\n\n"
   1.734 +"C_Logout logs a user out from a token.\n"
   1.735 +" hSession   the session's handle\n",
   1.736 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
   1.737 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.738 +    {"C_CreateObject", F_C_CreateObject,
   1.739 +"C_CreateObject hSession pTemplate ulCount phObject\n\n"
   1.740 +"C_CreateObject creates a new object.\n"
   1.741 +" hSession      the session's handle\n"
   1.742 +" pTemplate     the object's template\n"
   1.743 +" ulCount       attributes in template\n"
   1.744 +" phObject   gets new object's handle.\n",
   1.745 +	{ArgULong, ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut, ArgNone,
   1.746 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.747 +    {"C_CopyObject", F_C_CopyObject,
   1.748 +"C_CopyObject hSession hObject pTemplate ulCount phNewObject\n\n"
   1.749 +"C_CopyObject copies an object creating a new object for the copy.\n"
   1.750 +" hSession      the session's handle\n"
   1.751 +" hObject       the object's handle\n"
   1.752 +" pTemplate     template for new object\n"
   1.753 +" ulCount       attributes in template\n"
   1.754 +" phNewObject   receives handle of copy\n",
   1.755 +	{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut,
   1.756 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.757 +    {"C_DestroyObject", F_C_DestroyObject,
   1.758 +"C_DestroyObject hSession hObject\n\n"
   1.759 +"C_DestroyObject destroys an object.\n"
   1.760 +" hSession    the session's handle\n"
   1.761 +" hObject     the object's handle\n",
   1.762 +	{ArgULong, ArgULong, ArgNone, ArgNone, ArgNone,
   1.763 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.764 +    {"C_GetObjectSize", F_C_GetObjectSize,
   1.765 +"C_GetObjectSize hSession hObject pulSize\n\n"
   1.766 +"C_GetObjectSize gets the size of an object in bytes.\n"
   1.767 +" hSession    the session's handle\n"
   1.768 +" hObject     the object's handle\n"
   1.769 +" pulSize     receives size of object\n",
   1.770 +	{ArgULong, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone,
   1.771 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.772 +    {"C_GetAttributeValue", F_C_GetAttributeValue,
   1.773 +"C_GetAttributeValue hSession hObject pTemplate ulCount\n\n"
   1.774 +"C_GetAttributeValue obtains the value of one or more object attributes.\n"
   1.775 +" hSession     the session's handle\n"
   1.776 +" hObject      the object's handle\n"
   1.777 +" pTemplate    specifies attrs; gets vals\n"
   1.778 +" ulCount      attributes in template\n",
   1.779 +	{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone,
   1.780 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.781 +    {"C_SetAttributeValue", F_C_SetAttributeValue,
   1.782 +"C_SetAttributeValue hSession hObject pTemplate ulCount\n\n"
   1.783 +"C_SetAttributeValue modifies the value of one or more object attributes\n"
   1.784 +" hSession     the session's handle\n"
   1.785 +" hObject      the object's handle\n"
   1.786 +" pTemplate    specifies attrs and values\n"
   1.787 +" ulCount      attributes in template\n",
   1.788 +	{ArgULong, ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone,
   1.789 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.790 +    {"C_FindObjectsInit", F_C_FindObjectsInit,
   1.791 +"C_FindObjectsInit hSession pTemplate ulCount\n\n"
   1.792 +"C_FindObjectsInit initializes a search for token and session objects that\n"
   1.793 +"match a template.\n"
   1.794 +" hSession     the session's handle\n"
   1.795 +" pTemplate    attribute values to match\n"
   1.796 +" ulCount      attrs in search template\n",
   1.797 +	{ArgULong, ArgAttribute|ArgArray, ArgULong, ArgNone, ArgNone,
   1.798 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.799 +    {"C_FindObjectsFinal", F_C_FindObjectsFinal,
   1.800 +"C_FindObjectsFinal hSession\n\n"
   1.801 +"C_FindObjectsFinal finishes a search for token and session objects.\n"
   1.802 +" hSession   the session's handle\n",
   1.803 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
   1.804 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.805 +    {"C_FindObjects", F_C_FindObjects,
   1.806 +"C_FindObjects hSession phObject ulMaxObjectCount pulObjectCount\n\n"
   1.807 +"C_FindObjects continues a search for token and session objects that match\n"
   1.808 +"a template obtaining additional object handles.\n"
   1.809 +" hSession            session's handle\n"
   1.810 +" phObject            gets obj. handles\n"
   1.811 +" ulMaxObjectCount    max handles to get\n"
   1.812 +" pulObjectCount      actual # returned\n",
   1.813 +	{ArgULong, ArgULong|ArgOut, ArgULong, ArgULong|ArgOut, ArgNone,
   1.814 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.815 +    {"C_EncryptInit", F_C_EncryptInit,
   1.816 +"C_EncryptInit hSession pMechanism hKey\n\n"
   1.817 +"C_EncryptInit initializes an encryption operation.\n"
   1.818 +" hSession      the session's handle\n"
   1.819 +" pMechanism    the encryption mechanism\n"
   1.820 +" hKey          handle of encryption key\n",
   1.821 +	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
   1.822 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.823 +    {"C_EncryptUpdate", F_C_EncryptUpdate,
   1.824 +"C_EncryptUpdate hSession pPart ulPartLen pEncryptedPart pulEncryptedPartLen\n"
   1.825 +"\n"
   1.826 +"C_EncryptUpdate continues a multiple-part encryption operation.\n"
   1.827 +" hSession             session's handle\n"
   1.828 +" pPart                the plaintext data\n"
   1.829 +" ulPartLen            plaintext data len\n"
   1.830 +" pEncryptedPart       gets ciphertext\n"
   1.831 +" pulEncryptedPartLen  gets c-text size\n",
   1.832 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.833 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.834 +    {"C_EncryptFinal", F_C_EncryptFinal,
   1.835 +"C_EncryptFinal hSession pLastEncryptedPart pulLastEncryptedPartLen\n\n"
   1.836 +"C_EncryptFinal finishes a multiple-part encryption operation.\n"
   1.837 +" hSession                  session handle\n"
   1.838 +" pLastEncryptedPart        last c-text\n"
   1.839 +" pulLastEncryptedPartLen   gets last size\n",
   1.840 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.841 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.842 +    {"C_Encrypt", F_C_Encrypt,
   1.843 +"C_Encrypt hSession pData ulDataLen pEncryptedData pulEncryptedDataLen\n\n"
   1.844 +"C_Encrypt encrypts single-part data.\n"
   1.845 +" hSession              session's handle\n"
   1.846 +" pData                 the plaintext data\n"
   1.847 +" ulDataLen             bytes of plaintext\n"
   1.848 +" pEncryptedData        gets ciphertext\n"
   1.849 +" pulEncryptedDataLen   gets c-text size\n",
   1.850 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.851 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.852 +    {"C_DecryptInit", F_C_DecryptInit,
   1.853 +"C_DecryptInit hSession pMechanism hKey\n\n"
   1.854 +"C_DecryptInit initializes a decryption operation.\n"
   1.855 +" hSession      the session's handle\n"
   1.856 +" pMechanism    the decryption mechanism\n"
   1.857 +" hKey          handle of decryption key\n",
   1.858 +	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
   1.859 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.860 +    {"C_DecryptUpdate", F_C_DecryptUpdate,
   1.861 +"C_DecryptUpdate hSession pEncryptedPart ulEncryptedPartLen pPart pulPartLen\n"
   1.862 +"\n"
   1.863 +"C_DecryptUpdate continues a multiple-part decryption operation.\n"
   1.864 +" hSession              session's handle\n"
   1.865 +" pEncryptedPart        encrypted data\n"
   1.866 +" ulEncryptedPartLen    input length\n"
   1.867 +" pPart                 gets plaintext\n"
   1.868 +" pulPartLen            p-text size\n",
   1.869 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.870 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.871 +    {"C_DecryptFinal", F_C_DecryptFinal,
   1.872 +"C_DecryptFinal hSession pLastPart pulLastPartLen\n\n"
   1.873 +"C_DecryptFinal finishes a multiple-part decryption operation.\n"
   1.874 +" hSession         the session's handle\n"
   1.875 +" pLastPart        gets plaintext\n"
   1.876 +" pulLastPartLen   p-text size\n",
   1.877 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.878 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.879 +    {"C_Decrypt", F_C_Decrypt,
   1.880 +"C_Decrypt hSession pEncryptedData ulEncryptedDataLen pData pulDataLen\n\n"
   1.881 +"C_Decrypt decrypts encrypted data in a single part.\n"
   1.882 +" hSession             session's handle\n"
   1.883 +" pEncryptedData       ciphertext\n"
   1.884 +" ulEncryptedDataLen   ciphertext length\n"
   1.885 +" pData                gets plaintext\n"
   1.886 +" pulDataLen           gets p-text size\n",
   1.887 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.888 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.889 +    {"C_DigestInit", F_C_DigestInit,
   1.890 +"C_DigestInit hSession pMechanism\n\n"
   1.891 +"C_DigestInit initializes a message-digesting operation.\n"
   1.892 +" hSession     the session's handle\n"
   1.893 +" pMechanism   the digesting mechanism\n",
   1.894 +	{ArgULong, ArgMechanism, ArgNone, ArgNone, ArgNone,
   1.895 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.896 +    {"C_DigestUpdate", F_C_DigestUpdate,
   1.897 +"C_DigestUpdate hSession pPart ulPartLen\n\n"
   1.898 +"C_DigestUpdate continues a multiple-part message-digesting operation.\n"
   1.899 +" hSession    the session's handle\n"
   1.900 +" pPart       data to be digested\n"
   1.901 +" ulPartLen   bytes of data to be digested\n",
   1.902 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.903 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.904 +    {"C_DigestKey", F_C_DigestKey,
   1.905 +"C_DigestKey hSession hKey\n\n"
   1.906 +"C_DigestKey continues a multi-part message-digesting operation by digesting\n"
   1.907 +"the value of a secret key as part of the data already digested.\n"
   1.908 +" hSession    the session's handle\n"
   1.909 +" hKey        secret key to digest\n",
   1.910 +	{ArgULong, ArgULong, ArgNone, ArgNone, ArgNone,
   1.911 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.912 +    {"C_DigestFinal", F_C_DigestFinal,
   1.913 +"C_DigestFinal hSession pDigest pulDigestLen\n\n"
   1.914 +"C_DigestFinal finishes a multiple-part message-digesting operation.\n"
   1.915 +" hSession       the session's handle\n"
   1.916 +" pDigest        gets the message digest\n"
   1.917 +" pulDigestLen   gets byte count of digest\n",
   1.918 +	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
   1.919 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.920 +    {"C_Digest", F_C_Digest,
   1.921 +"C_Digest hSession pData ulDataLen pDigest pulDigestLen\n\n"
   1.922 +"C_Digest digests data in a single part.\n"
   1.923 +" hSession       the session's handle\n"
   1.924 +" pData          data to be digested\n"
   1.925 +" ulDataLen      bytes of data to digest\n"
   1.926 +" pDigest        gets the message digest\n"
   1.927 +" pulDigestLen   gets digest length\n",
   1.928 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.929 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.930 +    {"C_SignInit", F_C_SignInit,
   1.931 +"C_SignInit hSession pMechanism hKey\n\n"
   1.932 +"C_SignInit initializes a signature (private key encryption operation where\n"
   1.933 +"the signature is (will be) an appendix to the data and plaintext cannot be\n"
   1.934 +"recovered from the signature.\n"
   1.935 +" hSession      the session's handle\n"
   1.936 +" pMechanism    the signature mechanism\n"
   1.937 +" hKey          handle of signature key\n",
   1.938 +	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
   1.939 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.940 +    {"C_SignUpdate", F_C_SignUpdate,
   1.941 +"C_SignUpdate hSession pPart ulPartLen\n\n"
   1.942 +"C_SignUpdate continues a multiple-part signature operation where the\n"
   1.943 +"signature is (will be) an appendix to the data and plaintext cannot be\n"
   1.944 +"recovered from the signature.\n"
   1.945 +" hSession    the session's handle\n"
   1.946 +" pPart       the data to sign\n"
   1.947 +" ulPartLen   count of bytes to sign\n",
   1.948 +	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
   1.949 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.950 +    {"C_SignFinal", F_C_SignFinal,
   1.951 +"C_SignFinal hSession pSignature pulSignatureLen\n\n"
   1.952 +"C_SignFinal finishes a multiple-part signature operation returning the\n"
   1.953 +"signature.\n"
   1.954 +" hSession          the session's handle\n"
   1.955 +" pSignature        gets the signature\n"
   1.956 +" pulSignatureLen   gets signature length\n",
   1.957 +	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
   1.958 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.959 +    {"C_SignRecoverInit", F_C_SignRecoverInit,
   1.960 +"C_SignRecoverInit hSession pMechanism hKey\n\n"
   1.961 +"C_SignRecoverInit initializes a signature operation where the data can be\n"
   1.962 +"recovered from the signature.\n"
   1.963 +" hSession     the session's handle\n"
   1.964 +" pMechanism   the signature mechanism\n"
   1.965 +" hKey         handle of the signature key\n",
   1.966 +	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
   1.967 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.968 +    {"C_SignRecover", F_C_SignRecover,
   1.969 +"C_SignRecover hSession pData ulDataLen pSignature pulSignatureLen\n\n"
   1.970 +"C_SignRecover signs data in a single operation where the data can be\n"
   1.971 +"recovered from the signature.\n"
   1.972 +" hSession          the session's handle\n"
   1.973 +" pData             the data to sign\n"
   1.974 +" ulDataLen         count of bytes to sign\n"
   1.975 +" pSignature        gets the signature\n"
   1.976 +" pulSignatureLen   gets signature length\n",
   1.977 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.978 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.979 +    {"C_Sign", F_C_Sign,
   1.980 +"C_Sign hSession pData ulDataLen pSignature pulSignatureLen\n\n"
   1.981 +"C_Sign signs (encrypts with private key) data in a single part where the\n"
   1.982 +"signature is (will be) an appendix to the data and plaintext cannot be\n"
   1.983 +"recovered from the signature.\n"
   1.984 +" hSession          the session's handle\n"
   1.985 +" pData             the data to sign\n"
   1.986 +" ulDataLen         count of bytes to sign\n"
   1.987 +" pSignature        gets the signature\n"
   1.988 +" pulSignatureLen   gets signature length\n",
   1.989 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
   1.990 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
   1.991 +    {"C_VerifyInit", F_C_VerifyInit,
   1.992 +"C_VerifyInit hSession pMechanism hKey\n\n"
   1.993 +"C_VerifyInit initializes a verification operation where the signature is an\n"
   1.994 +"appendix to the data and plaintext cannot cannot be recovered from the\n"
   1.995 +"signature (e.g. DSA).\n"
   1.996 +" hSession      the session's handle\n"
   1.997 +" pMechanism    the verification mechanism\n"
   1.998 +" hKey          verification key\n",
   1.999 +	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
  1.1000 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1001 +    {"C_VerifyUpdate", F_C_VerifyUpdate,
  1.1002 +"C_VerifyUpdate hSession pPart ulPartLen\n\n"
  1.1003 +"C_VerifyUpdate continues a multiple-part verification operation where the\n"
  1.1004 +"signature is an appendix to the data and plaintext cannot be recovered from\n"
  1.1005 +"the signature.\n"
  1.1006 +" hSession    the session's handle\n"
  1.1007 +" pPart       signed data\n"
  1.1008 +" ulPartLen   length of signed data\n",
  1.1009 +	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
  1.1010 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1011 +    {"C_VerifyFinal", F_C_VerifyFinal,
  1.1012 +"C_VerifyFinal hSession pSignature ulSignatureLen\n\n"
  1.1013 +"C_VerifyFinal finishes a multiple-part verification operation checking the\n"
  1.1014 +"signature.\n"
  1.1015 +" hSession         the session's handle\n"
  1.1016 +" pSignature       signature to verify\n"
  1.1017 +" ulSignatureLen   signature length\n",
  1.1018 +	{ArgULong, ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone,
  1.1019 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1020 +    {"C_VerifyRecoverInit", F_C_VerifyRecoverInit,
  1.1021 +"C_VerifyRecoverInit hSession pMechanism hKey\n\n"
  1.1022 +"C_VerifyRecoverInit initializes a signature verification operation where the\n"
  1.1023 +"data is recovered from the signature.\n"
  1.1024 +" hSession      the session's handle\n"
  1.1025 +" pMechanism    the verification mechanism\n"
  1.1026 +" hKey          verification key\n",
  1.1027 +	{ArgULong, ArgMechanism, ArgULong, ArgNone, ArgNone,
  1.1028 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1029 +    {"C_VerifyRecover", F_C_VerifyRecover,
  1.1030 +"C_VerifyRecover hSession pSignature ulSignatureLen pData pulDataLen\n\n"
  1.1031 +"C_VerifyRecover verifies a signature in a single-part operation where the\n"
  1.1032 +"data is recovered from the signature.\n"
  1.1033 +" hSession          the session's handle\n"
  1.1034 +" pSignature        signature to verify\n"
  1.1035 +" ulSignatureLen    signature length\n"
  1.1036 +" pData             gets signed data\n"
  1.1037 +" pulDataLen        gets signed data len\n",
  1.1038 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
  1.1039 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1040 +    {"C_Verify", F_C_Verify,
  1.1041 +"C_Verify hSession pData ulDataLen pSignature ulSignatureLen\n\n"
  1.1042 +"C_Verify verifies a signature in a single-part operation where the signature\n"
  1.1043 +"is an appendix to the data and plaintext cannot be recovered from the\n"
  1.1044 +"signature.\n"
  1.1045 +" hSession         the session's handle\n"
  1.1046 +" pData            signed data\n"
  1.1047 +" ulDataLen        length of signed data\n"
  1.1048 +" pSignature       signature\n"
  1.1049 +" ulSignatureLen   signature length*/\n",
  1.1050 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
  1.1051 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1052 +    {"C_DigestEncryptUpdate", F_C_DigestEncryptUpdate,
  1.1053 +"C_DigestEncryptUpdate hSession pPart ulPartLen pEncryptedPart \\\n"
  1.1054 +"    pulEncryptedPartLen\n\n"
  1.1055 +"C_DigestEncryptUpdate continues a multiple-part digesting and encryption\n"
  1.1056 +"operation.\n"
  1.1057 +" hSession              session's handle\n"
  1.1058 +" pPart                 the plaintext data\n"
  1.1059 +" ulPartLen             plaintext length\n"
  1.1060 +" pEncryptedPart        gets ciphertext\n"
  1.1061 +" pulEncryptedPartLen   gets c-text length\n",
  1.1062 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
  1.1063 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1064 +    {"C_DecryptDigestUpdate", F_C_DecryptDigestUpdate,
  1.1065 +"C_DecryptDigestUpdate hSession pEncryptedPart ulEncryptedPartLen pPart \\\n"
  1.1066 +"    pulPartLen\n\n"
  1.1067 +"C_DecryptDigestUpdate continues a multiple-part decryption and digesting\n"
  1.1068 +"operation.\n"
  1.1069 +" hSession              session's handle\n"
  1.1070 +" pEncryptedPart        ciphertext\n"
  1.1071 +" ulEncryptedPartLen    ciphertext length\n"
  1.1072 +" pPart                 gets plaintext\n"
  1.1073 +" pulPartLen            gets plaintext len\n",
  1.1074 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
  1.1075 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1076 +    {"C_SignEncryptUpdate", F_C_SignEncryptUpdate,
  1.1077 +"C_SignEncryptUpdate hSession pPart ulPartLen pEncryptedPart \\\n"
  1.1078 +"    pulEncryptedPartLen\n\n"
  1.1079 +"C_SignEncryptUpdate continues a multiple-part signing and encryption\n"
  1.1080 +"operation.\n"
  1.1081 +" hSession              session's handle\n"
  1.1082 +" pPart                 the plaintext data\n"
  1.1083 +" ulPartLen             plaintext length\n"
  1.1084 +" pEncryptedPart        gets ciphertext\n"
  1.1085 +" pulEncryptedPartLen   gets c-text length\n",
  1.1086 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
  1.1087 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1088 +    {"C_DecryptVerifyUpdate", F_C_DecryptVerifyUpdate,
  1.1089 +"C_DecryptVerifyUpdate hSession pEncryptedPart ulEncryptedPartLen pPart \\\n"
  1.1090 +"    pulPartLen\n\n"
  1.1091 +"C_DecryptVerifyUpdate continues a multiple-part decryption and verify\n"
  1.1092 +"operation.\n"
  1.1093 +" hSession              session's handle\n"
  1.1094 +" pEncryptedPart        ciphertext\n"
  1.1095 +" ulEncryptedPartLen    ciphertext length\n"
  1.1096 +" pPart                 gets plaintext\n"
  1.1097 +" pulPartLen            gets p-text length\n",
  1.1098 +	{ArgULong, ArgChar, ArgULong, ArgChar|ArgOut, ArgULong|ArgOut,
  1.1099 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1100 +    {"C_GenerateKeyPair", F_C_GenerateKeyPair,
  1.1101 +"C_GenerateKeyPair hSession pMechanism pPublicKeyTemplate \\\n"
  1.1102 +"    ulPublicKeyAttributeCount pPrivateKeyTemplate ulPrivateKeyAttributeCount \\\n"
  1.1103 +"    phPublicKey phPrivateKey\n\n"
  1.1104 +"C_GenerateKeyPair generates a public-key/private-key pair creating new key\n"
  1.1105 +"objects.\n"
  1.1106 +" hSession                      sessionhandle\n"
  1.1107 +" pMechanism                    key-genmech.\n"
  1.1108 +" pPublicKeyTemplate            templatefor pub. key\n"
  1.1109 +" ulPublicKeyAttributeCount     # pub. attrs.\n"
  1.1110 +" pPrivateKeyTemplate           templatefor priv. key\n"
  1.1111 +" ulPrivateKeyAttributeCount    # priv. attrs.\n"
  1.1112 +" phPublicKey                   gets pub. keyhandle\n"
  1.1113 +" phPrivateKey                  getspriv. keyhandle\n",
  1.1114 +	{ArgULong, ArgMechanism, ArgAttribute|ArgArray, ArgULong, 
  1.1115 +						ArgAttribute|ArgArray,
  1.1116 +	 ArgULong, ArgULong|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone }},
  1.1117 +    {"C_GenerateKey", F_C_GenerateKey,
  1.1118 +"C_GenerateKey hSession pMechanism pTemplate ulCount phKey\n\n"
  1.1119 +"C_GenerateKey generates a secret key creating a new key object.\n"
  1.1120 +" hSession      the session's handle\n"
  1.1121 +" pMechanism    key generation mech.\n"
  1.1122 +" pTemplate     template for new key\n"
  1.1123 +" ulCount       # of attrs in template\n"
  1.1124 +" phKey         gets handle of new key\n",
  1.1125 +	{ArgULong, ArgMechanism, ArgAttribute|ArgArray, ArgULong, 
  1.1126 +	 					ArgULong|ArgOut,
  1.1127 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1128 +    {"C_WrapKey", F_C_WrapKey,
  1.1129 +"C_WrapKey hSession pMechanism hWrappingKey hKey pWrappedKey pulWrappedKeyLen\n\n"
  1.1130 +"C_WrapKey wraps (i.e. encrypts) a key.\n"
  1.1131 +" hSession          the session's handle\n"
  1.1132 +" pMechanism        the wrapping mechanism\n"
  1.1133 +" hWrappingKey      wrapping key\n"
  1.1134 +" hKey              key to be wrapped\n"
  1.1135 +" pWrappedKey       gets wrapped key\n"
  1.1136 +" pulWrappedKeyLen  gets wrapped key size\n",
  1.1137 +	{ArgULong, ArgMechanism, ArgULong, ArgULong, ArgULong,
  1.1138 +	 ArgChar|ArgOut, ArgULong|ArgOut, ArgNone, ArgNone, ArgNone }},
  1.1139 +    {"C_UnwrapKey", F_C_UnwrapKey,
  1.1140 +"C_UnwrapKey hSession pMechanism hUnwrappingKey pWrappedKey ulWrappedKeyLen \\\n"
  1.1141 +"    pTemplate ulAttributeCount phKey\n\n"
  1.1142 +"C_UnwrapKey unwraps (decrypts) a wrapped key creating a new key object.\n"
  1.1143 +" hSession            session's handle\n"
  1.1144 +" pMechanism          unwrapping mech.\n"
  1.1145 +" hUnwrappingKey      unwrapping key\n"
  1.1146 +" pWrappedKey         the wrapped key\n"
  1.1147 +" ulWrappedKeyLen     wrapped key len\n"
  1.1148 +" pTemplate           new key template\n"
  1.1149 +" ulAttributeCount    template length\n"
  1.1150 +" phKey               gets new handle\n",
  1.1151 +	{ArgULong, ArgMechanism, ArgULong, ArgChar, ArgULong,
  1.1152 +	 ArgAttribute|ArgArray, ArgULong, ArgULong|ArgOut, ArgNone, ArgNone }},
  1.1153 +    {"C_DeriveKey", F_C_DeriveKey,
  1.1154 +"C_DeriveKey hSession pMechanism hBaseKey pTemplate ulAttributeCount phKey\n\n"
  1.1155 +"C_DeriveKey derives a key from a base key creating a new key object.\n"
  1.1156 +" hSession            session's handle\n"
  1.1157 +" pMechanism          key deriv. mech.\n"
  1.1158 +" hBaseKey            base key\n"
  1.1159 +" pTemplate           new key template\n"
  1.1160 +" ulAttributeCount    template length\n"
  1.1161 +" phKey               gets new handle\n",
  1.1162 +	{ArgULong, ArgMechanism, ArgULong, ArgAttribute|ArgArray,  ArgULong,
  1.1163 +	 ArgULong|ArgOut, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1164 +    {"C_SeedRandom", F_C_SeedRandom,
  1.1165 +"C_SeedRandom hSession pSeed ulSeedLen\n\n"
  1.1166 +"C_SeedRandom mixes additional seed material into the token's random number\n"
  1.1167 +"generator.\n"
  1.1168 +" hSession    the session's handle\n"
  1.1169 +" pSeed       the seed material\n"
  1.1170 +" ulSeedLen   length of seed material\n",
  1.1171 +	{ArgULong, ArgChar, ArgULong, ArgNone, ArgNone,
  1.1172 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1173 +    {"C_GenerateRandom", F_C_GenerateRandom,
  1.1174 +"C_GenerateRandom hSession RandomData ulRandomLen\n\n"
  1.1175 +"C_GenerateRandom generates random data.\n"
  1.1176 +" hSession      the session's handle\n"
  1.1177 +" RandomData    receives the random data\n"
  1.1178 +" ulRandomLen   # of bytes to generate\n",
  1.1179 +	{ArgULong, ArgChar, ArgULong, ArgNone, ArgNone,
  1.1180 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1181 +    {"C_GetFunctionStatus", F_C_GetFunctionStatus,
  1.1182 +"C_GetFunctionStatus hSession\n\n"
  1.1183 +"C_GetFunctionStatus is a legacy function; it obtains an updated status of\n"
  1.1184 +"a function running in parallel with an application.\n"
  1.1185 +" hSession   the session's handle\n",
  1.1186 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1187 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1188 +    {"C_CancelFunction", F_C_CancelFunction,
  1.1189 +"C_CancelFunction hSession\n\n"
  1.1190 +"C_CancelFunction is a legacy function; it cancels a function running in\n"
  1.1191 +"parallel.\n"
  1.1192 +" hSession   the session's handle\n",
  1.1193 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1194 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1195 +    {"C_WaitForSlotEvent", F_C_WaitForSlotEvent,
  1.1196 +"C_WaitForSlotEvent flags pSlot pRserved\n\n"
  1.1197 +"C_WaitForSlotEvent waits for a slot event (token insertion removal etc.)\n"
  1.1198 +"to occur.\n"
  1.1199 +" flags          blocking/nonblocking flag\n"
  1.1200 +" pSlot    location that receives the slot ID\n"
  1.1201 +" pRserved    reserved.  Should be NULL_PTR\n",
  1.1202 +	{ArgULong, ArgULong|ArgArray, ArgVar, ArgNone, ArgNone,
  1.1203 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1204 +    {"NewArray", F_NewArray,
  1.1205 +"NewArray varName varType array size\n\n"
  1.1206 +"Creates a new array variable.\n"
  1.1207 +" varName     variable name of the new array\n"
  1.1208 +" varType     data type of the new array\n"
  1.1209 +" size        number of elements in the array\n",
  1.1210 +	{ArgVar|ArgNew, ArgVar, ArgULong, ArgNone, ArgNone, 
  1.1211 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1212 +    {"NewInitArg", F_NewInitializeArgs,
  1.1213 +"NewInitArg varName flags string\n\n"
  1.1214 +"Creates a new init variable.\n"
  1.1215 +" varName     variable name of the new initArg\n"
  1.1216 +" flags       value to set the flags field\n"
  1.1217 +" string      string parameter for init arg\n",
  1.1218 +	{ArgVar|ArgNew, ArgULong, ArgVar|ArgNew, ArgNone, ArgNone, 
  1.1219 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1220 +    {"NewTemplate", F_NewTemplate,
  1.1221 +"NewTemplate varName attributeList\n\n"
  1.1222 +"Create a new empty template and populate the attribute list\n"
  1.1223 +" varName        variable name of the new template\n"
  1.1224 +" attributeList  comma separated list of CKA_ATTRIBUTE types\n",
  1.1225 +	{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone, 
  1.1226 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1227 +    {"NewMechanism", F_NewMechanism,
  1.1228 +"NewMechanism varName mechanismType\n\n"
  1.1229 +"Create a new CK_MECHANISM object with type NULL parameters and specified type\n"
  1.1230 +" varName        variable name of the new mechansim\n"
  1.1231 +" mechanismType  CKM_ mechanism type value to set int the type field\n",
  1.1232 +	{ArgVar|ArgNew, ArgULong, ArgNone, ArgNone, ArgNone, 
  1.1233 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1234 +    {"BuildTemplate", F_BuildTemplate,
  1.1235 +"BuildTemplate template\n\n"
  1.1236 +"Allocates space for the value in a template which has the sizes filled in,\n"
  1.1237 +"but no values allocated yet.\n"
  1.1238 +" template        variable name of the template\n",
  1.1239 +	{ArgAttribute, ArgNone, ArgNone, ArgNone, ArgNone, 
  1.1240 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1241 +    {"SetTemplate", F_SetTemplate,
  1.1242 +"SetTemplate template index value\n\n"
  1.1243 +"Sets a particular element of a template to a CK_ULONG\n"
  1.1244 +" template        variable name of the template\n"
  1.1245 +" index           index into the template to the element to change\n"
  1.1246 +" value           32 bit value to set in the template\n",
  1.1247 +	{ArgAttribute, ArgULong, ArgULong, ArgNone, ArgNone, 
  1.1248 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1249 +    {"SetString", F_SetStringVar,
  1.1250 +"SetString varName string\n\n"
  1.1251 +"Sets a particular variable to a string value\n"
  1.1252 +" variable        variable name of new string\n"
  1.1253 +" string	         String to set the variable to\n",
  1.1254 +	{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone, 
  1.1255 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1256 +    {"Set", F_SetVar,
  1.1257 +"Set varName value\n\n"
  1.1258 +"Sets a particular variable to CK_ULONG\n"
  1.1259 +" variable        name of the new variable\n"
  1.1260 +" value           32 bit value to set variable to\n",
  1.1261 +	{ArgVar|ArgNew, ArgULong, ArgNone, ArgNone, ArgNone, 
  1.1262 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1263 +    {"Print", F_Print,
  1.1264 +"Print varName\n\n"
  1.1265 +"prints a variable\n"
  1.1266 +" variable        name of the variable to print\n",
  1.1267 +	{ArgVar, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1268 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1269 +    {"Delete", F_Delete,
  1.1270 +"Delete varName\n\n"
  1.1271 +"delete a variable\n"
  1.1272 +" variable        name of the variable to delete\n",
  1.1273 +	{ArgVar|ArgNew, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1274 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1275 +    {"Load", F_Load,
  1.1276 +"load libraryName\n\n"
  1.1277 +"load a pkcs #11 module\n"
  1.1278 +" libraryName        Name of a shared library\n",
  1.1279 +	{ArgVar, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1280 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1281 +    {"Save", F_SaveVar,
  1.1282 +"Save filename variable\n\n"
  1.1283 +"Saves the binary value of 'variable' in file 'filename'\n"
  1.1284 +" fileName        target file to save the variable in\n"
  1.1285 +" variable        variable to save\n",
  1.1286 +	{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone,
  1.1287 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1288 +    {"Restore", F_RestoreVar,
  1.1289 +"Restore filename variable\n\n"
  1.1290 +"Restores a variable from a file\n"
  1.1291 +" fileName        target file to restore the variable from\n"
  1.1292 +" variable        variable to restore\n",
  1.1293 +	{ArgVar|ArgNew, ArgVar, ArgNone, ArgNone, ArgNone,
  1.1294 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1295 +    {"Increment", F_Increment,
  1.1296 +"Increment variable value\n\n"
  1.1297 +"Increment a variable by value\n",
  1.1298 +	{ArgVar, ArgULong, ArgNone, ArgNone, ArgNone,
  1.1299 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1300 +    {"Decrement", F_Decrement,
  1.1301 +"Decrement variable value\n\n"
  1.1302 +"Decrement a variable by value\n",
  1.1303 +	{ArgVar, ArgULong, ArgNone, ArgNone, ArgNone,
  1.1304 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1305 +    {"List", F_List,
  1.1306 +"List all the variables\n",
  1.1307 +	{ArgNone, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1308 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1309 +    {"Unload", F_Unload,
  1.1310 +"Unload the currrently loaded PKCS #11 library\n",
  1.1311 +	{ArgNone, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1312 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1313 +    {"Run", F_Run,
  1.1314 +"Run filename\n\n"
  1.1315 +"reads filename as script of commands to execute\n",
  1.1316 +	{ArgVar|ArgNew, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1317 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1318 +    {"Time", F_Time,
  1.1319 +"Time pkcs11 command\n\n"
  1.1320 +"Execute a pkcs #11 command and time the results\n",
  1.1321 +	{ArgVar|ArgFull, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1322 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1323 +    {"System", F_System,
  1.1324 +	"Set System Flag",
  1.1325 +	{ArgULong, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1326 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1327 +    {"LoopRun", F_Loop,
  1.1328 +"LoopRun filename var start end step\n\n"
  1.1329 +"Run in a loop. Loop exit if scrip does and explicit quit (Quit QuitIf etc.)",
  1.1330 +	{ArgVar|ArgNew, ArgVar|ArgNew, ArgULong, ArgULong, ArgULong,
  1.1331 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1332 +    {"Help", F_Help,
  1.1333 +"Help [command]\n\n"
  1.1334 +"print general help, or help for a specific command\n",
  1.1335 +	{ArgVar|ArgOpt, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1336 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1337 +    {"QuitIf", F_QuitIf,
  1.1338 +"QuitIf arg1 comparator arg2\n\n"
  1.1339 +"Exit from this program if Condition is valid, valid comparators:\n"
  1.1340 +"  < > <= >= = !=\n",
  1.1341 +	{ArgULong, ArgVar|ArgNew, ArgULong, ArgNone, ArgNone,
  1.1342 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1343 +    {"QuitIfString", F_QuitIfString,
  1.1344 +"QuitIfString arg1 comparator arg2\n\n"
  1.1345 +"Exit from this program if Condition is valid, valid comparators:\n"
  1.1346 +"  = !=\n",
  1.1347 +	{ArgVar|ArgNew, ArgVar|ArgNew, ArgVar|ArgNew, ArgNone, ArgNone,
  1.1348 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1349 +    {"Quit", F_Quit,
  1.1350 +"Exit from this program",
  1.1351 +	{ArgNone, ArgNone, ArgNone, ArgNone, ArgNone,
  1.1352 +	 ArgNone, ArgNone, ArgNone, ArgNone, ArgNone }},
  1.1353 +};
  1.1354 +
  1.1355 +const Commands  *commands= &_commands[0];
  1.1356 +const int commandCount = sizeof(_commands) / sizeof(_commands[0]);
  1.1357 +
  1.1358 +const Topics _topics[] = {
  1.1359 +   { "variables", 
  1.1360 +"Variables are random strings of characters. These should begin with alpha\n"
  1.1361 +" characters, and should not contain any spaces, nor should they match any\n"
  1.1362 +" built-in constants. There is some checking in the code for these things,\n"
  1.1363 +" but it's not 100% and using invalid variable names can cause problems.\n"
  1.1364 +" Variables are created by any 'OUT' parameter. If the variable does not\n"
  1.1365 +" exist, it will be created. For in parameters variables must already exist.\n"
  1.1366 +   },
  1.1367 +   { "constants",
  1.1368 +"pk11util recognizes *lots* of constants. All CKA_, CKF_, CKO_, CKU_, CKS_,\n"
  1.1369 +" CKC_, CKK_, CKH_, CKM_, CKT_ values from the PKCS #11 spec are recognized.\n"
  1.1370 +" Constants can be specified with their fully qualified CK?_ value, or the\n"
  1.1371 +" prefix can be dropped. Constants are matched case insensitve.\n" 
  1.1372 +   },
  1.1373 +   { "arrays",
  1.1374 +"Arrays are special variables which represent 'C' arrays. Each array \n"
  1.1375 +" variable can be referenced as a group (using just the name), or as \n"
  1.1376 +" individual elements (with the [int] operator). Example:\n"
  1.1377 +"      print myArray    # prints the full array.\n"
  1.1378 +"      print myArray[3] # prints the 3rd elemement of the array \n"
  1.1379 +   },
  1.1380 +   { "sizes",
  1.1381 +"Size operaters returns the size in bytes of a variable, or the number of\n"
  1.1382 +" elements in an array.\n"
  1.1383 +"    size(var) and sizeof(var) return the size of var in bytes.\n"
  1.1384 +"    sizea(var) and sizeofarray(var) return the number of elements in var.\n"
  1.1385 +"       If var is not an array, sizea(var) returns 1.\n"
  1.1386 +   },
  1.1387 +};
  1.1388 +
  1.1389 +const Topics  *topics= &_topics[0];
  1.1390 +const int topicCount = sizeof(_topics) / sizeof(_topics[0]);
  1.1391 +
  1.1392 +const char *
  1.1393 +getName(CK_ULONG value, ConstType type)
  1.1394 +{
  1.1395 +    int i;
  1.1396 +    
  1.1397 +    for (i=0; i < constCount; i++) {
  1.1398 +        if (consts[i].type == type && consts[i].value == value) {
  1.1399 +            return consts[i].name;
  1.1400 +        }
  1.1401 +        if (type == ConstNone && consts[i].value == value) {
  1.1402 +            return consts[i].name;
  1.1403 +        }
  1.1404 +    }
  1.1405 +
  1.1406 +    return NULL;
  1.1407 +}
  1.1408 +
  1.1409 +const char *
  1.1410 +getNameFromAttribute(CK_ATTRIBUTE_TYPE type)
  1.1411 +{
  1.1412 +    return getName(type, ConstAttribute);
  1.1413 +}
  1.1414 +
  1.1415 +int totalKnownType(ConstType type) {
  1.1416 +    int count = 0;
  1.1417 +    int i;
  1.1418 + 
  1.1419 +    for (i=0; i < constCount; i++) {
  1.1420 +        if (consts[i].type == type) count++;
  1.1421 +    }
  1.1422 +    return count;
  1.1423 +}

mercurial