1- /* Copyright (c) OASIS Open 2016. All Rights Reserved./
1+ /*
2+ * PKCS #11 Specification Version 3.1
3+ * OASIS Standard
4+ * 23 July 2023
5+ * Copyright (c) OASIS Open 2023. All Rights Reserved.
6+ * Source: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/os/include/pkcs11-v3.1/
7+ * Latest stage of narrative specification: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/pkcs11-spec-v3.1.html
8+ * TC IPR Statement: https://www.oasis-open.org/committees/pkcs11/ipr.php
29 * /Distributed under the terms of the OASIS IPR Policy,
3- * [http ://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
10+ * [https ://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
411 * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
512 * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others.
613 */
7-
8- /* Latest version of the specification:
9- * http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
10- */
1114
1215#ifndef _PKCS11_H_
1316#define _PKCS11_H_ 1
@@ -29,8 +32,7 @@ extern "C" {
2932 * convention on packing is that structures should be 1-byte
3033 * aligned.
3134 *
32- * If you're using Microsoft Developer Studio 5.0 to produce
33- * Win32 stuff, this might be done by using the following
35+ * If you're using Windows this might be done by using the following
3436 * preprocessor directive before including pkcs11.h or pkcs11t.h:
3537 *
3638 * #pragma pack(push, cryptoki, 1)
@@ -40,13 +42,6 @@ extern "C" {
4042 *
4143 * #pragma pack(pop, cryptoki)
4244 *
43- * If you're using an earlier version of Microsoft Developer
44- * Studio to produce Win16 stuff, this might be done by using
45- * the following preprocessor directive before including
46- * pkcs11.h or pkcs11t.h:
47- *
48- * #pragma pack(1)
49- *
5045 * In a UNIX environment, you're on your own for this. You might
5146 * not need to do (or be able to do!) anything.
5247 *
@@ -59,16 +54,10 @@ extern "C" {
5954 *
6055 * typedef CK_BYTE CK_PTR CK_BYTE_PTR;
6156 *
62- * If you're using Microsoft Developer Studio 5.0 to produce
63- * Win32 stuff, it might be defined by:
57+ * If you're using Windows, it might be defined by:
6458 *
6559 * #define CK_PTR *
6660 *
67- * If you're using an earlier version of Microsoft Developer
68- * Studio to produce Win16 stuff, it might be defined by:
69- *
70- * #define CK_PTR far *
71- *
7261 * In a typical UNIX environment, it might be defined by:
7362 *
7463 * #define CK_PTR *
@@ -83,19 +72,12 @@ extern "C" {
8372 * CK_VOID_PTR pReserved
8473 * );
8574 *
86- * If you're using Microsoft Developer Studio 5.0 to declare a
87- * function in a Win32 Cryptoki .dll, it might be defined by:
75+ * If you're using Windows to declare a function in a Win32 Cryptoki .dll,
76+ * it might be defined by:
8877 *
8978 * #define CK_DECLARE_FUNCTION(returnType, name) \
9079 * returnType __declspec(dllimport) name
9180 *
92- * If you're using an earlier version of Microsoft Developer
93- * Studio to declare a function in a Win16 Cryptoki .dll, it
94- * might be defined by:
95- *
96- * #define CK_DECLARE_FUNCTION(returnType, name) \
97- * returnType __export _far _pascal name
98- *
9981 * In a UNIX environment, it might be defined by:
10082 *
10183 * #define CK_DECLARE_FUNCTION(returnType, name) \
@@ -120,19 +102,12 @@ extern "C" {
120102 * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args);
121103 * funcPtrType funcPtr;
122104 *
123- * If you're using Microsoft Developer Studio 5.0 to access
105+ * If you're using Windows to access
124106 * functions in a Win32 Cryptoki .dll, in might be defined by:
125107 *
126108 * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
127109 * returnType __declspec(dllimport) (* name)
128110 *
129- * If you're using an earlier version of Microsoft Developer
130- * Studio to access functions in a Win16 Cryptoki .dll, it might
131- * be defined by:
132- *
133- * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
134- * returnType __export _far _pascal (* name)
135- *
136111 * In a UNIX environment, it might be defined by:
137112 *
138113 * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \
@@ -153,18 +128,11 @@ extern "C" {
153128 * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args);
154129 * myCallbackType myCallback;
155130 *
156- * If you're using Microsoft Developer Studio 5.0 to do Win32
157- * Cryptoki development, it might be defined by:
131+ * If you're using Windows, it might be defined by:
158132 *
159133 * #define CK_CALLBACK_FUNCTION(returnType, name) \
160134 * returnType (* name)
161135 *
162- * If you're using an earlier version of Microsoft Developer
163- * Studio to do Win16 development, it might be defined by:
164- *
165- * #define CK_CALLBACK_FUNCTION(returnType, name) \
166- * returnType _far _pascal (* name)
167- *
168136 * In a UNIX environment, it might be defined by:
169137 *
170138 * #define CK_CALLBACK_FUNCTION(returnType, name) \
@@ -240,6 +208,22 @@ extern "C" {
240208#define CK_PKCS11_FUNCTION_INFO (name ) \
241209 __PASTE(CK_,name) name;
242210
211+ /* Create the 3.0 Function list */
212+ struct CK_FUNCTION_LIST_3_0 {
213+
214+ CK_VERSION version ; /* Cryptoki version */
215+
216+ /* Pile all the function pointers into the CK_FUNCTION_LIST. */
217+ /* pkcs11f.h has all the information about the Cryptoki
218+ * function prototypes.
219+ */
220+ #include "pkcs11f.h"
221+
222+ };
223+
224+ #define CK_PKCS11_2_0_ONLY 1
225+
226+ /* Continue to define the old CK_FUNCTION_LIST */
243227struct CK_FUNCTION_LIST {
244228
245229 CK_VERSION version ; /* Cryptoki version */
@@ -253,6 +237,7 @@ struct CK_FUNCTION_LIST {
253237};
254238
255239#undef CK_PKCS11_FUNCTION_INFO
240+ #undef CK_PKCS11_2_0_ONLY
256241
257242
258243#undef __PASTE
@@ -261,5 +246,4 @@ struct CK_FUNCTION_LIST {
261246}
262247#endif
263248
264- #endif /* _PKCS11_H_ */
265-
249+ #endif /* _PKCS11_H_ */
0 commit comments