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