pkcs11f.h

Go to the documentation of this file.
00001 /* pkcs11f.h include file for PKCS #11. */
00002 /* $Revision: 1.2 $ */
00003 
00004 /* License to copy and use this software is granted provided that it is
00005  * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
00006  * (Cryptoki)" in all material mentioning or referencing this software.
00007 
00008  * License is also granted to make and use derivative works provided that
00009  * such works are identified as "derived from the RSA Security Inc. PKCS #11
00010  * Cryptographic Token Interface (Cryptoki)" in all material mentioning or 
00011  * referencing the derived work.
00012 
00013  * RSA Security Inc. makes no representations concerning either the 
00014  * merchantability of this software or the suitability of this software for
00015  * any particular purpose. It is provided "as is" without express or implied
00016  * warranty of any kind.
00017  */
00018 
00019 /* This header file contains pretty much everything about all the */
00020 /* Cryptoki function prototypes.  Because this information is */
00021 /* used for more than just declaring function prototypes, the */
00022 /* order of the functions appearing herein is important, and */
00023 /* should not be altered. */
00024 
00025 /* General-purpose */
00026 
00027 /* C_Initialize initializes the Cryptoki library. */
00028 CK_PKCS11_FUNCTION_INFO(C_Initialize)
00029 #ifdef CK_NEED_ARG_LIST
00030 (
00031   CK_VOID_PTR   pInitArgs  /* if this is not NULL_PTR, it gets
00032                             * cast to CK_C_INITIALIZE_ARGS_PTR
00033                             * and dereferenced */
00034 );
00035 #endif
00036 
00037 
00038 /* C_Finalize indicates that an application is done with the
00039  * Cryptoki library. */
00040 CK_PKCS11_FUNCTION_INFO(C_Finalize)
00041 #ifdef CK_NEED_ARG_LIST
00042 (
00043   CK_VOID_PTR   pReserved  /* reserved.  Should be NULL_PTR */
00044 );
00045 #endif
00046 
00047 
00048 /* C_GetInfo returns general information about Cryptoki. */
00049 CK_PKCS11_FUNCTION_INFO(C_GetInfo)
00050 #ifdef CK_NEED_ARG_LIST
00051 (
00052   CK_INFO_PTR   pInfo  /* location that receives information */
00053 );
00054 #endif
00055 
00056 
00057 /* C_GetFunctionList returns the function list. */
00058 CK_PKCS11_FUNCTION_INFO(C_GetFunctionList)
00059 #ifdef CK_NEED_ARG_LIST
00060 (
00061   CK_FUNCTION_LIST_PTR_PTR ppFunctionList  /* receives pointer to
00062                                             * function list */
00063 );
00064 #endif
00065 
00066 
00067 
00068 /* Slot and token management */
00069 
00070 /* C_GetSlotList obtains a list of slots in the system. */
00071 CK_PKCS11_FUNCTION_INFO(C_GetSlotList)
00072 #ifdef CK_NEED_ARG_LIST
00073 (
00074   CK_BBOOL       tokenPresent,  /* only slots with tokens? */
00075   CK_SLOT_ID_PTR pSlotList,     /* receives array of slot IDs */
00076   CK_ULONG_PTR   pulCount       /* receives number of slots */
00077 );
00078 #endif
00079 
00080 
00081 /* C_GetSlotInfo obtains information about a particular slot in
00082  * the system. */
00083 CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo)
00084 #ifdef CK_NEED_ARG_LIST
00085 (
00086   CK_SLOT_ID       slotID,  /* the ID of the slot */
00087   CK_SLOT_INFO_PTR pInfo    /* receives the slot information */
00088 );
00089 #endif
00090 
00091 
00092 /* C_GetTokenInfo obtains information about a particular token
00093  * in the system. */
00094 CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo)
00095 #ifdef CK_NEED_ARG_LIST
00096 (
00097   CK_SLOT_ID        slotID,  /* ID of the token's slot */
00098   CK_TOKEN_INFO_PTR pInfo    /* receives the token information */
00099 );
00100 #endif
00101 
00102 
00103 /* C_GetMechanismList obtains a list of mechanism types
00104  * supported by a token. */
00105 CK_PKCS11_FUNCTION_INFO(C_GetMechanismList)
00106 #ifdef CK_NEED_ARG_LIST
00107 (
00108   CK_SLOT_ID            slotID,          /* ID of token's slot */
00109   CK_MECHANISM_TYPE_PTR pMechanismList,  /* gets mech. array */
00110   CK_ULONG_PTR          pulCount         /* gets # of mechs. */
00111 );
00112 #endif
00113 
00114 
00115 /* C_GetMechanismInfo obtains information about a particular
00116  * mechanism possibly supported by a token. */
00117 CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo)
00118 #ifdef CK_NEED_ARG_LIST
00119 (
00120   CK_SLOT_ID            slotID,  /* ID of the token's slot */
00121   CK_MECHANISM_TYPE     type,    /* type of mechanism */
00122   CK_MECHANISM_INFO_PTR pInfo    /* receives mechanism info */
00123 );
00124 #endif
00125 
00126 
00127 /* C_InitToken initializes a token. */
00128 CK_PKCS11_FUNCTION_INFO(C_InitToken)
00129 #ifdef CK_NEED_ARG_LIST
00130 /* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */
00131 (
00132   CK_SLOT_ID      slotID,    /* ID of the token's slot */
00133   CK_UTF8CHAR_PTR pPin,      /* the SO's initial PIN */
00134   CK_ULONG        ulPinLen,  /* length in bytes of the PIN */
00135   CK_UTF8CHAR_PTR pLabel     /* 32-byte token label (blank padded) */
00136 );
00137 #endif
00138 
00139 
00140 /* C_InitPIN initializes the normal user's PIN. */
00141 CK_PKCS11_FUNCTION_INFO(C_InitPIN)
00142 #ifdef CK_NEED_ARG_LIST
00143 (
00144   CK_SESSION_HANDLE hSession,  /* the session's handle */
00145   CK_UTF8CHAR_PTR   pPin,      /* the normal user's PIN */
00146   CK_ULONG          ulPinLen   /* length in bytes of the PIN */
00147 );
00148 #endif
00149 
00150 
00151 /* C_SetPIN modifies the PIN of the user who is logged in. */
00152 CK_PKCS11_FUNCTION_INFO(C_SetPIN)
00153 #ifdef CK_NEED_ARG_LIST
00154 (
00155   CK_SESSION_HANDLE hSession,  /* the session's handle */
00156   CK_UTF8CHAR_PTR   pOldPin,   /* the old PIN */
00157   CK_ULONG          ulOldLen,  /* length of the old PIN */
00158   CK_UTF8CHAR_PTR   pNewPin,   /* the new PIN */
00159   CK_ULONG          ulNewLen   /* length of the new PIN */
00160 );
00161 #endif
00162 
00163 
00164 
00165 /* Session management */
00166 
00167 /* C_OpenSession opens a session between an application and a
00168  * token. */
00169 CK_PKCS11_FUNCTION_INFO(C_OpenSession)
00170 #ifdef CK_NEED_ARG_LIST
00171 (
00172   CK_SLOT_ID            slotID,        /* the slot's ID */
00173   CK_FLAGS              flags,         /* from CK_SESSION_INFO */
00174   CK_VOID_PTR           pApplication,  /* passed to callback */
00175   CK_NOTIFY             Notify,        /* callback function */
00176   CK_SESSION_HANDLE_PTR phSession      /* gets session handle */
00177 );
00178 #endif
00179 
00180 
00181 /* C_CloseSession closes a session between an application and a
00182  * token. */
00183 CK_PKCS11_FUNCTION_INFO(C_CloseSession)
00184 #ifdef CK_NEED_ARG_LIST
00185 (
00186   CK_SESSION_HANDLE hSession  /* the session's handle */
00187 );
00188 #endif
00189 
00190 
00191 /* C_CloseAllSessions closes all sessions with a token. */
00192 CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions)
00193 #ifdef CK_NEED_ARG_LIST
00194 (
00195   CK_SLOT_ID     slotID  /* the token's slot */
00196 );
00197 #endif
00198 
00199 
00200 /* C_GetSessionInfo obtains information about the session. */
00201 CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo)
00202 #ifdef CK_NEED_ARG_LIST
00203 (
00204   CK_SESSION_HANDLE   hSession,  /* the session's handle */
00205   CK_SESSION_INFO_PTR pInfo      /* receives session info */
00206 );
00207 #endif
00208 
00209 
00210 /* C_GetOperationState obtains the state of the cryptographic operation
00211  * in a session. */
00212 CK_PKCS11_FUNCTION_INFO(C_GetOperationState)
00213 #ifdef CK_NEED_ARG_LIST
00214 (
00215   CK_SESSION_HANDLE hSession,             /* session's handle */
00216   CK_BYTE_PTR       pOperationState,      /* gets state */
00217   CK_ULONG_PTR      pulOperationStateLen  /* gets state length */
00218 );
00219 #endif
00220 
00221 
00222 /* C_SetOperationState restores the state of the cryptographic
00223  * operation in a session. */
00224 CK_PKCS11_FUNCTION_INFO(C_SetOperationState)
00225 #ifdef CK_NEED_ARG_LIST
00226 (
00227   CK_SESSION_HANDLE hSession,            /* session's handle */
00228   CK_BYTE_PTR      pOperationState,      /* holds state */
00229   CK_ULONG         ulOperationStateLen,  /* holds state length */
00230   CK_OBJECT_HANDLE hEncryptionKey,       /* en/decryption key */
00231   CK_OBJECT_HANDLE hAuthenticationKey    /* sign/verify key */
00232 );
00233 #endif
00234 
00235 
00236 /* C_Login logs a user into a token. */
00237 CK_PKCS11_FUNCTION_INFO(C_Login)
00238 #ifdef CK_NEED_ARG_LIST
00239 (
00240   CK_SESSION_HANDLE hSession,  /* the session's handle */
00241   CK_USER_TYPE      userType,  /* the user type */
00242   CK_UTF8CHAR_PTR   pPin,      /* the user's PIN */
00243   CK_ULONG          ulPinLen   /* the length of the PIN */
00244 );
00245 #endif
00246 
00247 
00248 /* C_Logout logs a user out from a token. */
00249 CK_PKCS11_FUNCTION_INFO(C_Logout)
00250 #ifdef CK_NEED_ARG_LIST
00251 (
00252   CK_SESSION_HANDLE hSession  /* the session's handle */
00253 );
00254 #endif
00255 
00256 
00257 
00258 /* Object management */
00259 
00260 /* C_CreateObject creates a new object. */
00261 CK_PKCS11_FUNCTION_INFO(C_CreateObject)
00262 #ifdef CK_NEED_ARG_LIST
00263 (
00264   CK_SESSION_HANDLE hSession,    /* the session's handle */
00265   CK_ATTRIBUTE_PTR  pTemplate,   /* the object's template */
00266   CK_ULONG          ulCount,     /* attributes in template */
00267   CK_OBJECT_HANDLE_PTR phObject  /* gets new object's handle. */
00268 );
00269 #endif
00270 
00271 
00272 /* C_CopyObject copies an object, creating a new object for the
00273  * copy. */
00274 CK_PKCS11_FUNCTION_INFO(C_CopyObject)
00275 #ifdef CK_NEED_ARG_LIST
00276 (
00277   CK_SESSION_HANDLE    hSession,    /* the session's handle */
00278   CK_OBJECT_HANDLE     hObject,     /* the object's handle */
00279   CK_ATTRIBUTE_PTR     pTemplate,   /* template for new object */
00280   CK_ULONG             ulCount,     /* attributes in template */
00281   CK_OBJECT_HANDLE_PTR phNewObject  /* receives handle of copy */
00282 );
00283 #endif
00284 
00285 
00286 /* C_DestroyObject destroys an object. */
00287 CK_PKCS11_FUNCTION_INFO(C_DestroyObject)
00288 #ifdef CK_NEED_ARG_LIST
00289 (
00290   CK_SESSION_HANDLE hSession,  /* the session's handle */
00291   CK_OBJECT_HANDLE  hObject    /* the object's handle */
00292 );
00293 #endif
00294 
00295 
00296 /* C_GetObjectSize gets the size of an object in bytes. */
00297 CK_PKCS11_FUNCTION_INFO(C_GetObjectSize)
00298 #ifdef CK_NEED_ARG_LIST
00299 (
00300   CK_SESSION_HANDLE hSession,  /* the session's handle */
00301   CK_OBJECT_HANDLE  hObject,   /* the object's handle */
00302   CK_ULONG_PTR      pulSize    /* receives size of object */
00303 );
00304 #endif
00305 
00306 
00307 /* C_GetAttributeValue obtains the value of one or more object
00308  * attributes. */
00309 CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue)
00310 #ifdef CK_NEED_ARG_LIST
00311 (
00312   CK_SESSION_HANDLE hSession,   /* the session's handle */
00313   CK_OBJECT_HANDLE  hObject,    /* the object's handle */
00314   CK_ATTRIBUTE_PTR  pTemplate,  /* specifies attrs; gets vals */
00315   CK_ULONG          ulCount     /* attributes in template */
00316 );
00317 #endif
00318 
00319 
00320 /* C_SetAttributeValue modifies the value of one or more object
00321  * attributes */
00322 CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue)
00323 #ifdef CK_NEED_ARG_LIST
00324 (
00325   CK_SESSION_HANDLE hSession,   /* the session's handle */
00326   CK_OBJECT_HANDLE  hObject,    /* the object's handle */
00327   CK_ATTRIBUTE_PTR  pTemplate,  /* specifies attrs and values */
00328   CK_ULONG          ulCount     /* attributes in template */
00329 );
00330 #endif
00331 
00332 
00333 /* C_FindObjectsInit initializes a search for token and session
00334  * objects that match a template. */
00335 CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit)
00336 #ifdef CK_NEED_ARG_LIST
00337 (
00338   CK_SESSION_HANDLE hSession,   /* the session's handle */
00339   CK_ATTRIBUTE_PTR  pTemplate,  /* attribute values to match */
00340   CK_ULONG          ulCount     /* attrs in search template */
00341 );
00342 #endif
00343 
00344 
00345 /* C_FindObjects continues a search for token and session
00346  * objects that match a template, obtaining additional object
00347  * handles. */
00348 CK_PKCS11_FUNCTION_INFO(C_FindObjects)
00349 #ifdef CK_NEED_ARG_LIST
00350 (
00351  CK_SESSION_HANDLE    hSession,          /* session's handle */
00352  CK_OBJECT_HANDLE_PTR phObject,          /* gets obj. handles */
00353  CK_ULONG             ulMaxObjectCount,  /* max handles to get */
00354  CK_ULONG_PTR         pulObjectCount     /* actual # returned */
00355 );
00356 #endif
00357 
00358 
00359 /* C_FindObjectsFinal finishes a search for token and session
00360  * objects. */
00361 CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal)
00362 #ifdef CK_NEED_ARG_LIST
00363 (
00364   CK_SESSION_HANDLE hSession  /* the session's handle */
00365 );
00366 #endif
00367 
00368 
00369 
00370 /* Encryption and decryption */
00371 
00372 /* C_EncryptInit initializes an encryption operation. */
00373 CK_PKCS11_FUNCTION_INFO(C_EncryptInit)
00374 #ifdef CK_NEED_ARG_LIST
00375 (
00376   CK_SESSION_HANDLE hSession,    /* the session's handle */
00377   CK_MECHANISM_PTR  pMechanism,  /* the encryption mechanism */
00378   CK_OBJECT_HANDLE  hKey         /* handle of encryption key */
00379 );
00380 #endif
00381 
00382 
00383 /* C_Encrypt encrypts single-part data. */
00384 CK_PKCS11_FUNCTION_INFO(C_Encrypt)
00385 #ifdef CK_NEED_ARG_LIST
00386 (
00387   CK_SESSION_HANDLE hSession,            /* session's handle */
00388   CK_BYTE_PTR       pData,               /* the plaintext data */
00389   CK_ULONG          ulDataLen,           /* bytes of plaintext */
00390   CK_BYTE_PTR       pEncryptedData,      /* gets ciphertext */
00391   CK_ULONG_PTR      pulEncryptedDataLen  /* gets c-text size */
00392 );
00393 #endif
00394 
00395 
00396 /* C_EncryptUpdate continues a multiple-part encryption
00397  * operation. */
00398 CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate)
00399 #ifdef CK_NEED_ARG_LIST
00400 (
00401   CK_SESSION_HANDLE hSession,           /* session's handle */
00402   CK_BYTE_PTR       pPart,              /* the plaintext data */
00403   CK_ULONG          ulPartLen,          /* plaintext data len */
00404   CK_BYTE_PTR       pEncryptedPart,     /* gets ciphertext */
00405   CK_ULONG_PTR      pulEncryptedPartLen /* gets c-text size */
00406 );
00407 #endif
00408 
00409 
00410 /* C_EncryptFinal finishes a multiple-part encryption
00411  * operation. */
00412 CK_PKCS11_FUNCTION_INFO(C_EncryptFinal)
00413 #ifdef CK_NEED_ARG_LIST
00414 (
00415   CK_SESSION_HANDLE hSession,                /* session handle */
00416   CK_BYTE_PTR       pLastEncryptedPart,      /* last c-text */
00417   CK_ULONG_PTR      pulLastEncryptedPartLen  /* gets last size */
00418 );
00419 #endif
00420 
00421 
00422 /* C_DecryptInit initializes a decryption operation. */
00423 CK_PKCS11_FUNCTION_INFO(C_DecryptInit)
00424 #ifdef CK_NEED_ARG_LIST
00425 (
00426   CK_SESSION_HANDLE hSession,    /* the session's handle */
00427   CK_MECHANISM_PTR  pMechanism,  /* the decryption mechanism */
00428   CK_OBJECT_HANDLE  hKey         /* handle of decryption key */
00429 );
00430 #endif
00431 
00432 
00433 /* C_Decrypt decrypts encrypted data in a single part. */
00434 CK_PKCS11_FUNCTION_INFO(C_Decrypt)
00435 #ifdef CK_NEED_ARG_LIST
00436 (
00437   CK_SESSION_HANDLE hSession,           /* session's handle */
00438   CK_BYTE_PTR       pEncryptedData,     /* ciphertext */
00439   CK_ULONG          ulEncryptedDataLen, /* ciphertext length */
00440   CK_BYTE_PTR       pData,              /* gets plaintext */
00441   CK_ULONG_PTR      pulDataLen          /* gets p-text size */
00442 );
00443 #endif
00444 
00445 
00446 /* C_DecryptUpdate continues a multiple-part decryption
00447  * operation. */
00448 CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate)
00449 #ifdef CK_NEED_ARG_LIST
00450 (
00451   CK_SESSION_HANDLE hSession,            /* session's handle */
00452   CK_BYTE_PTR       pEncryptedPart,      /* encrypted data */
00453   CK_ULONG          ulEncryptedPartLen,  /* input length */
00454   CK_BYTE_PTR       pPart,               /* gets plaintext */
00455   CK_ULONG_PTR      pulPartLen           /* p-text size */
00456 );
00457 #endif
00458 
00459 
00460 /* C_DecryptFinal finishes a multiple-part decryption
00461  * operation. */
00462 CK_PKCS11_FUNCTION_INFO(C_DecryptFinal)
00463 #ifdef CK_NEED_ARG_LIST
00464 (
00465   CK_SESSION_HANDLE hSession,       /* the session's handle */
00466   CK_BYTE_PTR       pLastPart,      /* gets plaintext */
00467   CK_ULONG_PTR      pulLastPartLen  /* p-text size */
00468 );
00469 #endif
00470 
00471 
00472 
00473 /* Message digesting */
00474 
00475 /* C_DigestInit initializes a message-digesting operation. */
00476 CK_PKCS11_FUNCTION_INFO(C_DigestInit)
00477 #ifdef CK_NEED_ARG_LIST
00478 (
00479   CK_SESSION_HANDLE hSession,   /* the session's handle */
00480   CK_MECHANISM_PTR  pMechanism  /* the digesting mechanism */
00481 );
00482 #endif
00483 
00484 
00485 /* C_Digest digests data in a single part. */
00486 CK_PKCS11_FUNCTION_INFO(C_Digest)
00487 #ifdef CK_NEED_ARG_LIST
00488 (
00489   CK_SESSION_HANDLE hSession,     /* the session's handle */
00490   CK_BYTE_PTR       pData,        /* data to be digested */
00491   CK_ULONG          ulDataLen,    /* bytes of data to digest */
00492   CK_BYTE_PTR       pDigest,      /* gets the message digest */
00493   CK_ULONG_PTR      pulDigestLen  /* gets digest length */
00494 );
00495 #endif
00496 
00497 
00498 /* C_DigestUpdate continues a multiple-part message-digesting
00499  * operation. */
00500 CK_PKCS11_FUNCTION_INFO(C_DigestUpdate)
00501 #ifdef CK_NEED_ARG_LIST
00502 (
00503   CK_SESSION_HANDLE hSession,  /* the session's handle */
00504   CK_BYTE_PTR       pPart,     /* data to be digested */
00505   CK_ULONG          ulPartLen  /* bytes of data to be digested */
00506 );
00507 #endif
00508 
00509 
00510 /* C_DigestKey continues a multi-part message-digesting
00511  * operation, by digesting the value of a secret key as part of
00512  * the data already digested. */
00513 CK_PKCS11_FUNCTION_INFO(C_DigestKey)
00514 #ifdef CK_NEED_ARG_LIST
00515 (
00516   CK_SESSION_HANDLE hSession,  /* the session's handle */
00517   CK_OBJECT_HANDLE  hKey       /* secret key to digest */
00518 );
00519 #endif
00520 
00521 
00522 /* C_DigestFinal finishes a multiple-part message-digesting
00523  * operation. */
00524 CK_PKCS11_FUNCTION_INFO(C_DigestFinal)
00525 #ifdef CK_NEED_ARG_LIST
00526 (
00527   CK_SESSION_HANDLE hSession,     /* the session's handle */
00528   CK_BYTE_PTR       pDigest,      /* gets the message digest */
00529   CK_ULONG_PTR      pulDigestLen  /* gets byte count of digest */
00530 );
00531 #endif
00532 
00533 
00534 
00535 /* Signing and MACing */
00536 
00537 /* C_SignInit initializes a signature (private key encryption)
00538  * operation, where the signature is (will be) an appendix to
00539  * the data, and plaintext cannot be recovered from the
00540  *signature. */
00541 CK_PKCS11_FUNCTION_INFO(C_SignInit)
00542 #ifdef CK_NEED_ARG_LIST
00543 (
00544   CK_SESSION_HANDLE hSession,    /* the session's handle */
00545   CK_MECHANISM_PTR  pMechanism,  /* the signature mechanism */
00546   CK_OBJECT_HANDLE  hKey         /* handle of signature key */
00547 );
00548 #endif
00549 
00550 
00551 /* C_Sign signs (encrypts with private key) data in a single
00552  * part, where the signature is (will be) an appendix to the
00553  * data, and plaintext cannot be recovered from the signature. */
00554 CK_PKCS11_FUNCTION_INFO(C_Sign)
00555 #ifdef CK_NEED_ARG_LIST
00556 (
00557   CK_SESSION_HANDLE hSession,        /* the session's handle */
00558   CK_BYTE_PTR       pData,           /* the data to sign */
00559   CK_ULONG          ulDataLen,       /* count of bytes to sign */
00560   CK_BYTE_PTR       pSignature,      /* gets the signature */
00561   CK_ULONG_PTR      pulSignatureLen  /* gets signature length */
00562 );
00563 #endif
00564 
00565 
00566 /* C_SignUpdate continues a multiple-part signature operation,
00567  * where the signature is (will be) an appendix to the data, 
00568  * and plaintext cannot be recovered from the signature. */
00569 CK_PKCS11_FUNCTION_INFO(C_SignUpdate)
00570 #ifdef CK_NEED_ARG_LIST
00571 (
00572   CK_SESSION_HANDLE hSession,  /* the session's handle */
00573   CK_BYTE_PTR       pPart,     /* the data to sign */
00574   CK_ULONG          ulPartLen  /* count of bytes to sign */
00575 );
00576 #endif
00577 
00578 
00579 /* C_SignFinal finishes a multiple-part signature operation, 
00580  * returning the signature. */
00581 CK_PKCS11_FUNCTION_INFO(C_SignFinal)
00582 #ifdef CK_NEED_ARG_LIST
00583 (
00584   CK_SESSION_HANDLE hSession,        /* the session's handle */
00585   CK_BYTE_PTR       pSignature,      /* gets the signature */
00586   CK_ULONG_PTR      pulSignatureLen  /* gets signature length */
00587 );
00588 #endif
00589 
00590 
00591 /* C_SignRecoverInit initializes a signature operation, where
00592  * the data can be recovered from the signature. */
00593 CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit)
00594 #ifdef CK_NEED_ARG_LIST
00595 (
00596   CK_SESSION_HANDLE hSession,   /* the session's handle */
00597   CK_MECHANISM_PTR  pMechanism, /* the signature mechanism */
00598   CK_OBJECT_HANDLE  hKey        /* handle of the signature key */
00599 );
00600 #endif
00601 
00602 
00603 /* C_SignRecover signs data in a single operation, where the
00604  * data can be recovered from the signature. */
00605 CK_PKCS11_FUNCTION_INFO(C_SignRecover)
00606 #ifdef CK_NEED_ARG_LIST
00607 (
00608   CK_SESSION_HANDLE hSession,        /* the session's handle */
00609   CK_BYTE_PTR       pData,           /* the data to sign */
00610   CK_ULONG          ulDataLen,       /* count of bytes to sign */
00611   CK_BYTE_PTR       pSignature,      /* gets the signature */
00612   CK_ULONG_PTR      pulSignatureLen  /* gets signature length */
00613 );
00614 #endif
00615 
00616 
00617 
00618 /* Verifying signatures and MACs */
00619 
00620 /* C_VerifyInit initializes a verification operation, where the
00621  * signature is an appendix to the data, and plaintext cannot
00622  *  cannot be recovered from the signature (e.g. DSA). */
00623 CK_PKCS11_FUNCTION_INFO(C_VerifyInit)
00624 #ifdef CK_NEED_ARG_LIST
00625 (
00626   CK_SESSION_HANDLE hSession,    /* the session's handle */
00627   CK_MECHANISM_PTR  pMechanism,  /* the verification mechanism */
00628   CK_OBJECT_HANDLE  hKey         /* verification key */ 
00629 );
00630 #endif
00631 
00632 
00633 /* C_Verify verifies a signature in a single-part operation, 
00634  * where the signature is an appendix to the data, and plaintext
00635  * cannot be recovered from the signature. */
00636 CK_PKCS11_FUNCTION_INFO(C_Verify)
00637 #ifdef CK_NEED_ARG_LIST
00638 (
00639   CK_SESSION_HANDLE hSession,       /* the session's handle */
00640   CK_BYTE_PTR       pData,          /* signed data */
00641   CK_ULONG          ulDataLen,      /* length of signed data */
00642   CK_BYTE_PTR       pSignature,     /* signature */
00643   CK_ULONG          ulSignatureLen  /* signature length*/
00644 );
00645 #endif
00646 
00647 
00648 /* C_VerifyUpdate continues a multiple-part verification
00649  * operation, where the signature is an appendix to the data, 
00650  * and plaintext cannot be recovered from the signature. */
00651 CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate)
00652 #ifdef CK_NEED_ARG_LIST
00653 (
00654   CK_SESSION_HANDLE hSession,  /* the session's handle */
00655   CK_BYTE_PTR       pPart,     /* signed data */
00656   CK_ULONG          ulPartLen  /* length of signed data */
00657 );
00658 #endif
00659 
00660 
00661 /* C_VerifyFinal finishes a multiple-part verification
00662  * operation, checking the signature. */
00663 CK_PKCS11_FUNCTION_INFO(C_VerifyFinal)
00664 #ifdef CK_NEED_ARG_LIST
00665 (
00666   CK_SESSION_HANDLE hSession,       /* the session's handle */
00667   CK_BYTE_PTR       pSignature,     /* signature to verify */
00668   CK_ULONG          ulSignatureLen  /* signature length */
00669 );
00670 #endif
00671 
00672 
00673 /* C_VerifyRecoverInit initializes a signature verification
00674  * operation, where the data is recovered from the signature. */
00675 CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit)
00676 #ifdef CK_NEED_ARG_LIST
00677 (
00678   CK_SESSION_HANDLE hSession,    /* the session's handle */
00679   CK_MECHANISM_PTR  pMechanism,  /* the verification mechanism */
00680   CK_OBJECT_HANDLE  hKey         /* verification key */
00681 );
00682 #endif
00683 
00684 
00685 /* C_VerifyRecover verifies a signature in a single-part
00686  * operation, where the data is recovered from the signature. */
00687 CK_PKCS11_FUNCTION_INFO(C_VerifyRecover)
00688 #ifdef CK_NEED_ARG_LIST
00689 (
00690   CK_SESSION_HANDLE hSession,        /* the session's handle */
00691   CK_BYTE_PTR       pSignature,      /* signature to verify */
00692   CK_ULONG          ulSignatureLen,  /* signature length */
00693   CK_BYTE_PTR       pData,           /* gets signed data */
00694   CK_ULONG_PTR      pulDataLen       /* gets signed data len */
00695 );
00696 #endif
00697 
00698 
00699 
00700 /* Dual-function cryptographic operations */
00701 
00702 /* C_DigestEncryptUpdate continues a multiple-part digesting
00703  * and encryption operation. */
00704 CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate)
00705 #ifdef CK_NEED_ARG_LIST
00706 (
00707   CK_SESSION_HANDLE hSession,            /* session's handle */
00708   CK_BYTE_PTR       pPart,               /* the plaintext data */
00709   CK_ULONG          ulPartLen,           /* plaintext length */
00710   CK_BYTE_PTR       pEncryptedPart,      /* gets ciphertext */
00711   CK_ULONG_PTR      pulEncryptedPartLen  /* gets c-text length */
00712 );
00713 #endif
00714 
00715 
00716 /* C_DecryptDigestUpdate continues a multiple-part decryption and
00717  * digesting operation. */
00718 CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate)
00719 #ifdef CK_NEED_ARG_LIST
00720 (
00721   CK_SESSION_HANDLE hSession,            /* session's handle */
00722   CK_BYTE_PTR       pEncryptedPart,      /* ciphertext */
00723   CK_ULONG          ulEncryptedPartLen,  /* ciphertext length */
00724   CK_BYTE_PTR       pPart,               /* gets plaintext */
00725   CK_ULONG_PTR      pulPartLen           /* gets plaintext len */
00726 );
00727 #endif
00728 
00729 
00730 /* C_SignEncryptUpdate continues a multiple-part signing and
00731  * encryption operation. */
00732 CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate)
00733 #ifdef CK_NEED_ARG_LIST
00734 (
00735   CK_SESSION_HANDLE hSession,            /* session's handle */
00736   CK_BYTE_PTR       pPart,               /* the plaintext data */
00737   CK_ULONG          ulPartLen,           /* plaintext length */
00738   CK_BYTE_PTR       pEncryptedPart,      /* gets ciphertext */
00739   CK_ULONG_PTR      pulEncryptedPartLen  /* gets c-text length */
00740 );
00741 #endif
00742 
00743 
00744 /* C_DecryptVerifyUpdate continues a multiple-part decryption and
00745  * verify operation. */
00746 CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate)
00747 #ifdef CK_NEED_ARG_LIST
00748 (
00749   CK_SESSION_HANDLE hSession,            /* session's handle */
00750   CK_BYTE_PTR       pEncryptedPart,      /* ciphertext */
00751   CK_ULONG          ulEncryptedPartLen,  /* ciphertext length */
00752   CK_BYTE_PTR       pPart,               /* gets plaintext */
00753   CK_ULONG_PTR      pulPartLen           /* gets p-text length */
00754 );
00755 #endif
00756 
00757 
00758 
00759 /* Key management */
00760 
00761 /* C_GenerateKey generates a secret key, creating a new key
00762  * object. */
00763 CK_PKCS11_FUNCTION_INFO(C_GenerateKey)
00764 #ifdef CK_NEED_ARG_LIST
00765 (
00766   CK_SESSION_HANDLE    hSession,    /* the session's handle */
00767   CK_MECHANISM_PTR     pMechanism,  /* key generation mech. */
00768   CK_ATTRIBUTE_PTR     pTemplate,   /* template for new key */
00769   CK_ULONG             ulCount,     /* # of attrs in template */
00770   CK_OBJECT_HANDLE_PTR phKey        /* gets handle of new key */
00771 );
00772 #endif
00773 
00774 
00775 /* C_GenerateKeyPair generates a public-key/private-key pair, 
00776  * creating new key objects. */
00777 CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair)
00778 #ifdef CK_NEED_ARG_LIST
00779 (
00780   CK_SESSION_HANDLE    hSession,                    /* session
00781                                                      * handle */
00782   CK_MECHANISM_PTR     pMechanism,                  /* key-gen
00783                                                      * mech. */
00784   CK_ATTRIBUTE_PTR     pPublicKeyTemplate,          /* template
00785                                                      * for pub.
00786                                                      * key */
00787   CK_ULONG             ulPublicKeyAttributeCount,   /* # pub.
00788                                                      * attrs. */
00789   CK_ATTRIBUTE_PTR     pPrivateKeyTemplate,         /* template
00790                                                      * for priv.
00791                                                      * key */
00792   CK_ULONG             ulPrivateKeyAttributeCount,  /* # priv.
00793                                                      * attrs. */
00794   CK_OBJECT_HANDLE_PTR phPublicKey,                 /* gets pub.
00795                                                      * key
00796                                                      * handle */
00797   CK_OBJECT_HANDLE_PTR phPrivateKey                 /* gets
00798                                                      * priv. key
00799                                                      * handle */
00800 );
00801 #endif
00802 
00803 
00804 /* C_WrapKey wraps (i.e., encrypts) a key. */
00805 CK_PKCS11_FUNCTION_INFO(C_WrapKey)
00806 #ifdef CK_NEED_ARG_LIST
00807 (
00808   CK_SESSION_HANDLE hSession,        /* the session's handle */
00809   CK_MECHANISM_PTR  pMechanism,      /* the wrapping mechanism */
00810   CK_OBJECT_HANDLE  hWrappingKey,    /* wrapping key */
00811   CK_OBJECT_HANDLE  hKey,            /* key to be wrapped */
00812   CK_BYTE_PTR       pWrappedKey,     /* gets wrapped key */
00813   CK_ULONG_PTR      pulWrappedKeyLen /* gets wrapped key size */
00814 );
00815 #endif
00816 
00817 
00818 /* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new
00819  * key object. */
00820 CK_PKCS11_FUNCTION_INFO(C_UnwrapKey)
00821 #ifdef CK_NEED_ARG_LIST
00822 (
00823   CK_SESSION_HANDLE    hSession,          /* session's handle */
00824   CK_MECHANISM_PTR     pMechanism,        /* unwrapping mech. */
00825   CK_OBJECT_HANDLE     hUnwrappingKey,    /* unwrapping key */
00826   CK_BYTE_PTR          pWrappedKey,       /* the wrapped key */
00827   CK_ULONG             ulWrappedKeyLen,   /* wrapped key len */
00828   CK_ATTRIBUTE_PTR     pTemplate,         /* new key template */
00829   CK_ULONG             ulAttributeCount,  /* template length */
00830   CK_OBJECT_HANDLE_PTR phKey              /* gets new handle */
00831 );
00832 #endif
00833 
00834 
00835 /* C_DeriveKey derives a key from a base key, creating a new key
00836  * object. */
00837 CK_PKCS11_FUNCTION_INFO(C_DeriveKey)
00838 #ifdef CK_NEED_ARG_LIST
00839 (
00840   CK_SESSION_HANDLE    hSession,          /* session's handle */
00841   CK_MECHANISM_PTR     pMechanism,        /* key deriv. mech. */
00842   CK_OBJECT_HANDLE     hBaseKey,          /* base key */
00843   CK_ATTRIBUTE_PTR     pTemplate,         /* new key template */
00844   CK_ULONG             ulAttributeCount,  /* template length */
00845   CK_OBJECT_HANDLE_PTR phKey              /* gets new handle */
00846 );
00847 #endif
00848 
00849 
00850 
00851 /* Random number generation */
00852 
00853 /* C_SeedRandom mixes additional seed material into the token's
00854  * random number generator. */
00855 CK_PKCS11_FUNCTION_INFO(C_SeedRandom)
00856 #ifdef CK_NEED_ARG_LIST
00857 (
00858   CK_SESSION_HANDLE hSession,  /* the session's handle */
00859   CK_BYTE_PTR       pSeed,     /* the seed material */
00860   CK_ULONG          ulSeedLen  /* length of seed material */
00861 );
00862 #endif
00863 
00864 
00865 /* C_GenerateRandom generates random data. */
00866 CK_PKCS11_FUNCTION_INFO(C_GenerateRandom)
00867 #ifdef CK_NEED_ARG_LIST
00868 (
00869   CK_SESSION_HANDLE hSession,    /* the session's handle */
00870   CK_BYTE_PTR       RandomData,  /* receives the random data */
00871   CK_ULONG          ulRandomLen  /* # of bytes to generate */
00872 );
00873 #endif
00874 
00875 
00876 
00877 /* Parallel function management */
00878 
00879 /* C_GetFunctionStatus is a legacy function; it obtains an
00880  * updated status of a function running in parallel with an
00881  * application. */
00882 CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus)
00883 #ifdef CK_NEED_ARG_LIST
00884 (
00885   CK_SESSION_HANDLE hSession  /* the session's handle */
00886 );
00887 #endif
00888 
00889 
00890 /* C_CancelFunction is a legacy function; it cancels a function
00891  * running in parallel. */
00892 CK_PKCS11_FUNCTION_INFO(C_CancelFunction)
00893 #ifdef CK_NEED_ARG_LIST
00894 (
00895   CK_SESSION_HANDLE hSession  /* the session's handle */
00896 );
00897 #endif
00898 
00899 
00900 
00901 /* Functions added in for Cryptoki Version 2.01 or later */
00902 
00903 /* C_WaitForSlotEvent waits for a slot event (token insertion,
00904  * removal, etc.) to occur. */
00905 CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent)
00906 #ifdef CK_NEED_ARG_LIST
00907 (
00908   CK_FLAGS flags,        /* blocking/nonblocking flag */
00909   CK_SLOT_ID_PTR pSlot,  /* location that receives the slot ID */
00910   CK_VOID_PTR pRserved   /* reserved.  Should be NULL_PTR */
00911 );
00912 #endif

Generated on Tue Apr 28 17:41:04 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha