0N/A/* pkcs11f.h include file for PKCS #11. */
0N/A/* $Revision: 1.4 $ */
0N/A
0N/A/* License to copy and use this software is granted provided that it is
0N/A * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
0N/A * (Cryptoki)" in all material mentioning or referencing this software.
0N/A
0N/A * License is also granted to make and use derivative works provided that
0N/A * such works are identified as "derived from the RSA Security Inc. PKCS #11
0N/A * Cryptographic Token Interface (Cryptoki)" in all material mentioning or
0N/A * referencing the derived work.
0N/A
0N/A * RSA Security Inc. makes no representations concerning either the
0N/A * merchantability of this software or the suitability of this software for
0N/A * any particular purpose. It is provided "as is" without express or implied
0N/A * warranty of any kind.
0N/A */
0N/A
0N/A/* This header file contains pretty much everything about all the */
0N/A/* Cryptoki function prototypes. Because this information is */
0N/A/* used for more than just declaring function prototypes, the */
0N/A/* order of the functions appearing herein is important, and */
0N/A/* should not be altered. */
0N/A
0N/A/* General-purpose */
0N/A
0N/A/* C_Initialize initializes the Cryptoki library. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Initialize)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets
0N/A * cast to CK_C_INITIALIZE_ARGS_PTR
0N/A * and dereferenced */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Finalize indicates that an application is done with the
0N/A * Cryptoki library. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Finalize)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetInfo returns general information about Cryptoki. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetInfo)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_INFO_PTR pInfo /* location that receives information */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetFunctionList returns the function list. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetFunctionList)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to
0N/A * function list */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Slot and token management */
0N/A
0N/A/* C_GetSlotList obtains a list of slots in the system. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetSlotList)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_BBOOL tokenPresent, /* only slots with tokens? */
0N/A CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */
0N/A CK_ULONG_PTR pulCount /* receives number of slots */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetSlotInfo obtains information about a particular slot in
0N/A * the system. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetSlotInfo)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SLOT_ID slotID, /* the ID of the slot */
0N/A CK_SLOT_INFO_PTR pInfo /* receives the slot information */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetTokenInfo obtains information about a particular token
0N/A * in the system. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetTokenInfo)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SLOT_ID slotID, /* ID of the token's slot */
0N/A CK_TOKEN_INFO_PTR pInfo /* receives the token information */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetMechanismList obtains a list of mechanism types
0N/A * supported by a token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetMechanismList)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SLOT_ID slotID, /* ID of token's slot */
0N/A CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */
0N/A CK_ULONG_PTR pulCount /* gets # of mechs. */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetMechanismInfo obtains information about a particular
0N/A * mechanism possibly supported by a token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SLOT_ID slotID, /* ID of the token's slot */
0N/A CK_MECHANISM_TYPE type, /* type of mechanism */
0N/A CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_InitToken initializes a token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_InitToken)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A/* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */
0N/A(
0N/A CK_SLOT_ID slotID, /* ID of the token's slot */
0N/A CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */
0N/A CK_ULONG ulPinLen, /* length in bytes of the PIN */
0N/A CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_InitPIN initializes the normal user's PIN. */
0N/ACK_PKCS11_FUNCTION_INFO(C_InitPIN)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */
0N/A CK_ULONG ulPinLen /* length in bytes of the PIN */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SetPIN modifies the PIN of the user who is logged in. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SetPIN)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_UTF8CHAR_PTR pOldPin, /* the old PIN */
0N/A CK_ULONG ulOldLen, /* length of the old PIN */
0N/A CK_UTF8CHAR_PTR pNewPin, /* the new PIN */
0N/A CK_ULONG ulNewLen /* length of the new PIN */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Session management */
0N/A
0N/A/* C_OpenSession opens a session between an application and a
0N/A * token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_OpenSession)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SLOT_ID slotID, /* the slot's ID */
0N/A CK_FLAGS flags, /* from CK_SESSION_INFO */
0N/A CK_VOID_PTR pApplication, /* passed to callback */
0N/A CK_NOTIFY Notify, /* callback function */
0N/A CK_SESSION_HANDLE_PTR phSession /* gets session handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_CloseSession closes a session between an application and a
0N/A * token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_CloseSession)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession /* the session's handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_CloseAllSessions closes all sessions with a token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_CloseAllSessions)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SLOT_ID slotID /* the token's slot */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetSessionInfo obtains information about the session. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetSessionInfo)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_SESSION_INFO_PTR pInfo /* receives session info */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetOperationState obtains the state of the cryptographic operation
0N/A * in a session. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetOperationState)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pOperationState, /* gets state */
0N/A CK_ULONG_PTR pulOperationStateLen /* gets state length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SetOperationState restores the state of the cryptographic
0N/A * operation in a session. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SetOperationState)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pOperationState, /* holds state */
0N/A CK_ULONG ulOperationStateLen, /* holds state length */
0N/A CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */
0N/A CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Login logs a user into a token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Login)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_USER_TYPE userType, /* the user type */
0N/A CK_UTF8CHAR_PTR pPin, /* the user's PIN */
0N/A CK_ULONG ulPinLen /* the length of the PIN */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Logout logs a user out from a token. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Logout)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession /* the session's handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Object management */
0N/A
0N/A/* C_CreateObject creates a new object. */
0N/ACK_PKCS11_FUNCTION_INFO(C_CreateObject)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* the object's template */
0N/A CK_ULONG ulCount, /* attributes in template */
0N/A CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_CopyObject copies an object, creating a new object for the
0N/A * copy. */
0N/ACK_PKCS11_FUNCTION_INFO(C_CopyObject)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_OBJECT_HANDLE hObject, /* the object's handle */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* template for new object */
0N/A CK_ULONG ulCount, /* attributes in template */
0N/A CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DestroyObject destroys an object. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DestroyObject)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_OBJECT_HANDLE hObject /* the object's handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetObjectSize gets the size of an object in bytes. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetObjectSize)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_OBJECT_HANDLE hObject, /* the object's handle */
0N/A CK_ULONG_PTR pulSize /* receives size of object */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GetAttributeValue obtains the value of one or more object
0N/A * attributes. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetAttributeValue)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_OBJECT_HANDLE hObject, /* the object's handle */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */
0N/A CK_ULONG ulCount /* attributes in template */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SetAttributeValue modifies the value of one or more object
0N/A * attributes */
0N/ACK_PKCS11_FUNCTION_INFO(C_SetAttributeValue)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_OBJECT_HANDLE hObject, /* the object's handle */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */
0N/A CK_ULONG ulCount /* attributes in template */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_FindObjectsInit initializes a search for token and session
0N/A * objects that match a template. */
0N/ACK_PKCS11_FUNCTION_INFO(C_FindObjectsInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */
0N/A CK_ULONG ulCount /* attrs in search template */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_FindObjects continues a search for token and session
0N/A * objects that match a template, obtaining additional object
0N/A * handles. */
0N/ACK_PKCS11_FUNCTION_INFO(C_FindObjects)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */
0N/A CK_ULONG ulMaxObjectCount, /* max handles to get */
0N/A CK_ULONG_PTR pulObjectCount /* actual # returned */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_FindObjectsFinal finishes a search for token and session
0N/A * objects. */
0N/ACK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession /* the session's handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Encryption and decryption */
0N/A
0N/A/* C_EncryptInit initializes an encryption operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_EncryptInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */
0N/A CK_OBJECT_HANDLE hKey /* handle of encryption key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Encrypt encrypts single-part data. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Encrypt)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pData, /* the plaintext data */
0N/A CK_ULONG ulDataLen, /* bytes of plaintext */
0N/A CK_BYTE_PTR pEncryptedData, /* gets ciphertext */
0N/A CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_EncryptUpdate continues a multiple-part encryption
0N/A * operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_EncryptUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pPart, /* the plaintext data */
0N/A CK_ULONG ulPartLen, /* plaintext data len */
0N/A CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
0N/A CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_EncryptFinal finishes a multiple-part encryption
0N/A * operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_EncryptFinal)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session handle */
0N/A CK_BYTE_PTR pLastEncryptedPart, /* last c-text */
0N/A CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DecryptInit initializes a decryption operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DecryptInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */
0N/A CK_OBJECT_HANDLE hKey /* handle of decryption key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Decrypt decrypts encrypted data in a single part. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Decrypt)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pEncryptedData, /* ciphertext */
0N/A CK_ULONG ulEncryptedDataLen, /* ciphertext length */
0N/A CK_BYTE_PTR pData, /* gets plaintext */
0N/A CK_ULONG_PTR pulDataLen /* gets p-text size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DecryptUpdate continues a multiple-part decryption
0N/A * operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DecryptUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pEncryptedPart, /* encrypted data */
0N/A CK_ULONG ulEncryptedPartLen, /* input length */
0N/A CK_BYTE_PTR pPart, /* gets plaintext */
0N/A CK_ULONG_PTR pulPartLen /* p-text size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DecryptFinal finishes a multiple-part decryption
0N/A * operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DecryptFinal)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pLastPart, /* gets plaintext */
0N/A CK_ULONG_PTR pulLastPartLen /* p-text size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Message digesting */
0N/A
0N/A/* C_DigestInit initializes a message-digesting operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DigestInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism /* the digesting mechanism */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Digest digests data in a single part. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Digest)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pData, /* data to be digested */
0N/A CK_ULONG ulDataLen, /* bytes of data to digest */
0N/A CK_BYTE_PTR pDigest, /* gets the message digest */
0N/A CK_ULONG_PTR pulDigestLen /* gets digest length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DigestUpdate continues a multiple-part message-digesting
0N/A * operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DigestUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pPart, /* data to be digested */
0N/A CK_ULONG ulPartLen /* bytes of data to be digested */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DigestKey continues a multi-part message-digesting
0N/A * operation, by digesting the value of a secret key as part of
0N/A * the data already digested. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DigestKey)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_OBJECT_HANDLE hKey /* secret key to digest */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DigestFinal finishes a multiple-part message-digesting
0N/A * operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DigestFinal)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pDigest, /* gets the message digest */
0N/A CK_ULONG_PTR pulDigestLen /* gets byte count of digest */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Signing and MACing */
0N/A
0N/A/* C_SignInit initializes a signature (private key encryption)
0N/A * operation, where the signature is (will be) an appendix to
0N/A * the data, and plaintext cannot be recovered from the
0N/A *signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SignInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the signature mechanism */
0N/A CK_OBJECT_HANDLE hKey /* handle of signature key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Sign signs (encrypts with private key) data in a single
0N/A * part, where the signature is (will be) an appendix to the
0N/A * data, and plaintext cannot be recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Sign)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pData, /* the data to sign */
0N/A CK_ULONG ulDataLen, /* count of bytes to sign */
0N/A CK_BYTE_PTR pSignature, /* gets the signature */
0N/A CK_ULONG_PTR pulSignatureLen /* gets signature length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SignUpdate continues a multiple-part signature operation,
0N/A * where the signature is (will be) an appendix to the data,
0N/A * and plaintext cannot be recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SignUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pPart, /* the data to sign */
0N/A CK_ULONG ulPartLen /* count of bytes to sign */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SignFinal finishes a multiple-part signature operation,
0N/A * returning the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SignFinal)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pSignature, /* gets the signature */
0N/A CK_ULONG_PTR pulSignatureLen /* gets signature length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SignRecoverInit initializes a signature operation, where
0N/A * the data can be recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SignRecoverInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the signature mechanism */
0N/A CK_OBJECT_HANDLE hKey /* handle of the signature key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SignRecover signs data in a single operation, where the
0N/A * data can be recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SignRecover)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pData, /* the data to sign */
0N/A CK_ULONG ulDataLen, /* count of bytes to sign */
0N/A CK_BYTE_PTR pSignature, /* gets the signature */
0N/A CK_ULONG_PTR pulSignatureLen /* gets signature length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Verifying signatures and MACs */
0N/A
0N/A/* C_VerifyInit initializes a verification operation, where the
0N/A * signature is an appendix to the data, and plaintext cannot
0N/A * cannot be recovered from the signature (e.g. DSA). */
0N/ACK_PKCS11_FUNCTION_INFO(C_VerifyInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
0N/A CK_OBJECT_HANDLE hKey /* verification key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_Verify verifies a signature in a single-part operation,
0N/A * where the signature is an appendix to the data, and plaintext
0N/A * cannot be recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_Verify)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pData, /* signed data */
0N/A CK_ULONG ulDataLen, /* length of signed data */
0N/A CK_BYTE_PTR pSignature, /* signature */
0N/A CK_ULONG ulSignatureLen /* signature length*/
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_VerifyUpdate continues a multiple-part verification
0N/A * operation, where the signature is an appendix to the data,
0N/A * and plaintext cannot be recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_VerifyUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pPart, /* signed data */
0N/A CK_ULONG ulPartLen /* length of signed data */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_VerifyFinal finishes a multiple-part verification
0N/A * operation, checking the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_VerifyFinal)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pSignature, /* signature to verify */
0N/A CK_ULONG ulSignatureLen /* signature length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_VerifyRecoverInit initializes a signature verification
0N/A * operation, where the data is recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
0N/A CK_OBJECT_HANDLE hKey /* verification key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_VerifyRecover verifies a signature in a single-part
0N/A * operation, where the data is recovered from the signature. */
0N/ACK_PKCS11_FUNCTION_INFO(C_VerifyRecover)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pSignature, /* signature to verify */
0N/A CK_ULONG ulSignatureLen, /* signature length */
0N/A CK_BYTE_PTR pData, /* gets signed data */
0N/A CK_ULONG_PTR pulDataLen /* gets signed data len */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Dual-function cryptographic operations */
0N/A
0N/A/* C_DigestEncryptUpdate continues a multiple-part digesting
0N/A * and encryption operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pPart, /* the plaintext data */
0N/A CK_ULONG ulPartLen, /* plaintext length */
0N/A CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
0N/A CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DecryptDigestUpdate continues a multiple-part decryption and
0N/A * digesting operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pEncryptedPart, /* ciphertext */
0N/A CK_ULONG ulEncryptedPartLen, /* ciphertext length */
0N/A CK_BYTE_PTR pPart, /* gets plaintext */
0N/A CK_ULONG_PTR pulPartLen /* gets plaintext len */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_SignEncryptUpdate continues a multiple-part signing and
0N/A * encryption operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pPart, /* the plaintext data */
0N/A CK_ULONG ulPartLen, /* plaintext length */
0N/A CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
0N/A CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DecryptVerifyUpdate continues a multiple-part decryption and
0N/A * verify operation. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_BYTE_PTR pEncryptedPart, /* ciphertext */
0N/A CK_ULONG ulEncryptedPartLen, /* ciphertext length */
0N/A CK_BYTE_PTR pPart, /* gets plaintext */
0N/A CK_ULONG_PTR pulPartLen /* gets p-text length */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Key management */
0N/A
0N/A/* C_GenerateKey generates a secret key, creating a new key
0N/A * object. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GenerateKey)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* key generation mech. */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* template for new key */
0N/A CK_ULONG ulCount, /* # of attrs in template */
0N/A CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GenerateKeyPair generates a public-key/private-key pair,
0N/A * creating new key objects. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session
0N/A * handle */
0N/A CK_MECHANISM_PTR pMechanism, /* key-gen
0N/A * mech. */
0N/A CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template
0N/A * for pub.
0N/A * key */
0N/A CK_ULONG ulPublicKeyAttributeCount, /* # pub.
0N/A * attrs. */
0N/A CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template
0N/A * for priv.
0N/A * key */
0N/A CK_ULONG ulPrivateKeyAttributeCount, /* # priv.
0N/A * attrs. */
0N/A CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub.
0N/A * key
0N/A * handle */
0N/A CK_OBJECT_HANDLE_PTR phPrivateKey /* gets
0N/A * priv. key
0N/A * handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_WrapKey wraps (i.e., encrypts) a key. */
0N/ACK_PKCS11_FUNCTION_INFO(C_WrapKey)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */
0N/A CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */
0N/A CK_OBJECT_HANDLE hKey, /* key to be wrapped */
0N/A CK_BYTE_PTR pWrappedKey, /* gets wrapped key */
0N/A CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new
0N/A * key object. */
0N/ACK_PKCS11_FUNCTION_INFO(C_UnwrapKey)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */
0N/A CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */
0N/A CK_BYTE_PTR pWrappedKey, /* the wrapped key */
0N/A CK_ULONG ulWrappedKeyLen, /* wrapped key len */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* new key template */
0N/A CK_ULONG ulAttributeCount, /* template length */
0N/A CK_OBJECT_HANDLE_PTR phKey /* gets new handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_DeriveKey derives a key from a base key, creating a new key
0N/A * object. */
0N/ACK_PKCS11_FUNCTION_INFO(C_DeriveKey)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* session's handle */
0N/A CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */
0N/A CK_OBJECT_HANDLE hBaseKey, /* base key */
0N/A CK_ATTRIBUTE_PTR pTemplate, /* new key template */
0N/A CK_ULONG ulAttributeCount, /* template length */
0N/A CK_OBJECT_HANDLE_PTR phKey /* gets new handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Random number generation */
0N/A
0N/A/* C_SeedRandom mixes additional seed material into the token's
0N/A * random number generator. */
0N/ACK_PKCS11_FUNCTION_INFO(C_SeedRandom)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR pSeed, /* the seed material */
0N/A CK_ULONG ulSeedLen /* length of seed material */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_GenerateRandom generates random data. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GenerateRandom)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession, /* the session's handle */
0N/A CK_BYTE_PTR RandomData, /* receives the random data */
0N/A CK_ULONG ulRandomLen /* # of bytes to generate */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Parallel function management */
0N/A
0N/A/* C_GetFunctionStatus is a legacy function; it obtains an
0N/A * updated status of a function running in parallel with an
0N/A * application. */
0N/ACK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession /* the session's handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A/* C_CancelFunction is a legacy function; it cancels a function
0N/A * running in parallel. */
0N/ACK_PKCS11_FUNCTION_INFO(C_CancelFunction)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_SESSION_HANDLE hSession /* the session's handle */
0N/A);
0N/A#endif
0N/A
0N/A
0N/A
0N/A/* Functions added in for Cryptoki Version 2.01 or later */
0N/A
0N/A/* C_WaitForSlotEvent waits for a slot event (token insertion,
0N/A * removal, etc.) to occur. */
0N/ACK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent)
0N/A#ifdef CK_NEED_ARG_LIST
0N/A(
0N/A CK_FLAGS flags, /* blocking/nonblocking flag */
0N/A CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */
0N/A CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */
0N/A);
0N/A#endif