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