1 /* pkcs11f.h include file for PKCS #11. */
\r
2 /* $Revision: 1.4 $ */
\r
4 /* License to copy and use this software is granted provided that it is
\r
5 * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
\r
6 * (Cryptoki)" in all material mentioning or referencing this software.
\r
8 * License is also granted to make and use derivative works provided that
\r
9 * such works are identified as "derived from the RSA Security Inc. PKCS #11
\r
10 * Cryptographic Token Interface (Cryptoki)" in all material mentioning or
\r
11 * referencing the derived work.
\r
13 * RSA Security Inc. makes no representations concerning either the
\r
14 * merchantability of this software or the suitability of this software for
\r
15 * any particular purpose. It is provided "as is" without express or implied
\r
16 * warranty of any kind.
\r
19 /* This header file contains pretty much everything about all the */
\r
20 /* Cryptoki function prototypes. Because this information is */
\r
21 /* used for more than just declaring function prototypes, the */
\r
22 /* order of the functions appearing herein is important, and */
\r
23 /* should not be altered. */
\r
25 /* General-purpose */
\r
27 /* C_Initialize initializes the Cryptoki library. */
\r
28 CK_PKCS11_FUNCTION_INFO(C_Initialize)
\r
29 #ifdef CK_NEED_ARG_LIST
\r
31 CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets
\r
32 * cast to CK_C_INITIALIZE_ARGS_PTR
\r
33 * and dereferenced */
\r
38 /* C_Finalize indicates that an application is done with the
\r
39 * Cryptoki library. */
\r
40 CK_PKCS11_FUNCTION_INFO(C_Finalize)
\r
41 #ifdef CK_NEED_ARG_LIST
\r
43 CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */
\r
48 /* C_GetInfo returns general information about Cryptoki. */
\r
49 CK_PKCS11_FUNCTION_INFO(C_GetInfo)
\r
50 #ifdef CK_NEED_ARG_LIST
\r
52 CK_INFO_PTR pInfo /* location that receives information */
\r
57 /* C_GetFunctionList returns the function list. */
\r
58 CK_PKCS11_FUNCTION_INFO(C_GetFunctionList)
\r
59 #ifdef CK_NEED_ARG_LIST
\r
61 CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to
\r
68 /* Slot and token management */
\r
70 /* C_GetSlotList obtains a list of slots in the system. */
\r
71 CK_PKCS11_FUNCTION_INFO(C_GetSlotList)
\r
72 #ifdef CK_NEED_ARG_LIST
\r
74 CK_BBOOL tokenPresent, /* only slots with tokens? */
\r
75 CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */
\r
76 CK_ULONG_PTR pulCount /* receives number of slots */
\r
81 /* C_GetSlotInfo obtains information about a particular slot in
\r
83 CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo)
\r
84 #ifdef CK_NEED_ARG_LIST
\r
86 CK_SLOT_ID slotID, /* the ID of the slot */
\r
87 CK_SLOT_INFO_PTR pInfo /* receives the slot information */
\r
92 /* C_GetTokenInfo obtains information about a particular token
\r
94 CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo)
\r
95 #ifdef CK_NEED_ARG_LIST
\r
97 CK_SLOT_ID slotID, /* ID of the token's slot */
\r
98 CK_TOKEN_INFO_PTR pInfo /* receives the token information */
\r
103 /* C_GetMechanismList obtains a list of mechanism types
\r
104 * supported by a token. */
\r
105 CK_PKCS11_FUNCTION_INFO(C_GetMechanismList)
\r
106 #ifdef CK_NEED_ARG_LIST
\r
108 CK_SLOT_ID slotID, /* ID of token's slot */
\r
109 CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */
\r
110 CK_ULONG_PTR pulCount /* gets # of mechs. */
\r
115 /* C_GetMechanismInfo obtains information about a particular
\r
116 * mechanism possibly supported by a token. */
\r
117 CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo)
\r
118 #ifdef CK_NEED_ARG_LIST
\r
120 CK_SLOT_ID slotID, /* ID of the token's slot */
\r
121 CK_MECHANISM_TYPE type, /* type of mechanism */
\r
122 CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */
\r
127 /* C_InitToken initializes a token. */
\r
128 CK_PKCS11_FUNCTION_INFO(C_InitToken)
\r
129 #ifdef CK_NEED_ARG_LIST
\r
130 /* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */
\r
132 CK_SLOT_ID slotID, /* ID of the token's slot */
\r
133 CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */
\r
134 CK_ULONG ulPinLen, /* length in bytes of the PIN */
\r
135 CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */
\r
140 /* C_InitPIN initializes the normal user's PIN. */
\r
141 CK_PKCS11_FUNCTION_INFO(C_InitPIN)
\r
142 #ifdef CK_NEED_ARG_LIST
\r
144 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
145 CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */
\r
146 CK_ULONG ulPinLen /* length in bytes of the PIN */
\r
151 /* C_SetPIN modifies the PIN of the user who is logged in. */
\r
152 CK_PKCS11_FUNCTION_INFO(C_SetPIN)
\r
153 #ifdef CK_NEED_ARG_LIST
\r
155 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
156 CK_UTF8CHAR_PTR pOldPin, /* the old PIN */
\r
157 CK_ULONG ulOldLen, /* length of the old PIN */
\r
158 CK_UTF8CHAR_PTR pNewPin, /* the new PIN */
\r
159 CK_ULONG ulNewLen /* length of the new PIN */
\r
165 /* Session management */
\r
167 /* C_OpenSession opens a session between an application and a
\r
169 CK_PKCS11_FUNCTION_INFO(C_OpenSession)
\r
170 #ifdef CK_NEED_ARG_LIST
\r
172 CK_SLOT_ID slotID, /* the slot's ID */
\r
173 CK_FLAGS flags, /* from CK_SESSION_INFO */
\r
174 CK_VOID_PTR pApplication, /* passed to callback */
\r
175 CK_NOTIFY Notify, /* callback function */
\r
176 CK_SESSION_HANDLE_PTR phSession /* gets session handle */
\r
181 /* C_CloseSession closes a session between an application and a
\r
183 CK_PKCS11_FUNCTION_INFO(C_CloseSession)
\r
184 #ifdef CK_NEED_ARG_LIST
\r
186 CK_SESSION_HANDLE hSession /* the session's handle */
\r
191 /* C_CloseAllSessions closes all sessions with a token. */
\r
192 CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions)
\r
193 #ifdef CK_NEED_ARG_LIST
\r
195 CK_SLOT_ID slotID /* the token's slot */
\r
200 /* C_GetSessionInfo obtains information about the session. */
\r
201 CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo)
\r
202 #ifdef CK_NEED_ARG_LIST
\r
204 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
205 CK_SESSION_INFO_PTR pInfo /* receives session info */
\r
210 /* C_GetOperationState obtains the state of the cryptographic operation
\r
212 CK_PKCS11_FUNCTION_INFO(C_GetOperationState)
\r
213 #ifdef CK_NEED_ARG_LIST
\r
215 CK_SESSION_HANDLE hSession, /* session's handle */
\r
216 CK_BYTE_PTR pOperationState, /* gets state */
\r
217 CK_ULONG_PTR pulOperationStateLen /* gets state length */
\r
222 /* C_SetOperationState restores the state of the cryptographic
\r
223 * operation in a session. */
\r
224 CK_PKCS11_FUNCTION_INFO(C_SetOperationState)
\r
225 #ifdef CK_NEED_ARG_LIST
\r
227 CK_SESSION_HANDLE hSession, /* session's handle */
\r
228 CK_BYTE_PTR pOperationState, /* holds state */
\r
229 CK_ULONG ulOperationStateLen, /* holds state length */
\r
230 CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */
\r
231 CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */
\r
236 /* C_Login logs a user into a token. */
\r
237 CK_PKCS11_FUNCTION_INFO(C_Login)
\r
238 #ifdef CK_NEED_ARG_LIST
\r
240 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
241 CK_USER_TYPE userType, /* the user type */
\r
242 CK_UTF8CHAR_PTR pPin, /* the user's PIN */
\r
243 CK_ULONG ulPinLen /* the length of the PIN */
\r
248 /* C_Logout logs a user out from a token. */
\r
249 CK_PKCS11_FUNCTION_INFO(C_Logout)
\r
250 #ifdef CK_NEED_ARG_LIST
\r
252 CK_SESSION_HANDLE hSession /* the session's handle */
\r
258 /* Object management */
\r
260 /* C_CreateObject creates a new object. */
\r
261 CK_PKCS11_FUNCTION_INFO(C_CreateObject)
\r
262 #ifdef CK_NEED_ARG_LIST
\r
264 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
265 CK_ATTRIBUTE_PTR pTemplate, /* the object's template */
\r
266 CK_ULONG ulCount, /* attributes in template */
\r
267 CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */
\r
272 /* C_CopyObject copies an object, creating a new object for the
\r
274 CK_PKCS11_FUNCTION_INFO(C_CopyObject)
\r
275 #ifdef CK_NEED_ARG_LIST
\r
277 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
278 CK_OBJECT_HANDLE hObject, /* the object's handle */
\r
279 CK_ATTRIBUTE_PTR pTemplate, /* template for new object */
\r
280 CK_ULONG ulCount, /* attributes in template */
\r
281 CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */
\r
286 /* C_DestroyObject destroys an object. */
\r
287 CK_PKCS11_FUNCTION_INFO(C_DestroyObject)
\r
288 #ifdef CK_NEED_ARG_LIST
\r
290 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
291 CK_OBJECT_HANDLE hObject /* the object's handle */
\r
296 /* C_GetObjectSize gets the size of an object in bytes. */
\r
297 CK_PKCS11_FUNCTION_INFO(C_GetObjectSize)
\r
298 #ifdef CK_NEED_ARG_LIST
\r
300 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
301 CK_OBJECT_HANDLE hObject, /* the object's handle */
\r
302 CK_ULONG_PTR pulSize /* receives size of object */
\r
307 /* C_GetAttributeValue obtains the value of one or more object
\r
309 CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue)
\r
310 #ifdef CK_NEED_ARG_LIST
\r
312 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
313 CK_OBJECT_HANDLE hObject, /* the object's handle */
\r
314 CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */
\r
315 CK_ULONG ulCount /* attributes in template */
\r
320 /* C_SetAttributeValue modifies the value of one or more object
\r
322 CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue)
\r
323 #ifdef CK_NEED_ARG_LIST
\r
325 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
326 CK_OBJECT_HANDLE hObject, /* the object's handle */
\r
327 CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */
\r
328 CK_ULONG ulCount /* attributes in template */
\r
333 /* C_FindObjectsInit initializes a search for token and session
\r
334 * objects that match a template. */
\r
335 CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit)
\r
336 #ifdef CK_NEED_ARG_LIST
\r
338 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
339 CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */
\r
340 CK_ULONG ulCount /* attrs in search template */
\r
345 /* C_FindObjects continues a search for token and session
\r
346 * objects that match a template, obtaining additional object
\r
348 CK_PKCS11_FUNCTION_INFO(C_FindObjects)
\r
349 #ifdef CK_NEED_ARG_LIST
\r
351 CK_SESSION_HANDLE hSession, /* session's handle */
\r
352 CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */
\r
353 CK_ULONG ulMaxObjectCount, /* max handles to get */
\r
354 CK_ULONG_PTR pulObjectCount /* actual # returned */
\r
359 /* C_FindObjectsFinal finishes a search for token and session
\r
361 CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal)
\r
362 #ifdef CK_NEED_ARG_LIST
\r
364 CK_SESSION_HANDLE hSession /* the session's handle */
\r
370 /* Encryption and decryption */
\r
372 /* C_EncryptInit initializes an encryption operation. */
\r
373 CK_PKCS11_FUNCTION_INFO(C_EncryptInit)
\r
374 #ifdef CK_NEED_ARG_LIST
\r
376 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
377 CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */
\r
378 CK_OBJECT_HANDLE hKey /* handle of encryption key */
\r
383 /* C_Encrypt encrypts single-part data. */
\r
384 CK_PKCS11_FUNCTION_INFO(C_Encrypt)
\r
385 #ifdef CK_NEED_ARG_LIST
\r
387 CK_SESSION_HANDLE hSession, /* session's handle */
\r
388 CK_BYTE_PTR pData, /* the plaintext data */
\r
389 CK_ULONG ulDataLen, /* bytes of plaintext */
\r
390 CK_BYTE_PTR pEncryptedData, /* gets ciphertext */
\r
391 CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */
\r
396 /* C_EncryptUpdate continues a multiple-part encryption
\r
398 CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate)
\r
399 #ifdef CK_NEED_ARG_LIST
\r
401 CK_SESSION_HANDLE hSession, /* session's handle */
\r
402 CK_BYTE_PTR pPart, /* the plaintext data */
\r
403 CK_ULONG ulPartLen, /* plaintext data len */
\r
404 CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
\r
405 CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */
\r
410 /* C_EncryptFinal finishes a multiple-part encryption
\r
412 CK_PKCS11_FUNCTION_INFO(C_EncryptFinal)
\r
413 #ifdef CK_NEED_ARG_LIST
\r
415 CK_SESSION_HANDLE hSession, /* session handle */
\r
416 CK_BYTE_PTR pLastEncryptedPart, /* last c-text */
\r
417 CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */
\r
422 /* C_DecryptInit initializes a decryption operation. */
\r
423 CK_PKCS11_FUNCTION_INFO(C_DecryptInit)
\r
424 #ifdef CK_NEED_ARG_LIST
\r
426 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
427 CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */
\r
428 CK_OBJECT_HANDLE hKey /* handle of decryption key */
\r
433 /* C_Decrypt decrypts encrypted data in a single part. */
\r
434 CK_PKCS11_FUNCTION_INFO(C_Decrypt)
\r
435 #ifdef CK_NEED_ARG_LIST
\r
437 CK_SESSION_HANDLE hSession, /* session's handle */
\r
438 CK_BYTE_PTR pEncryptedData, /* ciphertext */
\r
439 CK_ULONG ulEncryptedDataLen, /* ciphertext length */
\r
440 CK_BYTE_PTR pData, /* gets plaintext */
\r
441 CK_ULONG_PTR pulDataLen /* gets p-text size */
\r
446 /* C_DecryptUpdate continues a multiple-part decryption
\r
448 CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate)
\r
449 #ifdef CK_NEED_ARG_LIST
\r
451 CK_SESSION_HANDLE hSession, /* session's handle */
\r
452 CK_BYTE_PTR pEncryptedPart, /* encrypted data */
\r
453 CK_ULONG ulEncryptedPartLen, /* input length */
\r
454 CK_BYTE_PTR pPart, /* gets plaintext */
\r
455 CK_ULONG_PTR pulPartLen /* p-text size */
\r
460 /* C_DecryptFinal finishes a multiple-part decryption
\r
462 CK_PKCS11_FUNCTION_INFO(C_DecryptFinal)
\r
463 #ifdef CK_NEED_ARG_LIST
\r
465 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
466 CK_BYTE_PTR pLastPart, /* gets plaintext */
\r
467 CK_ULONG_PTR pulLastPartLen /* p-text size */
\r
473 /* Message digesting */
\r
475 /* C_DigestInit initializes a message-digesting operation. */
\r
476 CK_PKCS11_FUNCTION_INFO(C_DigestInit)
\r
477 #ifdef CK_NEED_ARG_LIST
\r
479 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
480 CK_MECHANISM_PTR pMechanism /* the digesting mechanism */
\r
485 /* C_Digest digests data in a single part. */
\r
486 CK_PKCS11_FUNCTION_INFO(C_Digest)
\r
487 #ifdef CK_NEED_ARG_LIST
\r
489 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
490 CK_BYTE_PTR pData, /* data to be digested */
\r
491 CK_ULONG ulDataLen, /* bytes of data to digest */
\r
492 CK_BYTE_PTR pDigest, /* gets the message digest */
\r
493 CK_ULONG_PTR pulDigestLen /* gets digest length */
\r
498 /* C_DigestUpdate continues a multiple-part message-digesting
\r
500 CK_PKCS11_FUNCTION_INFO(C_DigestUpdate)
\r
501 #ifdef CK_NEED_ARG_LIST
\r
503 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
504 CK_BYTE_PTR pPart, /* data to be digested */
\r
505 CK_ULONG ulPartLen /* bytes of data to be digested */
\r
510 /* C_DigestKey continues a multi-part message-digesting
\r
511 * operation, by digesting the value of a secret key as part of
\r
512 * the data already digested. */
\r
513 CK_PKCS11_FUNCTION_INFO(C_DigestKey)
\r
514 #ifdef CK_NEED_ARG_LIST
\r
516 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
517 CK_OBJECT_HANDLE hKey /* secret key to digest */
\r
522 /* C_DigestFinal finishes a multiple-part message-digesting
\r
524 CK_PKCS11_FUNCTION_INFO(C_DigestFinal)
\r
525 #ifdef CK_NEED_ARG_LIST
\r
527 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
528 CK_BYTE_PTR pDigest, /* gets the message digest */
\r
529 CK_ULONG_PTR pulDigestLen /* gets byte count of digest */
\r
535 /* Signing and MACing */
\r
537 /* C_SignInit initializes a signature (private key encryption)
\r
538 * operation, where the signature is (will be) an appendix to
\r
539 * the data, and plaintext cannot be recovered from the
\r
541 CK_PKCS11_FUNCTION_INFO(C_SignInit)
\r
542 #ifdef CK_NEED_ARG_LIST
\r
544 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
545 CK_MECHANISM_PTR pMechanism, /* the signature mechanism */
\r
546 CK_OBJECT_HANDLE hKey /* handle of signature key */
\r
551 /* C_Sign signs (encrypts with private key) data in a single
\r
552 * part, where the signature is (will be) an appendix to the
\r
553 * data, and plaintext cannot be recovered from the signature. */
\r
554 CK_PKCS11_FUNCTION_INFO(C_Sign)
\r
555 #ifdef CK_NEED_ARG_LIST
\r
557 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
558 CK_BYTE_PTR pData, /* the data to sign */
\r
559 CK_ULONG ulDataLen, /* count of bytes to sign */
\r
560 CK_BYTE_PTR pSignature, /* gets the signature */
\r
561 CK_ULONG_PTR pulSignatureLen /* gets signature length */
\r
566 /* C_SignUpdate continues a multiple-part signature operation,
\r
567 * where the signature is (will be) an appendix to the data,
\r
568 * and plaintext cannot be recovered from the signature. */
\r
569 CK_PKCS11_FUNCTION_INFO(C_SignUpdate)
\r
570 #ifdef CK_NEED_ARG_LIST
\r
572 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
573 CK_BYTE_PTR pPart, /* the data to sign */
\r
574 CK_ULONG ulPartLen /* count of bytes to sign */
\r
579 /* C_SignFinal finishes a multiple-part signature operation,
\r
580 * returning the signature. */
\r
581 CK_PKCS11_FUNCTION_INFO(C_SignFinal)
\r
582 #ifdef CK_NEED_ARG_LIST
\r
584 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
585 CK_BYTE_PTR pSignature, /* gets the signature */
\r
586 CK_ULONG_PTR pulSignatureLen /* gets signature length */
\r
591 /* C_SignRecoverInit initializes a signature operation, where
\r
592 * the data can be recovered from the signature. */
\r
593 CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit)
\r
594 #ifdef CK_NEED_ARG_LIST
\r
596 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
597 CK_MECHANISM_PTR pMechanism, /* the signature mechanism */
\r
598 CK_OBJECT_HANDLE hKey /* handle of the signature key */
\r
603 /* C_SignRecover signs data in a single operation, where the
\r
604 * data can be recovered from the signature. */
\r
605 CK_PKCS11_FUNCTION_INFO(C_SignRecover)
\r
606 #ifdef CK_NEED_ARG_LIST
\r
608 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
609 CK_BYTE_PTR pData, /* the data to sign */
\r
610 CK_ULONG ulDataLen, /* count of bytes to sign */
\r
611 CK_BYTE_PTR pSignature, /* gets the signature */
\r
612 CK_ULONG_PTR pulSignatureLen /* gets signature length */
\r
618 /* Verifying signatures and MACs */
\r
620 /* C_VerifyInit initializes a verification operation, where the
\r
621 * signature is an appendix to the data, and plaintext cannot
\r
622 * cannot be recovered from the signature (e.g. DSA). */
\r
623 CK_PKCS11_FUNCTION_INFO(C_VerifyInit)
\r
624 #ifdef CK_NEED_ARG_LIST
\r
626 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
627 CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
\r
628 CK_OBJECT_HANDLE hKey /* verification key */
\r
633 /* C_Verify verifies a signature in a single-part operation,
\r
634 * where the signature is an appendix to the data, and plaintext
\r
635 * cannot be recovered from the signature. */
\r
636 CK_PKCS11_FUNCTION_INFO(C_Verify)
\r
637 #ifdef CK_NEED_ARG_LIST
\r
639 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
640 CK_BYTE_PTR pData, /* signed data */
\r
641 CK_ULONG ulDataLen, /* length of signed data */
\r
642 CK_BYTE_PTR pSignature, /* signature */
\r
643 CK_ULONG ulSignatureLen /* signature length*/
\r
648 /* C_VerifyUpdate continues a multiple-part verification
\r
649 * operation, where the signature is an appendix to the data,
\r
650 * and plaintext cannot be recovered from the signature. */
\r
651 CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate)
\r
652 #ifdef CK_NEED_ARG_LIST
\r
654 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
655 CK_BYTE_PTR pPart, /* signed data */
\r
656 CK_ULONG ulPartLen /* length of signed data */
\r
661 /* C_VerifyFinal finishes a multiple-part verification
\r
662 * operation, checking the signature. */
\r
663 CK_PKCS11_FUNCTION_INFO(C_VerifyFinal)
\r
664 #ifdef CK_NEED_ARG_LIST
\r
666 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
667 CK_BYTE_PTR pSignature, /* signature to verify */
\r
668 CK_ULONG ulSignatureLen /* signature length */
\r
673 /* C_VerifyRecoverInit initializes a signature verification
\r
674 * operation, where the data is recovered from the signature. */
\r
675 CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit)
\r
676 #ifdef CK_NEED_ARG_LIST
\r
678 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
679 CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
\r
680 CK_OBJECT_HANDLE hKey /* verification key */
\r
685 /* C_VerifyRecover verifies a signature in a single-part
\r
686 * operation, where the data is recovered from the signature. */
\r
687 CK_PKCS11_FUNCTION_INFO(C_VerifyRecover)
\r
688 #ifdef CK_NEED_ARG_LIST
\r
690 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
691 CK_BYTE_PTR pSignature, /* signature to verify */
\r
692 CK_ULONG ulSignatureLen, /* signature length */
\r
693 CK_BYTE_PTR pData, /* gets signed data */
\r
694 CK_ULONG_PTR pulDataLen /* gets signed data len */
\r
700 /* Dual-function cryptographic operations */
\r
702 /* C_DigestEncryptUpdate continues a multiple-part digesting
\r
703 * and encryption operation. */
\r
704 CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate)
\r
705 #ifdef CK_NEED_ARG_LIST
\r
707 CK_SESSION_HANDLE hSession, /* session's handle */
\r
708 CK_BYTE_PTR pPart, /* the plaintext data */
\r
709 CK_ULONG ulPartLen, /* plaintext length */
\r
710 CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
\r
711 CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */
\r
716 /* C_DecryptDigestUpdate continues a multiple-part decryption and
\r
717 * digesting operation. */
\r
718 CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate)
\r
719 #ifdef CK_NEED_ARG_LIST
\r
721 CK_SESSION_HANDLE hSession, /* session's handle */
\r
722 CK_BYTE_PTR pEncryptedPart, /* ciphertext */
\r
723 CK_ULONG ulEncryptedPartLen, /* ciphertext length */
\r
724 CK_BYTE_PTR pPart, /* gets plaintext */
\r
725 CK_ULONG_PTR pulPartLen /* gets plaintext len */
\r
730 /* C_SignEncryptUpdate continues a multiple-part signing and
\r
731 * encryption operation. */
\r
732 CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate)
\r
733 #ifdef CK_NEED_ARG_LIST
\r
735 CK_SESSION_HANDLE hSession, /* session's handle */
\r
736 CK_BYTE_PTR pPart, /* the plaintext data */
\r
737 CK_ULONG ulPartLen, /* plaintext length */
\r
738 CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
\r
739 CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */
\r
744 /* C_DecryptVerifyUpdate continues a multiple-part decryption and
\r
745 * verify operation. */
\r
746 CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate)
\r
747 #ifdef CK_NEED_ARG_LIST
\r
749 CK_SESSION_HANDLE hSession, /* session's handle */
\r
750 CK_BYTE_PTR pEncryptedPart, /* ciphertext */
\r
751 CK_ULONG ulEncryptedPartLen, /* ciphertext length */
\r
752 CK_BYTE_PTR pPart, /* gets plaintext */
\r
753 CK_ULONG_PTR pulPartLen /* gets p-text length */
\r
759 /* Key management */
\r
761 /* C_GenerateKey generates a secret key, creating a new key
\r
763 CK_PKCS11_FUNCTION_INFO(C_GenerateKey)
\r
764 #ifdef CK_NEED_ARG_LIST
\r
766 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
767 CK_MECHANISM_PTR pMechanism, /* key generation mech. */
\r
768 CK_ATTRIBUTE_PTR pTemplate, /* template for new key */
\r
769 CK_ULONG ulCount, /* # of attrs in template */
\r
770 CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */
\r
775 /* C_GenerateKeyPair generates a public-key/private-key pair,
\r
776 * creating new key objects. */
\r
777 CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair)
\r
778 #ifdef CK_NEED_ARG_LIST
\r
780 CK_SESSION_HANDLE hSession, /* session
\r
782 CK_MECHANISM_PTR pMechanism, /* key-gen
\r
784 CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template
\r
787 CK_ULONG ulPublicKeyAttributeCount, /* # pub.
\r
789 CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template
\r
792 CK_ULONG ulPrivateKeyAttributeCount, /* # priv.
\r
794 CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub.
\r
797 CK_OBJECT_HANDLE_PTR phPrivateKey /* gets
\r
804 /* C_WrapKey wraps (i.e., encrypts) a key. */
\r
805 CK_PKCS11_FUNCTION_INFO(C_WrapKey)
\r
806 #ifdef CK_NEED_ARG_LIST
\r
808 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
809 CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */
\r
810 CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */
\r
811 CK_OBJECT_HANDLE hKey, /* key to be wrapped */
\r
812 CK_BYTE_PTR pWrappedKey, /* gets wrapped key */
\r
813 CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */
\r
818 /* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new
\r
820 CK_PKCS11_FUNCTION_INFO(C_UnwrapKey)
\r
821 #ifdef CK_NEED_ARG_LIST
\r
823 CK_SESSION_HANDLE hSession, /* session's handle */
\r
824 CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */
\r
825 CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */
\r
826 CK_BYTE_PTR pWrappedKey, /* the wrapped key */
\r
827 CK_ULONG ulWrappedKeyLen, /* wrapped key len */
\r
828 CK_ATTRIBUTE_PTR pTemplate, /* new key template */
\r
829 CK_ULONG ulAttributeCount, /* template length */
\r
830 CK_OBJECT_HANDLE_PTR phKey /* gets new handle */
\r
835 /* C_DeriveKey derives a key from a base key, creating a new key
\r
837 CK_PKCS11_FUNCTION_INFO(C_DeriveKey)
\r
838 #ifdef CK_NEED_ARG_LIST
\r
840 CK_SESSION_HANDLE hSession, /* session's handle */
\r
841 CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */
\r
842 CK_OBJECT_HANDLE hBaseKey, /* base key */
\r
843 CK_ATTRIBUTE_PTR pTemplate, /* new key template */
\r
844 CK_ULONG ulAttributeCount, /* template length */
\r
845 CK_OBJECT_HANDLE_PTR phKey /* gets new handle */
\r
851 /* Random number generation */
\r
853 /* C_SeedRandom mixes additional seed material into the token's
\r
854 * random number generator. */
\r
855 CK_PKCS11_FUNCTION_INFO(C_SeedRandom)
\r
856 #ifdef CK_NEED_ARG_LIST
\r
858 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
859 CK_BYTE_PTR pSeed, /* the seed material */
\r
860 CK_ULONG ulSeedLen /* length of seed material */
\r
865 /* C_GenerateRandom generates random data. */
\r
866 CK_PKCS11_FUNCTION_INFO(C_GenerateRandom)
\r
867 #ifdef CK_NEED_ARG_LIST
\r
869 CK_SESSION_HANDLE hSession, /* the session's handle */
\r
870 CK_BYTE_PTR RandomData, /* receives the random data */
\r
871 CK_ULONG ulRandomLen /* # of bytes to generate */
\r
877 /* Parallel function management */
\r
879 /* C_GetFunctionStatus is a legacy function; it obtains an
\r
880 * updated status of a function running in parallel with an
\r
882 CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus)
\r
883 #ifdef CK_NEED_ARG_LIST
\r
885 CK_SESSION_HANDLE hSession /* the session's handle */
\r
890 /* C_CancelFunction is a legacy function; it cancels a function
\r
891 * running in parallel. */
\r
892 CK_PKCS11_FUNCTION_INFO(C_CancelFunction)
\r
893 #ifdef CK_NEED_ARG_LIST
\r
895 CK_SESSION_HANDLE hSession /* the session's handle */
\r
901 /* Functions added in for Cryptoki Version 2.01 or later */
\r
903 /* C_WaitForSlotEvent waits for a slot event (token insertion,
\r
904 * removal, etc.) to occur. */
\r
905 CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent)
\r
906 #ifdef CK_NEED_ARG_LIST
\r
908 CK_FLAGS flags, /* blocking/nonblocking flag */
\r
909 CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */
\r
910 CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */
\r