cryptlib  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
pkcs11f.h
Go to the documentation of this file.
1 /* pkcs11f.h include file for PKCS #11. */
2 /* $Revision: 1.4 $ */
3 
4 /* License to copy and use this software is granted provided that it is
5  * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
6  * (Cryptoki)" in all material mentioning or referencing this software.
7 
8  * License is also granted to make and use derivative works provided that
9  * such works are identified as "derived from the RSA Security Inc. PKCS #11
10  * Cryptographic Token Interface (Cryptoki)" in all material mentioning or
11  * referencing the derived work.
12 
13  * RSA Security Inc. makes no representations concerning either the
14  * merchantability of this software or the suitability of this software for
15  * any particular purpose. It is provided "as is" without express or implied
16  * warranty of any kind.
17  */
18 
19 /* This header file contains pretty much everything about all the */
20 /* Cryptoki function prototypes. Because this information is */
21 /* used for more than just declaring function prototypes, the */
22 /* order of the functions appearing herein is important, and */
23 /* should not be altered. */
24 
25 /* General-purpose */
26 
27 /* C_Initialize initializes the Cryptoki library. */
28 CK_PKCS11_FUNCTION_INFO(C_Initialize)
29 #ifdef CK_NEED_ARG_LIST
30 (
31  CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets
32  * cast to CK_C_INITIALIZE_ARGS_PTR
33  * and dereferenced */
34 );
35 #endif
36 
37 
38 /* C_Finalize indicates that an application is done with the
39  * Cryptoki library. */
40 CK_PKCS11_FUNCTION_INFO(C_Finalize)
41 #ifdef CK_NEED_ARG_LIST
42 (
43  CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */
44 );
45 #endif
46 
47 
48 /* C_GetInfo returns general information about Cryptoki. */
49 CK_PKCS11_FUNCTION_INFO(C_GetInfo)
50 #ifdef CK_NEED_ARG_LIST
51 (
52  CK_INFO_PTR pInfo /* location that receives information */
53 );
54 #endif
55 
56 
57 /* C_GetFunctionList returns the function list. */
58 CK_PKCS11_FUNCTION_INFO(C_GetFunctionList)
59 #ifdef CK_NEED_ARG_LIST
60 (
61  CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to
62  * function list */
63 );
64 #endif
65 
66 
67 
68 /* Slot and token management */
69 
70 /* C_GetSlotList obtains a list of slots in the system. */
71 CK_PKCS11_FUNCTION_INFO(C_GetSlotList)
72 #ifdef CK_NEED_ARG_LIST
73 (
74  CK_BBOOL tokenPresent, /* only slots with tokens? */
75  CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */
76  CK_ULONG_PTR pulCount /* receives number of slots */
77 );
78 #endif
79 
80 
81 /* C_GetSlotInfo obtains information about a particular slot in
82  * the system. */
83 CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo)
84 #ifdef CK_NEED_ARG_LIST
85 (
86  CK_SLOT_ID slotID, /* the ID of the slot */
87  CK_SLOT_INFO_PTR pInfo /* receives the slot information */
88 );
89 #endif
90 
91 
92 /* C_GetTokenInfo obtains information about a particular token
93  * in the system. */
94 CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo)
95 #ifdef CK_NEED_ARG_LIST
96 (
97  CK_SLOT_ID slotID, /* ID of the token's slot */
98  CK_TOKEN_INFO_PTR pInfo /* receives the token information */
99 );
100 #endif
101 
102 
103 /* C_GetMechanismList obtains a list of mechanism types
104  * supported by a token. */
105 CK_PKCS11_FUNCTION_INFO(C_GetMechanismList)
106 #ifdef CK_NEED_ARG_LIST
107 (
108  CK_SLOT_ID slotID, /* ID of token's slot */
109  CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */
110  CK_ULONG_PTR pulCount /* gets # of mechs. */
111 );
112 #endif
113 
114 
115 /* C_GetMechanismInfo obtains information about a particular
116  * mechanism possibly supported by a token. */
117 CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo)
118 #ifdef CK_NEED_ARG_LIST
119 (
120  CK_SLOT_ID slotID, /* ID of the token's slot */
121  CK_MECHANISM_TYPE type, /* type of mechanism */
122  CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */
123 );
124 #endif
125 
126 
127 /* C_InitToken initializes a token. */
128 CK_PKCS11_FUNCTION_INFO(C_InitToken)
129 #ifdef CK_NEED_ARG_LIST
130 /* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */
131 (
132  CK_SLOT_ID slotID, /* ID of the token's slot */
133  CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */
134  CK_ULONG ulPinLen, /* length in bytes of the PIN */
135  CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */
136 );
137 #endif
138 
139 
140 /* C_InitPIN initializes the normal user's PIN. */
141 CK_PKCS11_FUNCTION_INFO(C_InitPIN)
142 #ifdef CK_NEED_ARG_LIST
143 (
144  CK_SESSION_HANDLE hSession, /* the session's handle */
145  CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */
146  CK_ULONG ulPinLen /* length in bytes of the PIN */
147 );
148 #endif
149 
150 
151 /* C_SetPIN modifies the PIN of the user who is logged in. */
152 CK_PKCS11_FUNCTION_INFO(C_SetPIN)
153 #ifdef CK_NEED_ARG_LIST
154 (
155  CK_SESSION_HANDLE hSession, /* the session's handle */
156  CK_UTF8CHAR_PTR pOldPin, /* the old PIN */
157  CK_ULONG ulOldLen, /* length of the old PIN */
158  CK_UTF8CHAR_PTR pNewPin, /* the new PIN */
159  CK_ULONG ulNewLen /* length of the new PIN */
160 );
161 #endif
162 
163 
164 
165 /* Session management */
166 
167 /* C_OpenSession opens a session between an application and a
168  * token. */
169 CK_PKCS11_FUNCTION_INFO(C_OpenSession)
170 #ifdef CK_NEED_ARG_LIST
171 (
172  CK_SLOT_ID slotID, /* the slot's ID */
173  CK_FLAGS flags, /* from CK_SESSION_INFO */
174  CK_VOID_PTR pApplication, /* passed to callback */
175  CK_NOTIFY Notify, /* callback function */
176  CK_SESSION_HANDLE_PTR phSession /* gets session handle */
177 );
178 #endif
179 
180 
181 /* C_CloseSession closes a session between an application and a
182  * token. */
183 CK_PKCS11_FUNCTION_INFO(C_CloseSession)
184 #ifdef CK_NEED_ARG_LIST
185 (
186  CK_SESSION_HANDLE hSession /* the session's handle */
187 );
188 #endif
189 
190 
191 /* C_CloseAllSessions closes all sessions with a token. */
192 CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions)
193 #ifdef CK_NEED_ARG_LIST
194 (
195  CK_SLOT_ID slotID /* the token's slot */
196 );
197 #endif
198 
199 
200 /* C_GetSessionInfo obtains information about the session. */
201 CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo)
202 #ifdef CK_NEED_ARG_LIST
203 (
204  CK_SESSION_HANDLE hSession, /* the session's handle */
205  CK_SESSION_INFO_PTR pInfo /* receives session info */
206 );
207 #endif
208 
209 
210 /* C_GetOperationState obtains the state of the cryptographic operation
211  * in a session. */
212 CK_PKCS11_FUNCTION_INFO(C_GetOperationState)
213 #ifdef CK_NEED_ARG_LIST
214 (
215  CK_SESSION_HANDLE hSession, /* session's handle */
216  CK_BYTE_PTR pOperationState, /* gets state */
217  CK_ULONG_PTR pulOperationStateLen /* gets state length */
218 );
219 #endif
220 
221 
222 /* C_SetOperationState restores the state of the cryptographic
223  * operation in a session. */
224 CK_PKCS11_FUNCTION_INFO(C_SetOperationState)
225 #ifdef CK_NEED_ARG_LIST
226 (
227  CK_SESSION_HANDLE hSession, /* session's handle */
228  CK_BYTE_PTR pOperationState, /* holds state */
229  CK_ULONG ulOperationStateLen, /* holds state length */
230  CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */
231  CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */
232 );
233 #endif
234 
235 
236 /* C_Login logs a user into a token. */
238 #ifdef CK_NEED_ARG_LIST
239 (
240  CK_SESSION_HANDLE hSession, /* the session's handle */
241  CK_USER_TYPE userType, /* the user type */
242  CK_UTF8CHAR_PTR pPin, /* the user's PIN */
243  CK_ULONG ulPinLen /* the length of the PIN */
244 );
245 #endif
246 
247 
248 /* C_Logout logs a user out from a token. */
249 CK_PKCS11_FUNCTION_INFO(C_Logout)
250 #ifdef CK_NEED_ARG_LIST
251 (
252  CK_SESSION_HANDLE hSession /* the session's handle */
253 );
254 #endif
255 
256 
257 
258 /* Object management */
259 
260 /* C_CreateObject creates a new object. */
261 CK_PKCS11_FUNCTION_INFO(C_CreateObject)
262 #ifdef CK_NEED_ARG_LIST
263 (
264  CK_SESSION_HANDLE hSession, /* the session's handle */
265  CK_ATTRIBUTE_PTR pTemplate, /* the object's template */
266  CK_ULONG ulCount, /* attributes in template */
267  CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */
268 );
269 #endif
270 
271 
272 /* C_CopyObject copies an object, creating a new object for the
273  * copy. */
274 CK_PKCS11_FUNCTION_INFO(C_CopyObject)
275 #ifdef CK_NEED_ARG_LIST
276 (
277  CK_SESSION_HANDLE hSession, /* the session's handle */
278  CK_OBJECT_HANDLE hObject, /* the object's handle */
279  CK_ATTRIBUTE_PTR pTemplate, /* template for new object */
280  CK_ULONG ulCount, /* attributes in template */
281  CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */
282 );
283 #endif
284 
285 
286 /* C_DestroyObject destroys an object. */
287 CK_PKCS11_FUNCTION_INFO(C_DestroyObject)
288 #ifdef CK_NEED_ARG_LIST
289 (
290  CK_SESSION_HANDLE hSession, /* the session's handle */
291  CK_OBJECT_HANDLE hObject /* the object's handle */
292 );
293 #endif
294 
295 
296 /* C_GetObjectSize gets the size of an object in bytes. */
297 CK_PKCS11_FUNCTION_INFO(C_GetObjectSize)
298 #ifdef CK_NEED_ARG_LIST
299 (
300  CK_SESSION_HANDLE hSession, /* the session's handle */
301  CK_OBJECT_HANDLE hObject, /* the object's handle */
302 
303  CK_ULONG_PTR pulSize /* receives size of object */
304 );
305 #endif
306 
307 
308 /* C_GetAttributeValue obtains the value of one or more object
309  * attributes. */
310 CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue)
311 #ifdef CK_NEED_ARG_LIST
312 (
313  CK_SESSION_HANDLE hSession, /* the session's handle */
314  CK_OBJECT_HANDLE hObject, /* the object's handle */
315  CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */
316  CK_ULONG ulCount /* attributes in template */
317 );
318 #endif
319 
320 
321 /* C_SetAttributeValue modifies the value of one or more object
322  * attributes */
323 CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue)
324 #ifdef CK_NEED_ARG_LIST
325 (
326  CK_SESSION_HANDLE hSession, /* the session's handle */
327  CK_OBJECT_HANDLE hObject, /* the object's handle */
328  CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */
329  CK_ULONG ulCount /* attributes in template */
330 );
331 #endif
332 
333 
334 /* C_FindObjectsInit initializes a search for token and session
335  * objects that match a template. */
336 CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit)
337 #ifdef CK_NEED_ARG_LIST
338 (
339  CK_SESSION_HANDLE hSession, /* the session's handle */
340  CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */
341  CK_ULONG ulCount /* attrs in search template */
342 );
343 #endif
344 
345 
346 /* C_FindObjects continues a search for token and session
347  * objects that match a template, obtaining additional object
348  * handles. */
349 CK_PKCS11_FUNCTION_INFO(C_FindObjects)
350 #ifdef CK_NEED_ARG_LIST
351 (
352  CK_SESSION_HANDLE hSession, /* session's handle */
353  CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */
354  CK_ULONG ulMaxObjectCount, /* max handles to get */
355  CK_ULONG_PTR pulObjectCount /* actual # returned */
356 );
357 #endif
358 
359 
360 /* C_FindObjectsFinal finishes a search for token and session
361  * objects. */
362 CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal)
363 #ifdef CK_NEED_ARG_LIST
364 (
365  CK_SESSION_HANDLE hSession /* the session's handle */
366 );
367 #endif
368 
369 
370 
371 /* Encryption and decryption */
372 
373 /* C_EncryptInit initializes an encryption operation. */
374 CK_PKCS11_FUNCTION_INFO(C_EncryptInit)
375 #ifdef CK_NEED_ARG_LIST
376 (
377  CK_SESSION_HANDLE hSession, /* the session's handle */
378  CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */
379  CK_OBJECT_HANDLE hKey /* handle of encryption key */
380 );
381 #endif
382 
383 
384 /* C_Encrypt encrypts single-part data. */
385 CK_PKCS11_FUNCTION_INFO(C_Encrypt)
386 #ifdef CK_NEED_ARG_LIST
387 (
388  CK_SESSION_HANDLE hSession, /* session's handle */
389  CK_BYTE_PTR pData, /* the plaintext data */
390  CK_ULONG ulDataLen, /* bytes of plaintext */
391  CK_BYTE_PTR pEncryptedData, /* gets ciphertext */
392  CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */
393 );
394 #endif
395 
396 
397 /* C_EncryptUpdate continues a multiple-part encryption
398  * operation. */
399 CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate)
400 #ifdef CK_NEED_ARG_LIST
401 (
402  CK_SESSION_HANDLE hSession, /* session's handle */
403  CK_BYTE_PTR pPart, /* the plaintext data */
404  CK_ULONG ulPartLen, /* plaintext data len */
405  CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
406  CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */
407 );
408 #endif
409 
410 
411 /* C_EncryptFinal finishes a multiple-part encryption
412  * operation. */
413 CK_PKCS11_FUNCTION_INFO(C_EncryptFinal)
414 #ifdef CK_NEED_ARG_LIST
415 (
416  CK_SESSION_HANDLE hSession, /* session handle */
417  CK_BYTE_PTR pLastEncryptedPart, /* last c-text */
418  CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */
419 );
420 #endif
421 
422 
423 /* C_DecryptInit initializes a decryption operation. */
424 CK_PKCS11_FUNCTION_INFO(C_DecryptInit)
425 #ifdef CK_NEED_ARG_LIST
426 (
427  CK_SESSION_HANDLE hSession, /* the session's handle */
428  CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */
429  CK_OBJECT_HANDLE hKey /* handle of decryption key */
430 );
431 #endif
432 
433 
434 /* C_Decrypt decrypts encrypted data in a single part. */
435 CK_PKCS11_FUNCTION_INFO(C_Decrypt)
436 #ifdef CK_NEED_ARG_LIST
437 (
438  CK_SESSION_HANDLE hSession, /* session's handle */
439  CK_BYTE_PTR pEncryptedData, /* ciphertext */
440  CK_ULONG ulEncryptedDataLen, /* ciphertext length */
441  CK_BYTE_PTR pData, /* gets plaintext */
442  CK_ULONG_PTR pulDataLen /* gets p-text size */
443 );
444 #endif
445 
446 
447 /* C_DecryptUpdate continues a multiple-part decryption
448  * operation. */
449 CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate)
450 #ifdef CK_NEED_ARG_LIST
451 (
452  CK_SESSION_HANDLE hSession, /* session's handle */
453  CK_BYTE_PTR pEncryptedPart, /* encrypted data */
454  CK_ULONG ulEncryptedPartLen, /* input length */
455  CK_BYTE_PTR pPart, /* gets plaintext */
456  CK_ULONG_PTR pulPartLen /* p-text size */
457 );
458 #endif
459 
460 
461 /* C_DecryptFinal finishes a multiple-part decryption
462  * operation. */
463 CK_PKCS11_FUNCTION_INFO(C_DecryptFinal)
464 #ifdef CK_NEED_ARG_LIST
465 (
466  CK_SESSION_HANDLE hSession, /* the session's handle */
467  CK_BYTE_PTR pLastPart, /* gets plaintext */
468  CK_ULONG_PTR pulLastPartLen /* p-text size */
469 );
470 #endif
471 
472 
473 
474 /* Message digesting */
475 
476 /* C_DigestInit initializes a message-digesting operation. */
477 CK_PKCS11_FUNCTION_INFO(C_DigestInit)
478 #ifdef CK_NEED_ARG_LIST
479 (
480  CK_SESSION_HANDLE hSession, /* the session's handle */
481  CK_MECHANISM_PTR pMechanism /* the digesting mechanism */
482 );
483 #endif
484 
485 
486 /* C_Digest digests data in a single part. */
487 CK_PKCS11_FUNCTION_INFO(C_Digest)
488 #ifdef CK_NEED_ARG_LIST
489 (
490  CK_SESSION_HANDLE hSession, /* the session's handle */
491  CK_BYTE_PTR pData, /* data to be digested */
492  CK_ULONG ulDataLen, /* bytes of data to digest */
493  CK_BYTE_PTR pDigest, /* gets the message digest */
494  CK_ULONG_PTR pulDigestLen /* gets digest length */
495 );
496 #endif
497 
498 
499 /* C_DigestUpdate continues a multiple-part message-digesting
500  * operation. */
501 CK_PKCS11_FUNCTION_INFO(C_DigestUpdate)
502 #ifdef CK_NEED_ARG_LIST
503 (
504  CK_SESSION_HANDLE hSession, /* the session's handle */
505  CK_BYTE_PTR pPart, /* data to be digested */
506  CK_ULONG ulPartLen /* bytes of data to be digested */
507 );
508 #endif
509 
510 
511 /* C_DigestKey continues a multi-part message-digesting
512  * operation, by digesting the value of a secret key as part of
513  * the data already digested. */
514 CK_PKCS11_FUNCTION_INFO(C_DigestKey)
515 #ifdef CK_NEED_ARG_LIST
516 (
517  CK_SESSION_HANDLE hSession, /* the session's handle */
518  CK_OBJECT_HANDLE hKey /* secret key to digest */
519 );
520 #endif
521 
522 
523 /* C_DigestFinal finishes a multiple-part message-digesting
524  * operation. */
525 CK_PKCS11_FUNCTION_INFO(C_DigestFinal)
526 #ifdef CK_NEED_ARG_LIST
527 (
528  CK_SESSION_HANDLE hSession, /* the session's handle */
529  CK_BYTE_PTR pDigest, /* gets the message digest */
530  CK_ULONG_PTR pulDigestLen /* gets byte count of digest */
531 );
532 #endif
533 
534 
535 
536 /* Signing and MACing */
537 
538 /* C_SignInit initializes a signature (private key encryption)
539  * operation, where the signature is (will be) an appendix to
540  * the data, and plaintext cannot be recovered from the
541  *signature. */
542 CK_PKCS11_FUNCTION_INFO(C_SignInit)
543 #ifdef CK_NEED_ARG_LIST
544 (
545  CK_SESSION_HANDLE hSession, /* the session's handle */
546  CK_MECHANISM_PTR pMechanism, /* the signature mechanism */
547  CK_OBJECT_HANDLE hKey /* handle of signature key */
548 );
549 #endif
550 
551 
552 /* C_Sign signs (encrypts with private key) data in a single
553  * part, where the signature is (will be) an appendix to the
554  * data, and plaintext cannot be recovered from the signature. */
556 #ifdef CK_NEED_ARG_LIST
557 (
558  CK_SESSION_HANDLE hSession, /* the session's handle */
559  CK_BYTE_PTR pData, /* the data to sign */
560  CK_ULONG ulDataLen, /* count of bytes to sign */
561  CK_BYTE_PTR pSignature, /* gets the signature */
562  CK_ULONG_PTR pulSignatureLen /* gets signature length */
563 );
564 #endif
565 
566 
567 /* C_SignUpdate continues a multiple-part signature operation,
568  * where the signature is (will be) an appendix to the data,
569  * and plaintext cannot be recovered from the signature. */
570 CK_PKCS11_FUNCTION_INFO(C_SignUpdate)
571 #ifdef CK_NEED_ARG_LIST
572 (
573  CK_SESSION_HANDLE hSession, /* the session's handle */
574  CK_BYTE_PTR pPart, /* the data to sign */
575  CK_ULONG ulPartLen /* count of bytes to sign */
576 );
577 #endif
578 
579 
580 /* C_SignFinal finishes a multiple-part signature operation,
581  * returning the signature. */
582 CK_PKCS11_FUNCTION_INFO(C_SignFinal)
583 #ifdef CK_NEED_ARG_LIST
584 (
585  CK_SESSION_HANDLE hSession, /* the session's handle */
586  CK_BYTE_PTR pSignature, /* gets the signature */
587  CK_ULONG_PTR pulSignatureLen /* gets signature length */
588 );
589 #endif
590 
591 
592 /* C_SignRecoverInit initializes a signature operation, where
593  * the data can be recovered from the signature. */
594 CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit)
595 #ifdef CK_NEED_ARG_LIST
596 (
597  CK_SESSION_HANDLE hSession, /* the session's handle */
598  CK_MECHANISM_PTR pMechanism, /* the signature mechanism */
599  CK_OBJECT_HANDLE hKey /* handle of the signature key */
600 );
601 #endif
602 
603 
604 /* C_SignRecover signs data in a single operation, where the
605  * data can be recovered from the signature. */
606 CK_PKCS11_FUNCTION_INFO(C_SignRecover)
607 #ifdef CK_NEED_ARG_LIST
608 (
609  CK_SESSION_HANDLE hSession, /* the session's handle */
610  CK_BYTE_PTR pData, /* the data to sign */
611  CK_ULONG ulDataLen, /* count of bytes to sign */
612  CK_BYTE_PTR pSignature, /* gets the signature */
613  CK_ULONG_PTR pulSignatureLen /* gets signature length */
614 );
615 #endif
616 
617 
618 
619 /* Verifying signatures and MACs */
620 
621 /* C_VerifyInit initializes a verification operation, where the
622  * signature is an appendix to the data, and plaintext cannot
623  * cannot be recovered from the signature (e.g. DSA). */
624 CK_PKCS11_FUNCTION_INFO(C_VerifyInit)
625 #ifdef CK_NEED_ARG_LIST
626 (
627  CK_SESSION_HANDLE hSession, /* the session's handle */
628  CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
629  CK_OBJECT_HANDLE hKey /* verification key */
630 );
631 #endif
632 
633 
634 /* C_Verify verifies a signature in a single-part operation,
635  * where the signature is an appendix to the data, and plaintext
636  * cannot be recovered from the signature. */
637 CK_PKCS11_FUNCTION_INFO(C_Verify)
638 #ifdef CK_NEED_ARG_LIST
639 (
640  CK_SESSION_HANDLE hSession, /* the session's handle */
641  CK_BYTE_PTR pData, /* signed data */
642  CK_ULONG ulDataLen, /* length of signed data */
643  CK_BYTE_PTR pSignature, /* signature */
644  CK_ULONG ulSignatureLen /* signature length*/
645 );
646 #endif
647 
648 
649 /* C_VerifyUpdate continues a multiple-part verification
650  * operation, where the signature is an appendix to the data,
651  * and plaintext cannot be recovered from the signature. */
652 CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate)
653 #ifdef CK_NEED_ARG_LIST
654 (
655  CK_SESSION_HANDLE hSession, /* the session's handle */
656  CK_BYTE_PTR pPart, /* signed data */
657  CK_ULONG ulPartLen /* length of signed data */
658 );
659 #endif
660 
661 
662 /* C_VerifyFinal finishes a multiple-part verification
663  * operation, checking the signature. */
664 CK_PKCS11_FUNCTION_INFO(C_VerifyFinal)
665 #ifdef CK_NEED_ARG_LIST
666 (
667  CK_SESSION_HANDLE hSession, /* the session's handle */
668  CK_BYTE_PTR pSignature, /* signature to verify */
669  CK_ULONG ulSignatureLen /* signature length */
670 );
671 #endif
672 
673 
674 /* C_VerifyRecoverInit initializes a signature verification
675  * operation, where the data is recovered from the signature. */
676 CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit)
677 #ifdef CK_NEED_ARG_LIST
678 (
679  CK_SESSION_HANDLE hSession, /* the session's handle */
680  CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
681  CK_OBJECT_HANDLE hKey /* verification key */
682 );
683 #endif
684 
685 
686 /* C_VerifyRecover verifies a signature in a single-part
687  * operation, where the data is recovered from the signature. */
688 CK_PKCS11_FUNCTION_INFO(C_VerifyRecover)
689 #ifdef CK_NEED_ARG_LIST
690 (
691  CK_SESSION_HANDLE hSession, /* the session's handle */
692  CK_BYTE_PTR pSignature, /* signature to verify */
693  CK_ULONG ulSignatureLen, /* signature length */
694  CK_BYTE_PTR pData, /* gets signed data */
695  CK_ULONG_PTR pulDataLen /* gets signed data len */
696 );
697 #endif
698 
699 
700 
701 /* Dual-function cryptographic operations */
702 
703 /* C_DigestEncryptUpdate continues a multiple-part digesting
704  * and encryption operation. */
705 CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate)
706 #ifdef CK_NEED_ARG_LIST
707 (
708  CK_SESSION_HANDLE hSession, /* session's handle */
709  CK_BYTE_PTR pPart, /* the plaintext data */
710  CK_ULONG ulPartLen, /* plaintext length */
711  CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
712  CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */
713 );
714 #endif
715 
716 
717 /* C_DecryptDigestUpdate continues a multiple-part decryption and
718  * digesting operation. */
719 CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate)
720 #ifdef CK_NEED_ARG_LIST
721 (
722  CK_SESSION_HANDLE hSession, /* session's handle */
723  CK_BYTE_PTR pEncryptedPart, /* ciphertext */
724  CK_ULONG ulEncryptedPartLen, /* ciphertext length */
725  CK_BYTE_PTR pPart, /* gets plaintext */
726  CK_ULONG_PTR pulPartLen /* gets plaintext len */
727 );
728 #endif
729 
730 
731 /* C_SignEncryptUpdate continues a multiple-part signing and
732  * encryption operation. */
733 CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate)
734 #ifdef CK_NEED_ARG_LIST
735 (
736  CK_SESSION_HANDLE hSession, /* session's handle */
737  CK_BYTE_PTR pPart, /* the plaintext data */
738  CK_ULONG ulPartLen, /* plaintext length */
739  CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */
740  CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */
741 );
742 #endif
743 
744 
745 /* C_DecryptVerifyUpdate continues a multiple-part decryption and
746  * verify operation. */
747 CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate)
748 #ifdef CK_NEED_ARG_LIST
749 (
750  CK_SESSION_HANDLE hSession, /* session's handle */
751  CK_BYTE_PTR pEncryptedPart, /* ciphertext */
752  CK_ULONG ulEncryptedPartLen, /* ciphertext length */
753  CK_BYTE_PTR pPart, /* gets plaintext */
754  CK_ULONG_PTR pulPartLen /* gets p-text length */
755 );
756 #endif
757 
758 
759 
760 /* Key management */
761 
762 /* C_GenerateKey generates a secret key, creating a new key
763  * object. */
764 CK_PKCS11_FUNCTION_INFO(C_GenerateKey)
765 #ifdef CK_NEED_ARG_LIST
766 (
767  CK_SESSION_HANDLE hSession, /* the session's handle */
768  CK_MECHANISM_PTR pMechanism, /* key generation mech. */
769  CK_ATTRIBUTE_PTR pTemplate, /* template for new key */
770  CK_ULONG ulCount, /* # of attrs in template */
771  CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */
772 );
773 #endif
774 
775 
776 /* C_GenerateKeyPair generates a public-key/private-key pair,
777  * creating new key objects. */
778 CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair)
779 #ifdef CK_NEED_ARG_LIST
780 (
781  CK_SESSION_HANDLE hSession, /* session
782  * handle */
783  CK_MECHANISM_PTR pMechanism, /* key-gen
784  * mech. */
785  CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template
786  * for pub.
787  * key */
788  CK_ULONG ulPublicKeyAttributeCount, /* # pub.
789  * attrs. */
790  CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template
791  * for priv.
792  * key */
793  CK_ULONG ulPrivateKeyAttributeCount, /* # priv.
794  * attrs. */
795  CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub.
796  * key
797  * handle */
798  CK_OBJECT_HANDLE_PTR phPrivateKey /* gets
799  * priv. key
800  * handle */
801 );
802 #endif
803 
804 
805 /* C_WrapKey wraps (i.e., encrypts) a key. */
806 CK_PKCS11_FUNCTION_INFO(C_WrapKey)
807 #ifdef CK_NEED_ARG_LIST
808 (
809  CK_SESSION_HANDLE hSession, /* the session's handle */
810  CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */
811  CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */
812  CK_OBJECT_HANDLE hKey, /* key to be wrapped */
813  CK_BYTE_PTR pWrappedKey, /* gets wrapped key */
814  CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */
815 );
816 #endif
817 
818 
819 /* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new
820  * key object. */
821 CK_PKCS11_FUNCTION_INFO(C_UnwrapKey)
822 #ifdef CK_NEED_ARG_LIST
823 (
824  CK_SESSION_HANDLE hSession, /* session's handle */
825  CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */
826  CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */
827  CK_BYTE_PTR pWrappedKey, /* the wrapped key */
828  CK_ULONG ulWrappedKeyLen, /* wrapped key len */
829  CK_ATTRIBUTE_PTR pTemplate, /* new key template */
830  CK_ULONG ulAttributeCount, /* template length */
831  CK_OBJECT_HANDLE_PTR phKey /* gets new handle */
832 );
833 #endif
834 
835 
836 /* C_DeriveKey derives a key from a base key, creating a new key
837  * object. */
838 CK_PKCS11_FUNCTION_INFO(C_DeriveKey)
839 #ifdef CK_NEED_ARG_LIST
840 (
841  CK_SESSION_HANDLE hSession, /* session's handle */
842  CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */
843  CK_OBJECT_HANDLE hBaseKey, /* base key */
844  CK_ATTRIBUTE_PTR pTemplate, /* new key template */
845  CK_ULONG ulAttributeCount, /* template length */
846  CK_OBJECT_HANDLE_PTR phKey /* gets new handle */
847 );
848 #endif
849 
850 
851 
852 /* Random number generation */
853 
854 /* C_SeedRandom mixes additional seed material into the token's
855  * random number generator. */
856 CK_PKCS11_FUNCTION_INFO(C_SeedRandom)
857 #ifdef CK_NEED_ARG_LIST
858 (
859  CK_SESSION_HANDLE hSession, /* the session's handle */
860  CK_BYTE_PTR pSeed, /* the seed material */
861  CK_ULONG ulSeedLen /* length of seed material */
862 );
863 #endif
864 
865 
866 
867 /* C_GenerateRandom generates random data. */
868 CK_PKCS11_FUNCTION_INFO(C_GenerateRandom)
869 #ifdef CK_NEED_ARG_LIST
870 (
871  CK_SESSION_HANDLE hSession, /* the session's handle */
872  CK_BYTE_PTR RandomData, /* receives the random data */
873  CK_ULONG ulRandomLen /* # of bytes to generate */
874 );
875 #endif
876 
877 
878 
879 /* Parallel function management */
880 
881 /* C_GetFunctionStatus is a legacy function; it obtains an
882  * updated status of a function running in parallel with an
883  * application. */
884 CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus)
885 #ifdef CK_NEED_ARG_LIST
886 (
887  CK_SESSION_HANDLE hSession /* the session's handle */
888 );
889 #endif
890 
891 
892 /* C_CancelFunction is a legacy function; it cancels a function
893  * running in parallel. */
894 CK_PKCS11_FUNCTION_INFO(C_CancelFunction)
895 #ifdef CK_NEED_ARG_LIST
896 (
897  CK_SESSION_HANDLE hSession /* the session's handle */
898 );
899 #endif
900 
901 
902 
903 /* Functions added in for Cryptoki Version 2.01 or later */
904 
905 /* C_WaitForSlotEvent waits for a slot event (token insertion,
906  * removal, etc.) to occur. */
907 CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent)
908 #ifdef CK_NEED_ARG_LIST
909 (
910  CK_FLAGS flags, /* blocking/nonblocking flag */
911  CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */
912  CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */
913 );
914 #endif