Back to index

lightning-sunbird  0.9+nobinonly
pkcs11t.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * RSA Security, Inc.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 /* License to copy and use this software is granted provided that it is
00038  * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
00039  * (Cryptoki)" in all material mentioning or referencing this software.
00040 
00041  * License is also granted to make and use derivative works provided that
00042  * such works are identified as "derived from the RSA Security Inc. PKCS #11
00043  * Cryptographic Token Interface (Cryptoki)" in all material mentioning or
00044  * referencing the derived work.
00045 
00046  * RSA Security Inc. makes no representations concerning either the
00047  * merchantability of this software or the suitability of this software for
00048  * any particular purpose. It is provided "as is" without express or implied
00049  * warranty of any kind.
00050  */
00051 
00052 
00053 #ifndef _PKCS11T_H_
00054 #define _PKCS11T_H_ 1
00055 
00056 #define CK_TRUE 1
00057 #define CK_FALSE 0
00058 
00059 #include "prtypes.h"
00060 
00061 #define CK_PTR *
00062 #define CK_NULL_PTR 0
00063 #define CK_CALLBACK_FUNCTION(rv,func) rv (PR_CALLBACK * func)
00064 #define CK_DECLARE_FUNCTION(rv,func) PR_EXTERN(rv) func
00065 #define CK_DECLARE_FUNCTION_POINTER(rv,func) rv (PR_CALLBACK * func)
00066 
00067 #define CK_INVALID_SESSION    0
00068 
00069 /* an unsigned 8-bit value */
00070 typedef unsigned char     CK_BYTE;
00071 
00072 /* an unsigned 8-bit character */
00073 typedef CK_BYTE           CK_CHAR;
00074 
00075 /* an 8-bit UTF-8 character */
00076 typedef CK_BYTE           CK_UTF8CHAR;
00077 
00078 /* a BYTE-sized Boolean flag */
00079 typedef CK_BYTE           CK_BBOOL;
00080 
00081 /* an unsigned value, at least 32 bits long */
00082 typedef unsigned long int CK_ULONG;
00083 
00084 /* a signed value, the same size as a CK_ULONG */
00085 /* CK_LONG is new for v2.0 */
00086 typedef long int          CK_LONG;
00087 
00088 /* at least 32 bits; each bit is a Boolean flag */
00089 typedef CK_ULONG          CK_FLAGS;
00090 
00091 
00092 /* some special values for certain CK_ULONG variables */
00093 #define CK_UNAVAILABLE_INFORMATION (~0UL)
00094 #define CK_EFFECTIVELY_INFINITE    0
00095 
00096 
00097 typedef CK_BYTE     CK_PTR   CK_BYTE_PTR;
00098 typedef CK_CHAR     CK_PTR   CK_CHAR_PTR;
00099 typedef CK_UTF8CHAR CK_PTR   CK_UTF8CHAR_PTR;
00100 typedef CK_ULONG    CK_PTR   CK_ULONG_PTR;
00101 typedef void        CK_PTR   CK_VOID_PTR;
00102 
00103 /* Pointer to a CK_VOID_PTR-- i.e., pointer to pointer to void */
00104 typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR;
00105 
00106 
00107 /* The following value is always invalid if used as a session */
00108 /* handle or object handle */
00109 #define CK_INVALID_HANDLE 0
00110 
00111 
00112 /* pack */
00113 #include "pkcs11p.h"
00114 
00115 typedef struct CK_VERSION {
00116   CK_BYTE       major;  /* integer portion of version number */
00117   CK_BYTE       minor;  /* 1/100ths portion of version number */
00118 } CK_VERSION;
00119 
00120 typedef CK_VERSION CK_PTR CK_VERSION_PTR;
00121 
00122 
00123 typedef struct CK_INFO {
00124   /* manufacturerID and libraryDecription have been changed from
00125    * CK_CHAR to CK_UTF8CHAR for v2.10 */
00126   CK_VERSION    cryptokiVersion;     /* PKCS #11 interface ver */
00127   CK_UTF8CHAR   manufacturerID[32];  /* blank padded */
00128   CK_FLAGS      flags;               /* must be zero */
00129 
00130   /* libraryDescription and libraryVersion are new for v2.0 */
00131   CK_UTF8CHAR   libraryDescription[32];  /* blank padded */
00132   CK_VERSION    libraryVersion;          /* version of library */
00133 } CK_INFO;
00134 
00135 typedef CK_INFO CK_PTR    CK_INFO_PTR;
00136 
00137 
00138 /* CK_NOTIFICATION enumerates the types of notifications that
00139  * PKCS #11 provides to an application */
00140 /* CK_NOTIFICATION has been changed from an enum to a CK_ULONG
00141  * for v2.0 */
00142 typedef CK_ULONG CK_NOTIFICATION;
00143 #define CKN_SURRENDER       0
00144 
00145 
00146 typedef CK_ULONG          CK_SLOT_ID;
00147 
00148 typedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR;
00149 
00150 
00151 /* CK_SLOT_INFO provides information about a slot */
00152 typedef struct CK_SLOT_INFO {
00153   /* slotDescription and manufacturerID have been changed from
00154    * CK_CHAR to CK_UTF8CHAR for v2.10 */
00155   CK_UTF8CHAR   slotDescription[64];  /* blank padded */
00156   CK_UTF8CHAR   manufacturerID[32];   /* blank padded */
00157   CK_FLAGS      flags;
00158 
00159   /* hardwareVersion and firmwareVersion are new for v2.0 */
00160   CK_VERSION    hardwareVersion;  /* version of hardware */
00161   CK_VERSION    firmwareVersion;  /* version of firmware */
00162 } CK_SLOT_INFO;
00163 
00164 /* flags: bit flags that provide capabilities of the slot
00165  *      Bit Flag              Mask        Meaning
00166  */
00167 #define CKF_TOKEN_PRESENT     0x00000001  /* a token is there */
00168 #define CKF_REMOVABLE_DEVICE  0x00000002  /* removable devices*/
00169 #define CKF_HW_SLOT           0x00000004  /* hardware slot */
00170 
00171 typedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR;
00172 
00173 
00174 /* CK_TOKEN_INFO provides information about a token */
00175 typedef struct CK_TOKEN_INFO {
00176   /* label, manufacturerID, and model have been changed from
00177    * CK_CHAR to CK_UTF8CHAR for v2.10 */
00178   CK_UTF8CHAR   label[32];           /* blank padded */
00179   CK_UTF8CHAR   manufacturerID[32];  /* blank padded */
00180   CK_UTF8CHAR   model[16];           /* blank padded */
00181   CK_CHAR       serialNumber[16];    /* blank padded */
00182   CK_FLAGS      flags;               /* see below */
00183 
00184   /* ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount,
00185    * ulRwSessionCount, ulMaxPinLen, and ulMinPinLen have all been
00186    * changed from CK_USHORT to CK_ULONG for v2.0 */
00187   CK_ULONG      ulMaxSessionCount;     /* max open sessions */
00188   CK_ULONG      ulSessionCount;        /* sess. now open */
00189   CK_ULONG      ulMaxRwSessionCount;   /* max R/W sessions */
00190   CK_ULONG      ulRwSessionCount;      /* R/W sess. now open */
00191   CK_ULONG      ulMaxPinLen;           /* in bytes */
00192   CK_ULONG      ulMinPinLen;           /* in bytes */
00193   CK_ULONG      ulTotalPublicMemory;   /* in bytes */
00194   CK_ULONG      ulFreePublicMemory;    /* in bytes */
00195   CK_ULONG      ulTotalPrivateMemory;  /* in bytes */
00196   CK_ULONG      ulFreePrivateMemory;   /* in bytes */
00197 
00198   /* hardwareVersion, firmwareVersion, and time are new for
00199    * v2.0 */
00200   CK_VERSION    hardwareVersion;       /* version of hardware */
00201   CK_VERSION    firmwareVersion;       /* version of firmware */
00202   CK_CHAR       utcTime[16];           /* time */
00203 } CK_TOKEN_INFO;
00204 
00205 /* The flags parameter is defined as follows:
00206  *      Bit Flag                    Mask        Meaning
00207  */
00208 #define CKF_RNG                     0x00000001  /* has random #
00209                                                  * generator */
00210 #define CKF_WRITE_PROTECTED         0x00000002  /* token is
00211                                                  * write-
00212                                                  * protected */
00213 #define CKF_LOGIN_REQUIRED          0x00000004  /* user must
00214                                                  * login */
00215 #define CKF_USER_PIN_INITIALIZED    0x00000008  /* normal user's
00216                                                  * PIN is set */
00217 
00218 /* CKF_RESTORE_KEY_NOT_NEEDED is new for v2.0.  If it is set,
00219  * that means that *every* time the state of cryptographic
00220  * operations of a session is successfully saved, all keys
00221  * needed to continue those operations are stored in the state */
00222 #define CKF_RESTORE_KEY_NOT_NEEDED  0x00000020
00223 
00224 /* CKF_CLOCK_ON_TOKEN is new for v2.0.  If it is set, that means
00225  * that the token has some sort of clock.  The time on that
00226  * clock is returned in the token info structure */
00227 #define CKF_CLOCK_ON_TOKEN          0x00000040
00228 
00229 /* CKF_PROTECTED_AUTHENTICATION_PATH is new for v2.0.  If it is
00230  * set, that means that there is some way for the user to login
00231  * without sending a PIN through the PKCS #11 library itself */
00232 #define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100
00233 
00234 /* CKF_DUAL_CRYPTO_OPERATIONS is new for v2.0.  If it is true,
00235  * that means that a single session with the token can perform
00236  * dual simultaneous cryptographic operations (digest and
00237  * encrypt; decrypt and digest; sign and encrypt; and decrypt
00238  * and sign) */
00239 #define CKF_DUAL_CRYPTO_OPERATIONS  0x00000200
00240 
00241 /* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the
00242  * token has been initialized using C_InitializeToken or an
00243  * equivalent mechanism outside the scope of PKCS #11.
00244  * Calling C_InitializeToken when this flag is set will cause
00245  * the token to be reinitialized. */
00246 #define CKF_TOKEN_INITIALIZED       0x00000400
00247 
00248 /* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is
00249  * true, the token supports secondary authentication for
00250  * private key objects. This flag is deprecated in v2.11 and
00251    onwards. */
00252 #define CKF_SECONDARY_AUTHENTICATION  0x00000800
00253 
00254 /* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an
00255  * incorrect user login PIN has been entered at least once
00256  * since the last successful authentication. */
00257 #define CKF_USER_PIN_COUNT_LOW       0x00010000
00258 
00259 /* CKF_USER_PIN_FINAL_TRY if new for v2.10. If it is true,
00260  * supplying an incorrect user PIN will it to become locked. */
00261 #define CKF_USER_PIN_FINAL_TRY       0x00020000
00262 
00263 /* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the
00264  * user PIN has been locked. User login to the token is not
00265  * possible. */
00266 #define CKF_USER_PIN_LOCKED          0x00040000
00267 
00268 /* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true,
00269  * the user PIN value is the default value set by token
00270  * initialization or manufacturing, or the PIN has been
00271  * expired by the card. */
00272 #define CKF_USER_PIN_TO_BE_CHANGED   0x00080000
00273 
00274 /* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an
00275  * incorrect SO login PIN has been entered at least once since
00276  * the last successful authentication. */
00277 #define CKF_SO_PIN_COUNT_LOW         0x00100000
00278 
00279 /* CKF_SO_PIN_FINAL_TRY if new for v2.10. If it is true,
00280  * supplying an incorrect SO PIN will it to become locked. */
00281 #define CKF_SO_PIN_FINAL_TRY         0x00200000
00282 
00283 /* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO
00284  * PIN has been locked. SO login to the token is not possible.
00285  */
00286 #define CKF_SO_PIN_LOCKED            0x00400000
00287 
00288 /* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true,
00289  * the SO PIN value is the default value set by token
00290  * initialization or manufacturing, or the PIN has been
00291  * expired by the card. */
00292 #define CKF_SO_PIN_TO_BE_CHANGED     0x00800000
00293 
00294 typedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR;
00295 
00296 
00297 /* CK_SESSION_HANDLE is a PKCS #11-assigned value that
00298  * identifies a session */
00299 typedef CK_ULONG          CK_SESSION_HANDLE;
00300 
00301 typedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR;
00302 
00303 
00304 /* CK_USER_TYPE enumerates the types of PKCS #11 users */
00305 /* CK_USER_TYPE has been changed from an enum to a CK_ULONG for
00306  * v2.0 */
00307 typedef CK_ULONG          CK_USER_TYPE;
00308 /* Security Officer */
00309 #define CKU_SO    0
00310 /* Normal user */
00311 #define CKU_USER  1
00312 /* Context specific (added in v2.20) */
00313 #define CKU_CONTEXT_SPECIFIC   2
00314 
00315 /* CK_STATE enumerates the session states */
00316 /* CK_STATE has been changed from an enum to a CK_ULONG for
00317  * v2.0 */
00318 typedef CK_ULONG          CK_STATE;
00319 #define CKS_RO_PUBLIC_SESSION  0
00320 #define CKS_RO_USER_FUNCTIONS  1
00321 #define CKS_RW_PUBLIC_SESSION  2
00322 #define CKS_RW_USER_FUNCTIONS  3
00323 #define CKS_RW_SO_FUNCTIONS    4
00324 
00325 
00326 /* CK_SESSION_INFO provides information about a session */
00327 typedef struct CK_SESSION_INFO {
00328   CK_SLOT_ID    slotID;
00329   CK_STATE      state;
00330   CK_FLAGS      flags;          /* see below */
00331 
00332   /* ulDeviceError was changed from CK_USHORT to CK_ULONG for
00333    * v2.0 */
00334   CK_ULONG      ulDeviceError;  /* device-dependent error code */
00335 } CK_SESSION_INFO;
00336 
00337 /* The flags are defined in the following table:
00338  *      Bit Flag                Mask        Meaning
00339  */
00340 #define CKF_RW_SESSION          0x00000002  /* session is r/w */
00341 #define CKF_SERIAL_SESSION      0x00000004  /* no parallel */
00342 
00343 typedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR;
00344 
00345 
00346 /* CK_OBJECT_HANDLE is a token-specific identifier for an
00347  * object  */
00348 typedef CK_ULONG          CK_OBJECT_HANDLE;
00349 
00350 typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR;
00351 
00352 
00353 /* CK_OBJECT_CLASS is a value that identifies the classes (or
00354  * types) of objects that PKCS #11 recognizes.  It is defined
00355  * as follows: */
00356 /* CK_OBJECT_CLASS was changed from CK_USHORT to CK_ULONG for
00357  * v2.0 */
00358 typedef CK_ULONG          CK_OBJECT_CLASS;
00359 
00360 /* The following classes of objects are defined: */
00361 /* CKO_HW_FEATURE is new for v2.10 */
00362 /* CKO_DOMAIN_PARAMETERS is new for v2.11 */
00363 /* CKO_MECHANISM is new for v2.20 */
00364 #define CKO_DATA              0x00000000
00365 #define CKO_CERTIFICATE       0x00000001
00366 #define CKO_PUBLIC_KEY        0x00000002
00367 #define CKO_PRIVATE_KEY       0x00000003
00368 #define CKO_SECRET_KEY        0x00000004
00369 #define CKO_HW_FEATURE        0x00000005
00370 #define CKO_DOMAIN_PARAMETERS 0x00000006
00371 #define CKO_MECHANISM         0x00000007
00372 #define CKO_VENDOR_DEFINED    0x80000000
00373 
00374 typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR;
00375 
00376 /* CK_HW_FEATURE_TYPE is new for v2.10. CK_HW_FEATURE_TYPE is a
00377  * value that identifies the hardware feature type of an object
00378  * with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. */
00379 typedef CK_ULONG          CK_HW_FEATURE_TYPE;
00380 
00381 /* The following hardware feature types are defined */
00382 /* CKH_USER_INTERFACE is new for v2.20 */
00383 #define CKH_MONOTONIC_COUNTER  0x00000001
00384 #define CKH_CLOCK           0x00000002
00385 #define CKH_USER_INTERFACE  0x00000003
00386 #define CKH_VENDOR_DEFINED  0x80000000
00387 
00388 /* CK_KEY_TYPE is a value that identifies a key type */
00389 /* CK_KEY_TYPE was changed from CK_USHORT to CK_ULONG for v2.0 */
00390 typedef CK_ULONG          CK_KEY_TYPE;
00391 
00392 /* the following key types are defined: */
00393 #define CKK_RSA             0x00000000
00394 #define CKK_DSA             0x00000001
00395 #define CKK_DH              0x00000002
00396 
00397 /* CKK_ECDSA and CKK_KEA are new for v2.0 */
00398 /* CKK_ECDSA is deprecated in v2.11, CKK_EC is preferred. */
00399 #define CKK_ECDSA           0x00000003
00400 #define CKK_EC              0x00000003
00401 #define CKK_X9_42_DH        0x00000004
00402 #define CKK_KEA             0x00000005
00403 
00404 #define CKK_GENERIC_SECRET  0x00000010
00405 #define CKK_RC2             0x00000011
00406 #define CKK_RC4             0x00000012
00407 #define CKK_DES             0x00000013
00408 #define CKK_DES2            0x00000014
00409 #define CKK_DES3            0x00000015
00410 
00411 /* all these key types are new for v2.0 */
00412 #define CKK_CAST            0x00000016
00413 #define CKK_CAST3           0x00000017
00414 /* CKK_CAST5 is deprecated in v2.11, CKK_CAST128 is preferred. */
00415 #define CKK_CAST5           0x00000018
00416 #define CKK_CAST128         0x00000018
00417 #define CKK_RC5             0x00000019
00418 #define CKK_IDEA            0x0000001A
00419 #define CKK_SKIPJACK        0x0000001B
00420 #define CKK_BATON           0x0000001C
00421 #define CKK_JUNIPER         0x0000001D
00422 #define CKK_CDMF            0x0000001E
00423 #define CKK_AES             0x0000001F
00424 
00425 /* BlowFish and TwoFish are new for v2.20 */
00426 #define CKK_BLOWFISH        0x00000020
00427 #define CKK_TWOFISH         0x00000021
00428 
00429 #define CKK_VENDOR_DEFINED  0x80000000
00430 
00431 
00432 /* CK_CERTIFICATE_TYPE is a value that identifies a certificate
00433  * type */
00434 /* CK_CERTIFICATE_TYPE was changed from CK_USHORT to CK_ULONG
00435  * for v2.0 */
00436 typedef CK_ULONG          CK_CERTIFICATE_TYPE;
00437 
00438 /* The following certificate types are defined: */
00439 /* CKC_X_509_ATTR_CERT is new for v2.10 */
00440 /* CKC_WTLS is new for v2.20 */
00441 #define CKC_X_509           0x00000000
00442 #define CKC_X_509_ATTR_CERT 0x00000001
00443 #define CKC_WTLS            0x00000002
00444 #define CKC_VENDOR_DEFINED  0x80000000
00445 
00446 
00447 /* CK_ATTRIBUTE_TYPE is a value that identifies an attribute
00448  * type */
00449 /* CK_ATTRIBUTE_TYPE was changed from CK_USHORT to CK_ULONG for
00450  * v2.0 */
00451 typedef CK_ULONG          CK_ATTRIBUTE_TYPE;
00452 
00453 /* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which
00454    consists of an array of values. */
00455 #define CKF_ARRAY_ATTRIBUTE    0x40000000
00456 
00457 /* The following attribute types are defined: */
00458 #define CKA_CLASS              0x00000000
00459 #define CKA_TOKEN              0x00000001
00460 #define CKA_PRIVATE            0x00000002
00461 #define CKA_LABEL              0x00000003
00462 #define CKA_APPLICATION        0x00000010
00463 #define CKA_VALUE              0x00000011
00464 
00465 /* CKA_OBJECT_ID is new for v2.10 */
00466 #define CKA_OBJECT_ID          0x00000012
00467 
00468 #define CKA_CERTIFICATE_TYPE   0x00000080
00469 #define CKA_ISSUER             0x00000081
00470 #define CKA_SERIAL_NUMBER      0x00000082
00471 
00472 /* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new
00473  * for v2.10 */
00474 #define CKA_AC_ISSUER          0x00000083
00475 #define CKA_OWNER              0x00000084
00476 #define CKA_ATTR_TYPES         0x00000085
00477 
00478 /* CKA_TRUSTED is new for v2.11 */
00479 #define CKA_TRUSTED            0x00000086
00480 
00481 /* CKA_CERTIFICATE_CATEGORY ...
00482  * CKA_CHECK_VALUE are new for v2.20 */
00483 #define CKA_CERTIFICATE_CATEGORY        0x00000087
00484 #define CKA_JAVA_MIDP_SECURITY_DOMAIN   0x00000088
00485 #define CKA_URL                         0x00000089
00486 #define CKA_HASH_OF_SUBJECT_PUBLIC_KEY  0x0000008A
00487 #define CKA_HASH_OF_ISSUER_PUBLIC_KEY   0x0000008B
00488 #define CKA_CHECK_VALUE                 0x00000090
00489 
00490 #define CKA_KEY_TYPE           0x00000100
00491 #define CKA_SUBJECT            0x00000101
00492 #define CKA_ID                 0x00000102
00493 #define CKA_SENSITIVE          0x00000103
00494 #define CKA_ENCRYPT            0x00000104
00495 #define CKA_DECRYPT            0x00000105
00496 #define CKA_WRAP               0x00000106
00497 #define CKA_UNWRAP             0x00000107
00498 #define CKA_SIGN               0x00000108
00499 #define CKA_SIGN_RECOVER       0x00000109
00500 #define CKA_VERIFY             0x0000010A
00501 #define CKA_VERIFY_RECOVER     0x0000010B
00502 #define CKA_DERIVE             0x0000010C
00503 #define CKA_START_DATE         0x00000110
00504 #define CKA_END_DATE           0x00000111
00505 #define CKA_MODULUS            0x00000120
00506 #define CKA_MODULUS_BITS       0x00000121
00507 #define CKA_PUBLIC_EXPONENT    0x00000122
00508 #define CKA_PRIVATE_EXPONENT   0x00000123
00509 #define CKA_PRIME_1            0x00000124
00510 #define CKA_PRIME_2            0x00000125
00511 #define CKA_EXPONENT_1         0x00000126
00512 #define CKA_EXPONENT_2         0x00000127
00513 #define CKA_COEFFICIENT        0x00000128
00514 #define CKA_PRIME              0x00000130
00515 #define CKA_SUBPRIME           0x00000131
00516 #define CKA_BASE               0x00000132
00517 
00518 /* CKA_PRIME_BITS and CKA_SUB_PRIME_BITS are new for v2.11 */
00519 #define CKA_PRIME_BITS         0x00000133
00520 #define CKA_SUBPRIME_BITS      0x00000134
00521 #define CKA_SUB_PRIME_BITS     CKA_SUBPRIME_BITS
00522 /* (To retain backwards-compatibility) */
00523 
00524 #define CKA_VALUE_BITS         0x00000160
00525 #define CKA_VALUE_LEN          0x00000161
00526 
00527 /* CKA_EXTRACTABLE, CKA_LOCAL, CKA_NEVER_EXTRACTABLE,
00528  * CKA_ALWAYS_SENSITIVE, CKA_MODIFIABLE, CKA_ECDSA_PARAMS,
00529  * and CKA_EC_POINT are new for v2.0 */
00530 #define CKA_EXTRACTABLE        0x00000162
00531 #define CKA_LOCAL              0x00000163
00532 #define CKA_NEVER_EXTRACTABLE  0x00000164
00533 #define CKA_ALWAYS_SENSITIVE   0x00000165
00534 
00535 /* CKA_KEY_GEN_MECHANISM is new for v2.11 */
00536 #define CKA_KEY_GEN_MECHANISM  0x00000166
00537 
00538 #define CKA_MODIFIABLE         0x00000170
00539 
00540 /* CKA_ECDSA_PARAMS is deprecated in v2.11,
00541  * CKA_EC_PARAMS is preferred. */
00542 #define CKA_ECDSA_PARAMS       0x00000180
00543 #define CKA_EC_PARAMS          0x00000180
00544 
00545 #define CKA_EC_POINT           0x00000181
00546 
00547 /* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS,
00548  * are new for v2.10. Deprecated in v2.11 and onwards. */
00549 #define CKA_SECONDARY_AUTH     0x00000200
00550 #define CKA_AUTH_PIN_FLAGS     0x00000201
00551 
00552 /* CKA_ALWAYS_AUTHENTICATE ...
00553  * CKA_UNWRAP_TEMPLATE are new for v2.20 */
00554 #define CKA_ALWAYS_AUTHENTICATE  0x00000202
00555 
00556 #define CKA_WRAP_WITH_TRUSTED    0x00000210
00557 #define CKA_WRAP_TEMPLATE        (CKF_ARRAY_ATTRIBUTE|0x00000211)
00558 #define CKA_UNWRAP_TEMPLATE      (CKF_ARRAY_ATTRIBUTE|0x00000212)
00559 
00560 /* CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET
00561  * are new for v2.10 */
00562 #define CKA_HW_FEATURE_TYPE    0x00000300
00563 #define CKA_RESET_ON_INIT      0x00000301
00564 #define CKA_HAS_RESET          0x00000302
00565 
00566 /* The following attributes are new for v2.20 */
00567 #define CKA_PIXEL_X                     0x00000400
00568 #define CKA_PIXEL_Y                     0x00000401
00569 #define CKA_RESOLUTION                  0x00000402
00570 #define CKA_CHAR_ROWS                   0x00000403
00571 #define CKA_CHAR_COLUMNS                0x00000404
00572 #define CKA_COLOR                       0x00000405
00573 #define CKA_BITS_PER_PIXEL              0x00000406
00574 #define CKA_CHAR_SETS                   0x00000480
00575 #define CKA_ENCODING_METHODS            0x00000481
00576 #define CKA_MIME_TYPES                  0x00000482
00577 #define CKA_MECHANISM_TYPE              0x00000500
00578 #define CKA_REQUIRED_CMS_ATTRIBUTES     0x00000501
00579 #define CKA_DEFAULT_CMS_ATTRIBUTES      0x00000502
00580 #define CKA_SUPPORTED_CMS_ATTRIBUTES    0x00000503
00581 #define CKA_ALLOWED_MECHANISMS          (CKF_ARRAY_ATTRIBUTE|0x00000600)
00582 
00583 #define CKA_VENDOR_DEFINED     0x80000000
00584 
00585 
00586 /* CK_ATTRIBUTE is a structure that includes the type, length
00587  * and value of an attribute */
00588 typedef struct CK_ATTRIBUTE {
00589   CK_ATTRIBUTE_TYPE type;
00590   CK_VOID_PTR       pValue;
00591 
00592   /* ulValueLen went from CK_USHORT to CK_ULONG for v2.0 */
00593   CK_ULONG          ulValueLen;  /* in bytes */
00594 } CK_ATTRIBUTE;
00595 
00596 typedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR;
00597 
00598 
00599 /* CK_DATE is a structure that defines a date */
00600 typedef struct CK_DATE{
00601   CK_CHAR       year[4];   /* the year ("1900" - "9999") */
00602   CK_CHAR       month[2];  /* the month ("01" - "12") */
00603   CK_CHAR       day[2];    /* the day   ("01" - "31") */
00604 } CK_DATE;
00605 
00606 
00607 /* CK_MECHANISM_TYPE is a value that identifies a mechanism
00608  * type */
00609 /* CK_MECHANISM_TYPE was changed from CK_USHORT to CK_ULONG for
00610  * v2.0 */
00611 typedef CK_ULONG          CK_MECHANISM_TYPE;
00612 
00613 /* the following mechanism types are defined: */
00614 #define CKM_RSA_PKCS_KEY_PAIR_GEN      0x00000000
00615 #define CKM_RSA_PKCS                   0x00000001
00616 #define CKM_RSA_9796                   0x00000002
00617 #define CKM_RSA_X_509                  0x00000003
00618 
00619 /* CKM_MD2_RSA_PKCS, CKM_MD5_RSA_PKCS, and CKM_SHA1_RSA_PKCS
00620  * are new for v2.0.  They are mechanisms which hash and sign */
00621 #define CKM_MD2_RSA_PKCS               0x00000004
00622 #define CKM_MD5_RSA_PKCS               0x00000005
00623 #define CKM_SHA1_RSA_PKCS              0x00000006
00624 
00625 /* CKM_RIPEMD128_RSA_PKCS, CKM_RIPEMD160_RSA_PKCS, and
00626  * CKM_RSA_PKCS_OAEP are new for v2.10 */
00627 #define CKM_RIPEMD128_RSA_PKCS         0x00000007
00628 #define CKM_RIPEMD160_RSA_PKCS         0x00000008
00629 #define CKM_RSA_PKCS_OAEP              0x00000009
00630 
00631 /* CKM_RSA_X9_31_KEY_PAIR_GEN, CKM_RSA_X9_31, CKM_SHA1_RSA_X9_31,
00632  * CKM_RSA_PKCS_PSS, and CKM_SHA1_RSA_PKCS_PSS are new for v2.11 */
00633 #define CKM_RSA_X9_31_KEY_PAIR_GEN     0x0000000A
00634 #define CKM_RSA_X9_31                  0x0000000B
00635 #define CKM_SHA1_RSA_X9_31             0x0000000C
00636 #define CKM_RSA_PKCS_PSS               0x0000000D
00637 #define CKM_SHA1_RSA_PKCS_PSS          0x0000000E
00638 
00639 #define CKM_DSA_KEY_PAIR_GEN           0x00000010
00640 #define CKM_DSA                        0x00000011
00641 #define CKM_DSA_SHA1                   0x00000012
00642 #define CKM_DH_PKCS_KEY_PAIR_GEN       0x00000020
00643 #define CKM_DH_PKCS_DERIVE             0x00000021
00644 
00645 /* CKM_X9_42_DH_KEY_PAIR_GEN, CKM_X9_42_DH_DERIVE,
00646  * CKM_X9_42_DH_HYBRID_DERIVE, and CKM_X9_42_MQV_DERIVE are new for
00647  * v2.11 */
00648 #define CKM_X9_42_DH_KEY_PAIR_GEN      0x00000030
00649 #define CKM_X9_42_DH_DERIVE            0x00000031
00650 #define CKM_X9_42_DH_HYBRID_DERIVE     0x00000032
00651 #define CKM_X9_42_MQV_DERIVE           0x00000033
00652 
00653 /* CKM_SHA256/384/512 are new for v2.20 */
00654 #define CKM_SHA256_RSA_PKCS            0x00000040
00655 #define CKM_SHA384_RSA_PKCS            0x00000041
00656 #define CKM_SHA512_RSA_PKCS            0x00000042
00657 #define CKM_SHA256_RSA_PKCS_PSS        0x00000043
00658 #define CKM_SHA384_RSA_PKCS_PSS        0x00000044
00659 #define CKM_SHA512_RSA_PKCS_PSS        0x00000045
00660 
00661 #define CKM_RC2_KEY_GEN                0x00000100
00662 #define CKM_RC2_ECB                    0x00000101
00663 #define CKM_RC2_CBC                    0x00000102
00664 #define CKM_RC2_MAC                    0x00000103
00665 
00666 /* CKM_RC2_MAC_GENERAL and CKM_RC2_CBC_PAD are new for v2.0 */
00667 #define CKM_RC2_MAC_GENERAL            0x00000104
00668 #define CKM_RC2_CBC_PAD                0x00000105
00669 
00670 #define CKM_RC4_KEY_GEN                0x00000110
00671 #define CKM_RC4                        0x00000111
00672 #define CKM_DES_KEY_GEN                0x00000120
00673 #define CKM_DES_ECB                    0x00000121
00674 #define CKM_DES_CBC                    0x00000122
00675 #define CKM_DES_MAC                    0x00000123
00676 
00677 /* CKM_DES_MAC_GENERAL and CKM_DES_CBC_PAD are new for v2.0 */
00678 #define CKM_DES_MAC_GENERAL            0x00000124
00679 #define CKM_DES_CBC_PAD                0x00000125
00680 
00681 #define CKM_DES2_KEY_GEN               0x00000130
00682 #define CKM_DES3_KEY_GEN               0x00000131
00683 #define CKM_DES3_ECB                   0x00000132
00684 #define CKM_DES3_CBC                   0x00000133
00685 #define CKM_DES3_MAC                   0x00000134
00686 
00687 /* CKM_DES3_MAC_GENERAL, CKM_DES3_CBC_PAD, CKM_CDMF_KEY_GEN,
00688  * CKM_CDMF_ECB, CKM_CDMF_CBC, CKM_CDMF_MAC,
00689  * CKM_CDMF_MAC_GENERAL, and CKM_CDMF_CBC_PAD are new for v2.0 */
00690 #define CKM_DES3_MAC_GENERAL           0x00000135
00691 #define CKM_DES3_CBC_PAD               0x00000136
00692 #define CKM_CDMF_KEY_GEN               0x00000140
00693 #define CKM_CDMF_ECB                   0x00000141
00694 #define CKM_CDMF_CBC                   0x00000142
00695 #define CKM_CDMF_MAC                   0x00000143
00696 #define CKM_CDMF_MAC_GENERAL           0x00000144
00697 #define CKM_CDMF_CBC_PAD               0x00000145
00698 
00699 /* the following four DES mechanisms are new for v2.20 */
00700 #define CKM_DES_OFB64                  0x00000150
00701 #define CKM_DES_OFB8                   0x00000151
00702 #define CKM_DES_CFB64                  0x00000152
00703 #define CKM_DES_CFB8                   0x00000153
00704 
00705 #define CKM_MD2                        0x00000200
00706 
00707 /* CKM_MD2_HMAC and CKM_MD2_HMAC_GENERAL are new for v2.0 */
00708 #define CKM_MD2_HMAC                   0x00000201
00709 #define CKM_MD2_HMAC_GENERAL           0x00000202
00710 
00711 #define CKM_MD5                        0x00000210
00712 
00713 /* CKM_MD5_HMAC and CKM_MD5_HMAC_GENERAL are new for v2.0 */
00714 #define CKM_MD5_HMAC                   0x00000211
00715 #define CKM_MD5_HMAC_GENERAL           0x00000212
00716 
00717 #define CKM_SHA_1                      0x00000220
00718 
00719 /* CKM_SHA_1_HMAC and CKM_SHA_1_HMAC_GENERAL are new for v2.0 */
00720 #define CKM_SHA_1_HMAC                 0x00000221
00721 #define CKM_SHA_1_HMAC_GENERAL         0x00000222
00722 
00723 /* CKM_RIPEMD128, CKM_RIPEMD128_HMAC,
00724  * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC,
00725  * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */
00726 #define CKM_RIPEMD128                  0x00000230
00727 #define CKM_RIPEMD128_HMAC             0x00000231
00728 #define CKM_RIPEMD128_HMAC_GENERAL     0x00000232
00729 #define CKM_RIPEMD160                  0x00000240
00730 #define CKM_RIPEMD160_HMAC             0x00000241
00731 #define CKM_RIPEMD160_HMAC_GENERAL     0x00000242
00732 
00733 /* CKM_SHA256/384/512 are new for v2.20 */
00734 #define CKM_SHA256                     0x00000250
00735 #define CKM_SHA256_HMAC                0x00000251
00736 #define CKM_SHA256_HMAC_GENERAL        0x00000252
00737 #define CKM_SHA384                     0x00000260
00738 #define CKM_SHA384_HMAC                0x00000261
00739 #define CKM_SHA384_HMAC_GENERAL        0x00000262
00740 #define CKM_SHA512                     0x00000270
00741 #define CKM_SHA512_HMAC                0x00000271
00742 #define CKM_SHA512_HMAC_GENERAL        0x00000272
00743 
00744 /* All of the following mechanisms are new for v2.0 */
00745 /* Note that CAST128 and CAST5 are the same algorithm */
00746 #define CKM_CAST_KEY_GEN               0x00000300
00747 #define CKM_CAST_ECB                   0x00000301
00748 #define CKM_CAST_CBC                   0x00000302
00749 #define CKM_CAST_MAC                   0x00000303
00750 #define CKM_CAST_MAC_GENERAL           0x00000304
00751 #define CKM_CAST_CBC_PAD               0x00000305
00752 #define CKM_CAST3_KEY_GEN              0x00000310
00753 #define CKM_CAST3_ECB                  0x00000311
00754 #define CKM_CAST3_CBC                  0x00000312
00755 #define CKM_CAST3_MAC                  0x00000313
00756 #define CKM_CAST3_MAC_GENERAL          0x00000314
00757 #define CKM_CAST3_CBC_PAD              0x00000315
00758 #define CKM_CAST5_KEY_GEN              0x00000320
00759 #define CKM_CAST128_KEY_GEN            0x00000320
00760 #define CKM_CAST5_ECB                  0x00000321
00761 #define CKM_CAST128_ECB                0x00000321
00762 #define CKM_CAST5_CBC                  0x00000322
00763 #define CKM_CAST128_CBC                0x00000322
00764 #define CKM_CAST5_MAC                  0x00000323
00765 #define CKM_CAST128_MAC                0x00000323
00766 #define CKM_CAST5_MAC_GENERAL          0x00000324
00767 #define CKM_CAST128_MAC_GENERAL        0x00000324
00768 #define CKM_CAST5_CBC_PAD              0x00000325
00769 #define CKM_CAST128_CBC_PAD            0x00000325
00770 #define CKM_RC5_KEY_GEN                0x00000330
00771 #define CKM_RC5_ECB                    0x00000331
00772 #define CKM_RC5_CBC                    0x00000332
00773 #define CKM_RC5_MAC                    0x00000333
00774 #define CKM_RC5_MAC_GENERAL            0x00000334
00775 #define CKM_RC5_CBC_PAD                0x00000335
00776 #define CKM_IDEA_KEY_GEN               0x00000340
00777 #define CKM_IDEA_ECB                   0x00000341
00778 #define CKM_IDEA_CBC                   0x00000342
00779 #define CKM_IDEA_MAC                   0x00000343
00780 #define CKM_IDEA_MAC_GENERAL           0x00000344
00781 #define CKM_IDEA_CBC_PAD               0x00000345
00782 #define CKM_GENERIC_SECRET_KEY_GEN     0x00000350
00783 #define CKM_CONCATENATE_BASE_AND_KEY   0x00000360
00784 #define CKM_CONCATENATE_BASE_AND_DATA  0x00000362
00785 #define CKM_CONCATENATE_DATA_AND_BASE  0x00000363
00786 #define CKM_XOR_BASE_AND_DATA          0x00000364
00787 #define CKM_EXTRACT_KEY_FROM_KEY       0x00000365
00788 #define CKM_SSL3_PRE_MASTER_KEY_GEN    0x00000370
00789 #define CKM_SSL3_MASTER_KEY_DERIVE     0x00000371
00790 #define CKM_SSL3_KEY_AND_MAC_DERIVE    0x00000372
00791 
00792 /* CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_PRE_MASTER_KEY_GEN,
00793  * CKM_TLS_MASTER_KEY_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE, and
00794  * CKM_TLS_MASTER_KEY_DERIVE_DH are new for v2.11 */
00795 #define CKM_SSL3_MASTER_KEY_DERIVE_DH  0x00000373
00796 #define CKM_TLS_PRE_MASTER_KEY_GEN     0x00000374
00797 #define CKM_TLS_MASTER_KEY_DERIVE      0x00000375
00798 #define CKM_TLS_KEY_AND_MAC_DERIVE     0x00000376
00799 #define CKM_TLS_MASTER_KEY_DERIVE_DH   0x00000377
00800 
00801 /* CKM_TLS_PRF is new for v2.20 */
00802 #define CKM_TLS_PRF                    0x00000378
00803 
00804 #define CKM_SSL3_MD5_MAC               0x00000380
00805 #define CKM_SSL3_SHA1_MAC              0x00000381
00806 #define CKM_MD5_KEY_DERIVATION         0x00000390
00807 #define CKM_MD2_KEY_DERIVATION         0x00000391
00808 #define CKM_SHA1_KEY_DERIVATION        0x00000392
00809 
00810 /* CKM_SHA256/384/512 are new for v2.20 */
00811 #define CKM_SHA256_KEY_DERIVATION      0x00000393
00812 #define CKM_SHA384_KEY_DERIVATION      0x00000394
00813 #define CKM_SHA512_KEY_DERIVATION      0x00000395
00814 
00815 #define CKM_PBE_MD2_DES_CBC            0x000003A0
00816 #define CKM_PBE_MD5_DES_CBC            0x000003A1
00817 #define CKM_PBE_MD5_CAST_CBC           0x000003A2
00818 #define CKM_PBE_MD5_CAST3_CBC          0x000003A3
00819 #define CKM_PBE_MD5_CAST5_CBC          0x000003A4
00820 #define CKM_PBE_MD5_CAST128_CBC        0x000003A4
00821 #define CKM_PBE_SHA1_CAST5_CBC         0x000003A5
00822 #define CKM_PBE_SHA1_CAST128_CBC       0x000003A5
00823 #define CKM_PBE_SHA1_RC4_128           0x000003A6
00824 #define CKM_PBE_SHA1_RC4_40            0x000003A7
00825 #define CKM_PBE_SHA1_DES3_EDE_CBC      0x000003A8
00826 #define CKM_PBE_SHA1_DES2_EDE_CBC      0x000003A9
00827 #define CKM_PBE_SHA1_RC2_128_CBC       0x000003AA
00828 #define CKM_PBE_SHA1_RC2_40_CBC        0x000003AB
00829 
00830 /* CKM_PKCS5_PBKD2 is new for v2.10 */
00831 #define CKM_PKCS5_PBKD2                0x000003B0
00832 
00833 #define CKM_PBA_SHA1_WITH_SHA1_HMAC    0x000003C0
00834 
00835 /* WTLS mechanisms are new for v2.20 */
00836 #define CKM_WTLS_PRE_MASTER_KEY_GEN         0x000003D0
00837 #define CKM_WTLS_MASTER_KEY_DERIVE          0x000003D1
00838 #define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC   0x000003D2
00839 #define CKM_WTLS_PRF                        0x000003D3
00840 #define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE  0x000003D4
00841 #define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE  0x000003D5
00842 
00843 #define CKM_KEY_WRAP_LYNKS             0x00000400
00844 #define CKM_KEY_WRAP_SET_OAEP          0x00000401
00845 
00846 /* CKM_CMS_SIG is new for v2.20 */
00847 #define CKM_CMS_SIG                    0x00000500
00848 
00849 /* Fortezza mechanisms */
00850 #define CKM_SKIPJACK_KEY_GEN           0x00001000
00851 #define CKM_SKIPJACK_ECB64             0x00001001
00852 #define CKM_SKIPJACK_CBC64             0x00001002
00853 #define CKM_SKIPJACK_OFB64             0x00001003
00854 #define CKM_SKIPJACK_CFB64             0x00001004
00855 #define CKM_SKIPJACK_CFB32             0x00001005
00856 #define CKM_SKIPJACK_CFB16             0x00001006
00857 #define CKM_SKIPJACK_CFB8              0x00001007
00858 #define CKM_SKIPJACK_WRAP              0x00001008
00859 #define CKM_SKIPJACK_PRIVATE_WRAP      0x00001009
00860 #define CKM_SKIPJACK_RELAYX            0x0000100a
00861 #define CKM_KEA_KEY_PAIR_GEN           0x00001010
00862 #define CKM_KEA_KEY_DERIVE             0x00001011
00863 #define CKM_FORTEZZA_TIMESTAMP         0x00001020
00864 #define CKM_BATON_KEY_GEN              0x00001030
00865 #define CKM_BATON_ECB128               0x00001031
00866 #define CKM_BATON_ECB96                0x00001032
00867 #define CKM_BATON_CBC128               0x00001033
00868 #define CKM_BATON_COUNTER              0x00001034
00869 #define CKM_BATON_SHUFFLE              0x00001035
00870 #define CKM_BATON_WRAP                 0x00001036
00871 
00872 /* CKM_ECDSA_KEY_PAIR_GEN is deprecated in v2.11,
00873  * CKM_EC_KEY_PAIR_GEN is preferred */
00874 #define CKM_ECDSA_KEY_PAIR_GEN         0x00001040
00875 #define CKM_EC_KEY_PAIR_GEN            0x00001040
00876 
00877 #define CKM_ECDSA                      0x00001041
00878 #define CKM_ECDSA_SHA1                 0x00001042
00879 
00880 /* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE
00881  * are new for v2.11 */
00882 #define CKM_ECDH1_DERIVE               0x00001050
00883 #define CKM_ECDH1_COFACTOR_DERIVE      0x00001051
00884 #define CKM_ECMQV_DERIVE               0x00001052
00885 
00886 #define CKM_JUNIPER_KEY_GEN            0x00001060
00887 #define CKM_JUNIPER_ECB128             0x00001061
00888 #define CKM_JUNIPER_CBC128             0x00001062
00889 #define CKM_JUNIPER_COUNTER            0x00001063
00890 #define CKM_JUNIPER_SHUFFLE            0x00001064
00891 #define CKM_JUNIPER_WRAP               0x00001065
00892 #define CKM_FASTHASH                   0x00001070
00893 
00894 /* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC,
00895  * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN,
00896  * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are
00897  * new for v2.11 */
00898 #define CKM_AES_KEY_GEN                0x00001080
00899 #define CKM_AES_ECB                    0x00001081
00900 #define CKM_AES_CBC                    0x00001082
00901 #define CKM_AES_MAC                    0x00001083
00902 #define CKM_AES_MAC_GENERAL            0x00001084
00903 #define CKM_AES_CBC_PAD                0x00001085
00904 
00905 /* BlowFish and TwoFish are new for v2.20 */
00906 #define CKM_BLOWFISH_KEY_GEN           0x00001090
00907 #define CKM_BLOWFISH_CBC               0x00001091
00908 #define CKM_TWOFISH_KEY_GEN            0x00001092
00909 #define CKM_TWOFISH_CBC                0x00001093
00910 
00911 
00912 /* CKM_xxx_ENCRYPT_DATA mechanisms are new for v2.20 */
00913 #define CKM_DES_ECB_ENCRYPT_DATA       0x00001100
00914 #define CKM_DES_CBC_ENCRYPT_DATA       0x00001101
00915 #define CKM_DES3_ECB_ENCRYPT_DATA      0x00001102
00916 #define CKM_DES3_CBC_ENCRYPT_DATA      0x00001103
00917 #define CKM_AES_ECB_ENCRYPT_DATA       0x00001104
00918 #define CKM_AES_CBC_ENCRYPT_DATA       0x00001105
00919 
00920 #define CKM_DSA_PARAMETER_GEN          0x00002000
00921 #define CKM_DH_PKCS_PARAMETER_GEN      0x00002001
00922 #define CKM_X9_42_DH_PARAMETER_GEN     0x00002002
00923 
00924 #define CKM_VENDOR_DEFINED             0x80000000
00925 
00926 typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR;
00927 
00928 
00929 /* CK_MECHANISM is a structure that specifies a particular
00930  * mechanism  */
00931 typedef struct CK_MECHANISM {
00932   CK_MECHANISM_TYPE mechanism;
00933   CK_VOID_PTR       pParameter;
00934 
00935   /* ulParameterLen was changed from CK_USHORT to CK_ULONG for
00936    * v2.0 */
00937   CK_ULONG          ulParameterLen;  /* in bytes */
00938 } CK_MECHANISM;
00939 
00940 typedef CK_MECHANISM CK_PTR CK_MECHANISM_PTR;
00941 
00942 
00943 /* CK_MECHANISM_INFO provides information about a particular
00944  * mechanism */
00945 typedef struct CK_MECHANISM_INFO {
00946     CK_ULONG    ulMinKeySize;
00947     CK_ULONG    ulMaxKeySize;
00948     CK_FLAGS    flags;
00949 } CK_MECHANISM_INFO;
00950 
00951 /* The flags are defined as follows:
00952  *      Bit Flag               Mask        Meaning */
00953 #define CKF_HW                 0x00000001  /* performed by HW */
00954 
00955 /* The flags CKF_ENCRYPT, CKF_DECRYPT, CKF_DIGEST, CKF_SIGN,
00956  * CKG_SIGN_RECOVER, CKF_VERIFY, CKF_VERIFY_RECOVER,
00957  * CKF_GENERATE, CKF_GENERATE_KEY_PAIR, CKF_WRAP, CKF_UNWRAP,
00958  * and CKF_DERIVE are new for v2.0.  They specify whether or not
00959  * a mechanism can be used for a particular task */
00960 #define CKF_ENCRYPT            0x00000100
00961 #define CKF_DECRYPT            0x00000200
00962 #define CKF_DIGEST             0x00000400
00963 #define CKF_SIGN               0x00000800
00964 #define CKF_SIGN_RECOVER       0x00001000
00965 #define CKF_VERIFY             0x00002000
00966 #define CKF_VERIFY_RECOVER     0x00004000
00967 #define CKF_GENERATE           0x00008000
00968 #define CKF_GENERATE_KEY_PAIR  0x00010000
00969 #define CKF_WRAP               0x00020000
00970 #define CKF_UNWRAP             0x00040000
00971 #define CKF_DERIVE             0x00080000
00972 
00973 /* CKF_EC_F_P, CKF_EC_F_2M, CKF_EC_ECPARAMETERS, CKF_EC_NAMEDCURVE,
00974  * CKF_EC_UNCOMPRESS, and CKF_EC_COMPRESS are new for v2.11. They
00975  * describe a token's EC capabilities not available in mechanism
00976  * information. */
00977 #define CKF_EC_F_P             0x00100000
00978 #define CKF_EC_F_2M            0x00200000
00979 #define CKF_EC_ECPARAMETERS    0x00400000
00980 #define CKF_EC_NAMEDCURVE      0x00800000
00981 #define CKF_EC_UNCOMPRESS      0x01000000
00982 #define CKF_EC_COMPRESS        0x02000000
00983 
00984 #define CKF_EXTENSION          0x80000000 /* FALSE for this version */
00985 
00986 typedef CK_MECHANISM_INFO CK_PTR CK_MECHANISM_INFO_PTR;
00987 
00988 
00989 /* CK_RV is a value that identifies the return value of a
00990  * PKCS #11 function */
00991 /* CK_RV was changed from CK_USHORT to CK_ULONG for v2.0 */
00992 typedef CK_ULONG          CK_RV;
00993 
00994 #define CKR_OK                                0x00000000
00995 #define CKR_CANCEL                            0x00000001
00996 #define CKR_HOST_MEMORY                       0x00000002
00997 #define CKR_SLOT_ID_INVALID                   0x00000003
00998 
00999 /* CKR_FLAGS_INVALID was removed for v2.0 */
01000 
01001 /* CKR_GENERAL_ERROR and CKR_FUNCTION_FAILED are new for v2.0 */
01002 #define CKR_GENERAL_ERROR                     0x00000005
01003 #define CKR_FUNCTION_FAILED                   0x00000006
01004 
01005 /* CKR_ARGUMENTS_BAD, CKR_NO_EVENT, CKR_NEED_TO_CREATE_THREADS,
01006  * and CKR_CANT_LOCK are new for v2.01 */
01007 #define CKR_ARGUMENTS_BAD                     0x00000007
01008 #define CKR_NO_EVENT                          0x00000008
01009 #define CKR_NEED_TO_CREATE_THREADS            0x00000009
01010 #define CKR_CANT_LOCK                         0x0000000A
01011 
01012 #define CKR_ATTRIBUTE_READ_ONLY               0x00000010
01013 #define CKR_ATTRIBUTE_SENSITIVE               0x00000011
01014 #define CKR_ATTRIBUTE_TYPE_INVALID            0x00000012
01015 #define CKR_ATTRIBUTE_VALUE_INVALID           0x00000013
01016 #define CKR_DATA_INVALID                      0x00000020
01017 #define CKR_DATA_LEN_RANGE                    0x00000021
01018 #define CKR_DEVICE_ERROR                      0x00000030
01019 #define CKR_DEVICE_MEMORY                     0x00000031
01020 #define CKR_DEVICE_REMOVED                    0x00000032
01021 #define CKR_ENCRYPTED_DATA_INVALID            0x00000040
01022 #define CKR_ENCRYPTED_DATA_LEN_RANGE          0x00000041
01023 #define CKR_FUNCTION_CANCELED                 0x00000050
01024 #define CKR_FUNCTION_NOT_PARALLEL             0x00000051
01025 
01026 /* CKR_FUNCTION_NOT_SUPPORTED is new for v2.0 */
01027 #define CKR_FUNCTION_NOT_SUPPORTED            0x00000054
01028 
01029 #define CKR_KEY_HANDLE_INVALID                0x00000060
01030 
01031 /* CKR_KEY_SENSITIVE was removed for v2.0 */
01032 
01033 #define CKR_KEY_SIZE_RANGE                    0x00000062
01034 #define CKR_KEY_TYPE_INCONSISTENT             0x00000063
01035 
01036 /* CKR_KEY_NOT_NEEDED, CKR_KEY_CHANGED, CKR_KEY_NEEDED,
01037  * CKR_KEY_INDIGESTIBLE, CKR_KEY_FUNCTION_NOT_PERMITTED,
01038  * CKR_KEY_NOT_WRAPPABLE, and CKR_KEY_UNEXTRACTABLE are new for
01039  * v2.0 */
01040 #define CKR_KEY_NOT_NEEDED                    0x00000064
01041 #define CKR_KEY_CHANGED                       0x00000065
01042 #define CKR_KEY_NEEDED                        0x00000066
01043 #define CKR_KEY_INDIGESTIBLE                  0x00000067
01044 #define CKR_KEY_FUNCTION_NOT_PERMITTED        0x00000068
01045 #define CKR_KEY_NOT_WRAPPABLE                 0x00000069
01046 #define CKR_KEY_UNEXTRACTABLE                 0x0000006A
01047 
01048 #define CKR_MECHANISM_INVALID                 0x00000070
01049 #define CKR_MECHANISM_PARAM_INVALID           0x00000071
01050 
01051 /* CKR_OBJECT_CLASS_INCONSISTENT and CKR_OBJECT_CLASS_INVALID
01052  * were removed for v2.0 */
01053 #define CKR_OBJECT_HANDLE_INVALID             0x00000082
01054 #define CKR_OPERATION_ACTIVE                  0x00000090
01055 #define CKR_OPERATION_NOT_INITIALIZED         0x00000091
01056 #define CKR_PIN_INCORRECT                     0x000000A0
01057 #define CKR_PIN_INVALID                       0x000000A1
01058 #define CKR_PIN_LEN_RANGE                     0x000000A2
01059 
01060 /* CKR_PIN_EXPIRED and CKR_PIN_LOCKED are new for v2.0 */
01061 #define CKR_PIN_EXPIRED                       0x000000A3
01062 #define CKR_PIN_LOCKED                        0x000000A4
01063 
01064 #define CKR_SESSION_CLOSED                    0x000000B0
01065 #define CKR_SESSION_COUNT                     0x000000B1
01066 #define CKR_SESSION_HANDLE_INVALID            0x000000B3
01067 #define CKR_SESSION_PARALLEL_NOT_SUPPORTED    0x000000B4
01068 #define CKR_SESSION_READ_ONLY                 0x000000B5
01069 #define CKR_SESSION_EXISTS                    0x000000B6
01070 
01071 /* CKR_SESSION_READ_ONLY_EXISTS and
01072  * CKR_SESSION_READ_WRITE_SO_EXISTS are new for v2.0 */
01073 #define CKR_SESSION_READ_ONLY_EXISTS          0x000000B7
01074 #define CKR_SESSION_READ_WRITE_SO_EXISTS      0x000000B8
01075 
01076 #define CKR_SIGNATURE_INVALID                 0x000000C0
01077 #define CKR_SIGNATURE_LEN_RANGE               0x000000C1
01078 #define CKR_TEMPLATE_INCOMPLETE               0x000000D0
01079 #define CKR_TEMPLATE_INCONSISTENT             0x000000D1
01080 #define CKR_TOKEN_NOT_PRESENT                 0x000000E0
01081 #define CKR_TOKEN_NOT_RECOGNIZED              0x000000E1
01082 #define CKR_TOKEN_WRITE_PROTECTED             0x000000E2
01083 #define CKR_UNWRAPPING_KEY_HANDLE_INVALID     0x000000F0
01084 #define CKR_UNWRAPPING_KEY_SIZE_RANGE         0x000000F1
01085 #define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT  0x000000F2
01086 #define CKR_USER_ALREADY_LOGGED_IN            0x00000100
01087 #define CKR_USER_NOT_LOGGED_IN                0x00000101
01088 #define CKR_USER_PIN_NOT_INITIALIZED          0x00000102
01089 #define CKR_USER_TYPE_INVALID                 0x00000103
01090 
01091 /* CKR_USER_ANOTHER_ALREADY_LOGGED_IN and CKR_USER_TOO_MANY_TYPES
01092  * are new to v2.01 */
01093 #define CKR_USER_ANOTHER_ALREADY_LOGGED_IN    0x00000104
01094 #define CKR_USER_TOO_MANY_TYPES               0x00000105
01095 
01096 #define CKR_WRAPPED_KEY_INVALID               0x00000110
01097 #define CKR_WRAPPED_KEY_LEN_RANGE             0x00000112
01098 #define CKR_WRAPPING_KEY_HANDLE_INVALID       0x00000113
01099 #define CKR_WRAPPING_KEY_SIZE_RANGE           0x00000114
01100 #define CKR_WRAPPING_KEY_TYPE_INCONSISTENT    0x00000115
01101 #define CKR_RANDOM_SEED_NOT_SUPPORTED         0x00000120
01102 
01103 /* These are new to v2.0 */
01104 #define CKR_RANDOM_NO_RNG                     0x00000121
01105 
01106 /* These are new to v2.11 */
01107 #define CKR_DOMAIN_PARAMS_INVALID             0x00000130
01108 
01109 /* These are new to v2.0 */
01110 #define CKR_BUFFER_TOO_SMALL                  0x00000150
01111 #define CKR_SAVED_STATE_INVALID               0x00000160
01112 #define CKR_INFORMATION_SENSITIVE             0x00000170
01113 #define CKR_STATE_UNSAVEABLE                  0x00000180
01114 
01115 /* These are new to v2.01 */
01116 #define CKR_CRYPTOKI_NOT_INITIALIZED          0x00000190
01117 #define CKR_CRYPTOKI_ALREADY_INITIALIZED      0x00000191
01118 #define CKR_MUTEX_BAD                         0x000001A0
01119 #define CKR_MUTEX_NOT_LOCKED                  0x000001A1
01120 
01121 /* This is new to v2.20 */
01122 #define CKR_FUNCTION_REJECTED                 0x00000200
01123 
01124 #define CKR_VENDOR_DEFINED                    0x80000000
01125 
01126 
01127 /* CK_NOTIFY is an application callback that processes events */
01128 typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)(
01129   CK_SESSION_HANDLE hSession,     /* the session's handle */
01130   CK_NOTIFICATION   event,
01131   CK_VOID_PTR       pApplication  /* passed to C_OpenSession */
01132 );
01133 
01134 
01135 /* CK_FUNCTION_LIST is a structure holding a PKCS #11 spec
01136  * version and pointers of appropriate types to all the
01137  * PKCS #11 functions */
01138 /* CK_FUNCTION_LIST is new for v2.0 */
01139 typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST;
01140 
01141 typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR;
01142 
01143 typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR;
01144 
01145 
01146 /* CK_CREATEMUTEX is an application callback for creating a
01147  * mutex object */
01148 typedef CK_CALLBACK_FUNCTION(CK_RV, CK_CREATEMUTEX)(
01149   CK_VOID_PTR_PTR ppMutex  /* location to receive ptr to mutex */
01150 );
01151 
01152 
01153 /* CK_DESTROYMUTEX is an application callback for destroying a
01154  * mutex object */
01155 typedef CK_CALLBACK_FUNCTION(CK_RV, CK_DESTROYMUTEX)(
01156   CK_VOID_PTR pMutex  /* pointer to mutex */
01157 );
01158 
01159 
01160 /* CK_LOCKMUTEX is an application callback for locking a mutex */
01161 typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)(
01162   CK_VOID_PTR pMutex  /* pointer to mutex */
01163 );
01164 
01165 
01166 /* CK_UNLOCKMUTEX is an application callback for unlocking a
01167  * mutex */
01168 typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)(
01169   CK_VOID_PTR pMutex  /* pointer to mutex */
01170 );
01171 
01172 
01173 /* CK_C_INITIALIZE_ARGS provides the optional arguments to
01174  * C_Initialize */
01175 typedef struct CK_C_INITIALIZE_ARGS {
01176   CK_CREATEMUTEX CreateMutex;
01177   CK_DESTROYMUTEX DestroyMutex;
01178   CK_LOCKMUTEX LockMutex;
01179   CK_UNLOCKMUTEX UnlockMutex;
01180   CK_FLAGS flags;
01181   /* The official PKCS #11 spec does not have a 'LibraryParameters' field, but
01182    * a reserved field. NSS needs a way to pass instance-specific information
01183    * to the library (like where to find its config files, etc). This
01184    * information is usually provided by the installer and passed uninterpreted
01185    * by NSS to the library, though NSS does know the specifics of the softoken
01186    * version of this parameter. Most compliant PKCS#11 modules expect this 
01187    * parameter to be NULL, and will return CKR_ARGUMENTS_BAD from
01188    * C_Initialize if Library parameters is supplied. */
01189   CK_CHAR_PTR *LibraryParameters;
01190   /* This field is only present if the LibraryParameters is not NULL. It must
01191    * be NULL in all cases */
01192   CK_VOID_PTR pReserved;
01193 } CK_C_INITIALIZE_ARGS;
01194 
01195 /* flags: bit flags that provide capabilities of the slot
01196  *      Bit Flag                           Mask       Meaning
01197  */
01198 #define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001
01199 #define CKF_OS_LOCKING_OK                  0x00000002
01200 
01201 typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR;
01202 
01203 
01204 /* additional flags for parameters to functions */
01205 
01206 /* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */
01207 #define CKF_DONT_BLOCK     1
01208 
01209 /* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10.
01210  * CK_RSA_PKCS_OAEP_MGF_TYPE  is used to indicate the Message
01211  * Generation Function (MGF) applied to a message block when
01212  * formatting a message block for the PKCS #1 OAEP encryption
01213  * scheme. */
01214 typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE;
01215 
01216 typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR;
01217 
01218 /* The following MGFs are defined */
01219 /* CKG_MGF1_SHA256, CKG_MGF1_SHA384, and CKG_MGF1_SHA512
01220  * are new for v2.20 */
01221 #define CKG_MGF1_SHA1         0x00000001
01222 #define CKG_MGF1_SHA256       0x00000002
01223 #define CKG_MGF1_SHA384       0x00000003
01224 #define CKG_MGF1_SHA512       0x00000004
01225 
01226 /* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10.
01227  * CK_RSA_PKCS_OAEP_SOURCE_TYPE  is used to indicate the source
01228  * of the encoding parameter when formatting a message block
01229  * for the PKCS #1 OAEP encryption scheme. */
01230 typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE;
01231 
01232 typedef CK_RSA_PKCS_OAEP_SOURCE_TYPE CK_PTR CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR;
01233 
01234 /* The following encoding parameter sources are defined */
01235 #define CKZ_DATA_SPECIFIED    0x00000001
01236 
01237 /* CK_RSA_PKCS_OAEP_PARAMS is new for v2.10.
01238  * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the
01239  * CKM_RSA_PKCS_OAEP mechanism. */
01240 typedef struct CK_RSA_PKCS_OAEP_PARAMS {
01241         CK_MECHANISM_TYPE hashAlg;
01242         CK_RSA_PKCS_MGF_TYPE mgf;
01243         CK_RSA_PKCS_OAEP_SOURCE_TYPE source;
01244         CK_VOID_PTR pSourceData;
01245         CK_ULONG ulSourceDataLen;
01246 } CK_RSA_PKCS_OAEP_PARAMS;
01247 
01248 typedef CK_RSA_PKCS_OAEP_PARAMS CK_PTR CK_RSA_PKCS_OAEP_PARAMS_PTR;
01249 
01250 /* CK_RSA_PKCS_PSS_PARAMS is new for v2.11.
01251  * CK_RSA_PKCS_PSS_PARAMS provides the parameters to the
01252  * CKM_RSA_PKCS_PSS mechanism(s). */
01253 typedef struct CK_RSA_PKCS_PSS_PARAMS {
01254         CK_MECHANISM_TYPE    hashAlg;
01255         CK_RSA_PKCS_MGF_TYPE mgf;
01256         CK_ULONG             sLen;
01257 } CK_RSA_PKCS_PSS_PARAMS;
01258 
01259 typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR;
01260 
01261 /* CK_EC_KDF_TYPE is new for v2.11. */
01262 typedef CK_ULONG CK_EC_KDF_TYPE;
01263 
01264 /* The following EC Key Derivation Functions are defined */
01265 #define CKD_NULL                 0x00000001
01266 #define CKD_SHA1_KDF             0x00000002
01267 
01268 /* CK_ECDH1_DERIVE_PARAMS is new for v2.11.
01269  * CK_ECDH1_DERIVE_PARAMS provides the parameters to the
01270  * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms,
01271  * where each party contributes one key pair.
01272  */
01273 typedef struct CK_ECDH1_DERIVE_PARAMS {
01274   CK_EC_KDF_TYPE kdf;
01275   CK_ULONG ulSharedDataLen;
01276   CK_BYTE_PTR pSharedData;
01277   CK_ULONG ulPublicDataLen;
01278   CK_BYTE_PTR pPublicData;
01279 } CK_ECDH1_DERIVE_PARAMS;
01280 
01281 typedef CK_ECDH1_DERIVE_PARAMS CK_PTR CK_ECDH1_DERIVE_PARAMS_PTR;
01282 
01283 
01284 /* CK_ECDH2_DERIVE_PARAMS is new for v2.11.
01285  * CK_ECDH2_DERIVE_PARAMS provides the parameters to the
01286  * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. */
01287 typedef struct CK_ECDH2_DERIVE_PARAMS {
01288   CK_EC_KDF_TYPE kdf;
01289   CK_ULONG ulSharedDataLen;
01290   CK_BYTE_PTR pSharedData;
01291   CK_ULONG ulPublicDataLen;
01292   CK_BYTE_PTR pPublicData;
01293   CK_ULONG ulPrivateDataLen;
01294   CK_OBJECT_HANDLE hPrivateData;
01295   CK_ULONG ulPublicDataLen2;
01296   CK_BYTE_PTR pPublicData2;
01297 } CK_ECDH2_DERIVE_PARAMS;
01298 
01299 typedef CK_ECDH2_DERIVE_PARAMS CK_PTR CK_ECDH2_DERIVE_PARAMS_PTR;
01300 
01301 typedef struct CK_ECMQV_DERIVE_PARAMS {
01302   CK_EC_KDF_TYPE kdf;
01303   CK_ULONG ulSharedDataLen;
01304   CK_BYTE_PTR pSharedData;
01305   CK_ULONG ulPublicDataLen;
01306   CK_BYTE_PTR pPublicData;
01307   CK_ULONG ulPrivateDataLen;
01308   CK_OBJECT_HANDLE hPrivateData;
01309   CK_ULONG ulPublicDataLen2;
01310   CK_BYTE_PTR pPublicData2;
01311   CK_OBJECT_HANDLE publicKey;
01312 } CK_ECMQV_DERIVE_PARAMS;
01313 
01314 typedef CK_ECMQV_DERIVE_PARAMS CK_PTR CK_ECMQV_DERIVE_PARAMS_PTR;
01315 
01316 /* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the
01317  * CKM_X9_42_DH_PARAMETER_GEN mechanisms (new for PKCS #11 v2.11) */
01318 typedef CK_ULONG CK_X9_42_DH_KDF_TYPE;
01319 typedef CK_X9_42_DH_KDF_TYPE CK_PTR CK_X9_42_DH_KDF_TYPE_PTR;
01320 
01321 /* The following X9.42 DH key derivation functions are defined
01322    (besides CKD_NULL already defined : */
01323 #define CKD_SHA1_KDF_ASN1        0x00000003
01324 #define CKD_SHA1_KDF_CONCATENATE 0x00000004
01325 
01326 /* CK_X9_42_DH1_DERIVE_PARAMS is new for v2.11.
01327  * CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the
01328  * CKM_X9_42_DH_DERIVE key derivation mechanism, where each party
01329  * contributes one key pair */
01330 typedef struct CK_X9_42_DH1_DERIVE_PARAMS {
01331   CK_X9_42_DH_KDF_TYPE kdf;
01332   CK_ULONG ulOtherInfoLen;
01333   CK_BYTE_PTR pOtherInfo;
01334   CK_ULONG ulPublicDataLen;
01335   CK_BYTE_PTR pPublicData;
01336 } CK_X9_42_DH1_DERIVE_PARAMS;
01337 
01338 typedef struct CK_X9_42_DH1_DERIVE_PARAMS CK_PTR CK_X9_42_DH1_DERIVE_PARAMS_PTR;
01339 
01340 /* CK_X9_42_DH2_DERIVE_PARAMS is new for v2.11.
01341  * CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the
01342  * CKM_X9_42_DH_HYBRID_DERIVE and CKM_X9_42_MQV_DERIVE key derivation
01343  * mechanisms, where each party contributes two key pairs */
01344 typedef struct CK_X9_42_DH2_DERIVE_PARAMS {
01345   CK_X9_42_DH_KDF_TYPE kdf;
01346   CK_ULONG ulOtherInfoLen;
01347   CK_BYTE_PTR pOtherInfo;
01348   CK_ULONG ulPublicDataLen;
01349   CK_BYTE_PTR pPublicData;
01350   CK_ULONG ulPrivateDataLen;
01351   CK_OBJECT_HANDLE hPrivateData;
01352   CK_ULONG ulPublicDataLen2;
01353   CK_BYTE_PTR pPublicData2;
01354 } CK_X9_42_DH2_DERIVE_PARAMS;
01355 
01356 typedef CK_X9_42_DH2_DERIVE_PARAMS CK_PTR CK_X9_42_DH2_DERIVE_PARAMS_PTR;
01357 
01358 typedef struct CK_X9_42_MQV_DERIVE_PARAMS {
01359   CK_X9_42_DH_KDF_TYPE kdf;
01360   CK_ULONG ulOtherInfoLen;
01361   CK_BYTE_PTR pOtherInfo;
01362   CK_ULONG ulPublicDataLen;
01363   CK_BYTE_PTR pPublicData;
01364   CK_ULONG ulPrivateDataLen;
01365   CK_OBJECT_HANDLE hPrivateData;
01366   CK_ULONG ulPublicDataLen2;
01367   CK_BYTE_PTR pPublicData2;
01368   CK_OBJECT_HANDLE publicKey;
01369 } CK_X9_42_MQV_DERIVE_PARAMS;
01370 
01371 typedef CK_X9_42_MQV_DERIVE_PARAMS CK_PTR CK_X9_42_MQV_DERIVE_PARAMS_PTR;
01372 
01373 /* CK_KEA_DERIVE_PARAMS provides the parameters to the
01374  * CKM_KEA_DERIVE mechanism */
01375 /* CK_KEA_DERIVE_PARAMS is new for v2.0 */
01376 typedef struct CK_KEA_DERIVE_PARAMS {
01377   CK_BBOOL      isSender;
01378   CK_ULONG      ulRandomLen;
01379   CK_BYTE_PTR   pRandomA;
01380   CK_BYTE_PTR   pRandomB;
01381   CK_ULONG      ulPublicDataLen;
01382   CK_BYTE_PTR   pPublicData;
01383 } CK_KEA_DERIVE_PARAMS;
01384 
01385 typedef CK_KEA_DERIVE_PARAMS CK_PTR CK_KEA_DERIVE_PARAMS_PTR;
01386 
01387 
01388 /* CK_RC2_PARAMS provides the parameters to the CKM_RC2_ECB and
01389  * CKM_RC2_MAC mechanisms.  An instance of CK_RC2_PARAMS just
01390  * holds the effective keysize */
01391 typedef CK_ULONG          CK_RC2_PARAMS;
01392 
01393 typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR;
01394 
01395 
01396 /* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC
01397  * mechanism */
01398 typedef struct CK_RC2_CBC_PARAMS {
01399   /* ulEffectiveBits was changed from CK_USHORT to CK_ULONG for
01400    * v2.0 */
01401   CK_ULONG      ulEffectiveBits;  /* effective bits (1-1024) */
01402 
01403   CK_BYTE       iv[8];            /* IV for CBC mode */
01404 } CK_RC2_CBC_PARAMS;
01405 
01406 typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR;
01407 
01408 
01409 /* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the
01410  * CKM_RC2_MAC_GENERAL mechanism */
01411 /* CK_RC2_MAC_GENERAL_PARAMS is new for v2.0 */
01412 typedef struct CK_RC2_MAC_GENERAL_PARAMS {
01413   CK_ULONG      ulEffectiveBits;  /* effective bits (1-1024) */
01414   CK_ULONG      ulMacLength;      /* Length of MAC in bytes */
01415 } CK_RC2_MAC_GENERAL_PARAMS;
01416 
01417 typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR \
01418   CK_RC2_MAC_GENERAL_PARAMS_PTR;
01419 
01420 
01421 /* CK_RC5_PARAMS provides the parameters to the CKM_RC5_ECB and
01422  * CKM_RC5_MAC mechanisms */
01423 /* CK_RC5_PARAMS is new for v2.0 */
01424 typedef struct CK_RC5_PARAMS {
01425   CK_ULONG      ulWordsize;  /* wordsize in bits */
01426   CK_ULONG      ulRounds;    /* number of rounds */
01427 } CK_RC5_PARAMS;
01428 
01429 typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR;
01430 
01431 
01432 /* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC
01433  * mechanism */
01434 /* CK_RC5_CBC_PARAMS is new for v2.0 */
01435 typedef struct CK_RC5_CBC_PARAMS {
01436   CK_ULONG      ulWordsize;  /* wordsize in bits */
01437   CK_ULONG      ulRounds;    /* number of rounds */
01438   CK_BYTE_PTR   pIv;         /* pointer to IV */
01439   CK_ULONG      ulIvLen;     /* length of IV in bytes */
01440 } CK_RC5_CBC_PARAMS;
01441 
01442 typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR;
01443 
01444 
01445 /* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the
01446  * CKM_RC5_MAC_GENERAL mechanism */
01447 /* CK_RC5_MAC_GENERAL_PARAMS is new for v2.0 */
01448 typedef struct CK_RC5_MAC_GENERAL_PARAMS {
01449   CK_ULONG      ulWordsize;   /* wordsize in bits */
01450   CK_ULONG      ulRounds;     /* number of rounds */
01451   CK_ULONG      ulMacLength;  /* Length of MAC in bytes */
01452 } CK_RC5_MAC_GENERAL_PARAMS;
01453 
01454 typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR \
01455   CK_RC5_MAC_GENERAL_PARAMS_PTR;
01456 
01457 
01458 /* CK_MAC_GENERAL_PARAMS provides the parameters to most block
01459  * ciphers' MAC_GENERAL mechanisms.  Its value is the length of
01460  * the MAC */
01461 /* CK_MAC_GENERAL_PARAMS is new for v2.0 */
01462 typedef CK_ULONG          CK_MAC_GENERAL_PARAMS;
01463 
01464 typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR;
01465 
01466 /* CK_DES/AES_ECB/CBC_ENCRYPT_DATA_PARAMS are new for v2.20 */
01467 typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS {
01468   CK_BYTE      iv[8];
01469   CK_BYTE_PTR  pData;
01470   CK_ULONG     length;
01471 } CK_DES_CBC_ENCRYPT_DATA_PARAMS;
01472 
01473 typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR;
01474 
01475 typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS {
01476   CK_BYTE      iv[16];
01477   CK_BYTE_PTR  pData;
01478   CK_ULONG     length;
01479 } CK_AES_CBC_ENCRYPT_DATA_PARAMS;
01480 
01481 typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR;
01482 
01483 /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the
01484  * CKM_SKIPJACK_PRIVATE_WRAP mechanism */
01485 /* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */
01486 typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS {
01487   CK_ULONG      ulPasswordLen;
01488   CK_BYTE_PTR   pPassword;
01489   CK_ULONG      ulPublicDataLen;
01490   CK_BYTE_PTR   pPublicData;
01491   CK_ULONG      ulPAndGLen;
01492   CK_ULONG      ulQLen;
01493   CK_ULONG      ulRandomLen;
01494   CK_BYTE_PTR   pRandomA;
01495   CK_BYTE_PTR   pPrimeP;
01496   CK_BYTE_PTR   pBaseG;
01497   CK_BYTE_PTR   pSubprimeQ;
01498 } CK_SKIPJACK_PRIVATE_WRAP_PARAMS;
01499 
01500 typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR \
01501   CK_SKIPJACK_PRIVATE_WRAP_PTR;
01502 
01503 
01504 /* CK_SKIPJACK_RELAYX_PARAMS provides the parameters to the
01505  * CKM_SKIPJACK_RELAYX mechanism */
01506 /* CK_SKIPJACK_RELAYX_PARAMS is new for v2.0 */
01507 typedef struct CK_SKIPJACK_RELAYX_PARAMS {
01508   CK_ULONG      ulOldWrappedXLen;
01509   CK_BYTE_PTR   pOldWrappedX;
01510   CK_ULONG      ulOldPasswordLen;
01511   CK_BYTE_PTR   pOldPassword;
01512   CK_ULONG      ulOldPublicDataLen;
01513   CK_BYTE_PTR   pOldPublicData;
01514   CK_ULONG      ulOldRandomLen;
01515   CK_BYTE_PTR   pOldRandomA;
01516   CK_ULONG      ulNewPasswordLen;
01517   CK_BYTE_PTR   pNewPassword;
01518   CK_ULONG      ulNewPublicDataLen;
01519   CK_BYTE_PTR   pNewPublicData;
01520   CK_ULONG      ulNewRandomLen;
01521   CK_BYTE_PTR   pNewRandomA;
01522 } CK_SKIPJACK_RELAYX_PARAMS;
01523 
01524 typedef CK_SKIPJACK_RELAYX_PARAMS CK_PTR \
01525   CK_SKIPJACK_RELAYX_PARAMS_PTR;
01526 
01527 
01528 typedef struct CK_PBE_PARAMS {
01529   CK_BYTE_PTR      pInitVector;
01530   CK_UTF8CHAR_PTR  pPassword;
01531   CK_ULONG         ulPasswordLen;
01532   CK_BYTE_PTR      pSalt;
01533   CK_ULONG         ulSaltLen;
01534   CK_ULONG         ulIteration;
01535 } CK_PBE_PARAMS;
01536 
01537 typedef CK_PBE_PARAMS CK_PTR CK_PBE_PARAMS_PTR;
01538 
01539 
01540 /* CK_KEY_WRAP_SET_OAEP_PARAMS provides the parameters to the
01541  * CKM_KEY_WRAP_SET_OAEP mechanism */
01542 /* CK_KEY_WRAP_SET_OAEP_PARAMS is new for v2.0 */
01543 typedef struct CK_KEY_WRAP_SET_OAEP_PARAMS {
01544   CK_BYTE       bBC;     /* block contents byte */
01545   CK_BYTE_PTR   pX;      /* extra data */
01546   CK_ULONG      ulXLen;  /* length of extra data in bytes */
01547 } CK_KEY_WRAP_SET_OAEP_PARAMS;
01548 
01549 typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR \
01550   CK_KEY_WRAP_SET_OAEP_PARAMS_PTR;
01551 
01552 
01553 typedef struct CK_SSL3_RANDOM_DATA {
01554   CK_BYTE_PTR  pClientRandom;
01555   CK_ULONG     ulClientRandomLen;
01556   CK_BYTE_PTR  pServerRandom;
01557   CK_ULONG     ulServerRandomLen;
01558 } CK_SSL3_RANDOM_DATA;
01559 
01560 
01561 typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS {
01562   CK_SSL3_RANDOM_DATA RandomInfo;
01563   CK_VERSION_PTR pVersion;
01564 } CK_SSL3_MASTER_KEY_DERIVE_PARAMS;
01565 
01566 typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR \
01567   CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR;
01568 
01569 
01570 typedef struct CK_SSL3_KEY_MAT_OUT {
01571   CK_OBJECT_HANDLE hClientMacSecret;
01572   CK_OBJECT_HANDLE hServerMacSecret;
01573   CK_OBJECT_HANDLE hClientKey;
01574   CK_OBJECT_HANDLE hServerKey;
01575   CK_BYTE_PTR      pIVClient;
01576   CK_BYTE_PTR      pIVServer;
01577 } CK_SSL3_KEY_MAT_OUT;
01578 
01579 typedef CK_SSL3_KEY_MAT_OUT CK_PTR CK_SSL3_KEY_MAT_OUT_PTR;
01580 
01581 
01582 typedef struct CK_SSL3_KEY_MAT_PARAMS {
01583   CK_ULONG                ulMacSizeInBits;
01584   CK_ULONG                ulKeySizeInBits;
01585   CK_ULONG                ulIVSizeInBits;
01586   CK_BBOOL                bIsExport;
01587   CK_SSL3_RANDOM_DATA     RandomInfo;
01588   CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial;
01589 } CK_SSL3_KEY_MAT_PARAMS;
01590 
01591 typedef CK_SSL3_KEY_MAT_PARAMS CK_PTR CK_SSL3_KEY_MAT_PARAMS_PTR;
01592 
01593 /* CK_TLS_PRF_PARAMS is new for version 2.20 */
01594 typedef struct CK_TLS_PRF_PARAMS {
01595   CK_BYTE_PTR  pSeed;
01596   CK_ULONG     ulSeedLen;
01597   CK_BYTE_PTR  pLabel;
01598   CK_ULONG     ulLabelLen;
01599   CK_BYTE_PTR  pOutput;
01600   CK_ULONG_PTR pulOutputLen;
01601 } CK_TLS_PRF_PARAMS;
01602 
01603 typedef CK_TLS_PRF_PARAMS CK_PTR CK_TLS_PRF_PARAMS_PTR;
01604 
01605 /* WTLS is new for version 2.20 */
01606 typedef struct CK_WTLS_RANDOM_DATA {
01607   CK_BYTE_PTR pClientRandom;
01608   CK_ULONG    ulClientRandomLen;
01609   CK_BYTE_PTR pServerRandom;
01610   CK_ULONG    ulServerRandomLen;
01611 } CK_WTLS_RANDOM_DATA;
01612 
01613 typedef CK_WTLS_RANDOM_DATA CK_PTR CK_WTLS_RANDOM_DATA_PTR;
01614 
01615 typedef struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS {
01616   CK_MECHANISM_TYPE   DigestMechanism;
01617   CK_WTLS_RANDOM_DATA RandomInfo;
01618   CK_BYTE_PTR         pVersion;
01619 } CK_WTLS_MASTER_KEY_DERIVE_PARAMS;
01620 
01621 typedef CK_WTLS_MASTER_KEY_DERIVE_PARAMS CK_PTR \
01622   CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR;
01623 
01624 typedef struct CK_WTLS_PRF_PARAMS {
01625   CK_MECHANISM_TYPE DigestMechanism;
01626   CK_BYTE_PTR       pSeed;
01627   CK_ULONG          ulSeedLen;
01628   CK_BYTE_PTR       pLabel;
01629   CK_ULONG          ulLabelLen;
01630   CK_BYTE_PTR       pOutput;
01631   CK_ULONG_PTR      pulOutputLen;
01632 } CK_WTLS_PRF_PARAMS;
01633 
01634 typedef CK_WTLS_PRF_PARAMS CK_PTR CK_WTLS_PRF_PARAMS_PTR;
01635 
01636 typedef struct CK_WTLS_KEY_MAT_OUT {
01637   CK_OBJECT_HANDLE hMacSecret;
01638   CK_OBJECT_HANDLE hKey;
01639   CK_BYTE_PTR      pIV;
01640 } CK_WTLS_KEY_MAT_OUT;
01641 
01642 typedef CK_WTLS_KEY_MAT_OUT CK_PTR CK_WTLS_KEY_MAT_OUT_PTR;
01643 
01644 typedef struct CK_WTLS_KEY_MAT_PARAMS {
01645   CK_MECHANISM_TYPE       DigestMechanism;
01646   CK_ULONG                ulMacSizeInBits;
01647   CK_ULONG                ulKeySizeInBits;
01648   CK_ULONG                ulIVSizeInBits;
01649   CK_ULONG                ulSequenceNumber;
01650   CK_BBOOL                bIsExport;
01651   CK_WTLS_RANDOM_DATA     RandomInfo;
01652   CK_WTLS_KEY_MAT_OUT_PTR pReturnedKeyMaterial;
01653 } CK_WTLS_KEY_MAT_PARAMS;
01654 
01655 typedef CK_WTLS_KEY_MAT_PARAMS CK_PTR CK_WTLS_KEY_MAT_PARAMS_PTR;
01656 
01657 /* CMS is new for version 2.20 */
01658 typedef struct CK_CMS_SIG_PARAMS {
01659   CK_OBJECT_HANDLE      certificateHandle;
01660   CK_MECHANISM_PTR      pSigningMechanism;
01661   CK_MECHANISM_PTR      pDigestMechanism;
01662   CK_UTF8CHAR_PTR       pContentType;
01663   CK_BYTE_PTR           pRequestedAttributes;
01664   CK_ULONG              ulRequestedAttributesLen;
01665   CK_BYTE_PTR           pRequiredAttributes;
01666   CK_ULONG              ulRequiredAttributesLen;
01667 } CK_CMS_SIG_PARAMS;
01668 
01669 typedef CK_CMS_SIG_PARAMS CK_PTR CK_CMS_SIG_PARAMS_PTR;
01670 
01671 typedef struct CK_KEY_DERIVATION_STRING_DATA {
01672   CK_BYTE_PTR pData;
01673   CK_ULONG    ulLen;
01674 } CK_KEY_DERIVATION_STRING_DATA;
01675 
01676 typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR \
01677   CK_KEY_DERIVATION_STRING_DATA_PTR;
01678 
01679 
01680 /* The CK_EXTRACT_PARAMS is used for the
01681  * CKM_EXTRACT_KEY_FROM_KEY mechanism.  It specifies which bit
01682  * of the base key should be used as the first bit of the
01683  * derived key */
01684 /* CK_EXTRACT_PARAMS is new for v2.0 */
01685 typedef CK_ULONG CK_EXTRACT_PARAMS;
01686 
01687 typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR;
01688 
01689 /* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is new for v2.10.
01690  * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to
01691  * indicate the Pseudo-Random Function (PRF) used to generate
01692  * key bits using PKCS #5 PBKDF2. */
01693 typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE;
01694 
01695 typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR;
01696 
01697 /* The following PRFs are defined in PKCS #5 v2.0. */
01698 #define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001
01699 
01700 
01701 /* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is new for v2.10.
01702  * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the
01703  * source of the salt value when deriving a key using PKCS #5
01704  * PBKDF2. */
01705 typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE;
01706 
01707 typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR;
01708 
01709 /* The following salt value sources are defined in PKCS #5 v2.0. */
01710 #define CKZ_SALT_SPECIFIED        0x00000001
01711 
01712 /* CK_PKCS5_PBKD2_PARAMS is new for v2.10.
01713  * CK_PKCS5_PBKD2_PARAMS is a structure that provides the
01714  * parameters to the CKM_PKCS5_PBKD2 mechanism. */
01715 typedef struct CK_PKCS5_PBKD2_PARAMS {
01716         CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE           saltSource;
01717         CK_VOID_PTR                                pSaltSourceData;
01718         CK_ULONG                                   ulSaltSourceDataLen;
01719         CK_ULONG                                   iterations;
01720         CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf;
01721         CK_VOID_PTR                                pPrfData;
01722         CK_ULONG                                   ulPrfDataLen;
01723         CK_UTF8CHAR_PTR                            pPassword;
01724         CK_ULONG_PTR                               ulPasswordLen;
01725 } CK_PKCS5_PBKD2_PARAMS;
01726 
01727 typedef CK_PKCS5_PBKD2_PARAMS CK_PTR CK_PKCS5_PBKD2_PARAMS_PTR;
01728 
01729 /* NSS Specific defines */
01730 
01731 /* defines that have been deprecated in 2.20, but maintained in our
01732  * header file for backward compatibility */
01733 #define CKO_KG_PARAMETERS     CKO_DOMAIN_PARAMETERS
01734 #define CKF_EC_FP             CKF_EC_F_P
01735 /* new in v2.11 deprecated by 2.20 */
01736 #define CKR_KEY_PARAMS_INVALID                0x0000006B
01737 
01738 /* stuff that for historic reasons is in this header file but should have
01739  * been in pkcs11n.h */
01740 #define CKK_INVALID_KEY_TYPE  0xffffffff
01741 
01742 #include "pkcs11n.h"
01743 
01744 /* undo packing */
01745 #include "pkcs11u.h"
01746 
01747 #endif