security/nss/cmd/lib/pk11table.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial