1*00b67f09SDavid van Moolenbroek /* $NetBSD: cryptoki.h,v 1.1.1.3 2014/12/10 03:34:45 christos Exp $ */ 2*00b67f09SDavid van Moolenbroek 3*00b67f09SDavid van Moolenbroek /* cryptoki.h include file for PKCS #11. */ 4*00b67f09SDavid van Moolenbroek /* Revision: 1.2 */ 5*00b67f09SDavid van Moolenbroek 6*00b67f09SDavid van Moolenbroek /* License to copy and use this software is granted provided that it is 7*00b67f09SDavid van Moolenbroek * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface 8*00b67f09SDavid van Moolenbroek * (Cryptoki)" in all material mentioning or referencing this software. 9*00b67f09SDavid van Moolenbroek 10*00b67f09SDavid van Moolenbroek * License is also granted to make and use derivative works provided that 11*00b67f09SDavid van Moolenbroek * such works are identified as "derived from the RSA Security Inc. PKCS #11 12*00b67f09SDavid van Moolenbroek * Cryptographic Token Interface (Cryptoki)" in all material mentioning or 13*00b67f09SDavid van Moolenbroek * referencing the derived work. 14*00b67f09SDavid van Moolenbroek 15*00b67f09SDavid van Moolenbroek * RSA Security Inc. makes no representations concerning either the 16*00b67f09SDavid van Moolenbroek * merchantability of this software or the suitability of this software for 17*00b67f09SDavid van Moolenbroek * any particular purpose. It is provided "as is" without express or implied 18*00b67f09SDavid van Moolenbroek * warranty of any kind. 19*00b67f09SDavid van Moolenbroek */ 20*00b67f09SDavid van Moolenbroek 21*00b67f09SDavid van Moolenbroek /* This is a sample file containing the top level include directives 22*00b67f09SDavid van Moolenbroek * for building Win32 Cryptoki libraries and applications. 23*00b67f09SDavid van Moolenbroek */ 24*00b67f09SDavid van Moolenbroek 25*00b67f09SDavid van Moolenbroek #ifndef ___CRYPTOKI_H_INC___ 26*00b67f09SDavid van Moolenbroek #define ___CRYPTOKI_H_INC___ 27*00b67f09SDavid van Moolenbroek 28*00b67f09SDavid van Moolenbroek #pragma pack(push, cryptoki, 1) 29*00b67f09SDavid van Moolenbroek 30*00b67f09SDavid van Moolenbroek /* Specifies that the function is a DLL entry point. */ 31*00b67f09SDavid van Moolenbroek #define CK_IMPORT_SPEC __declspec(dllimport) 32*00b67f09SDavid van Moolenbroek 33*00b67f09SDavid van Moolenbroek /* Define CRYPTOKI_EXPORTS during the build of cryptoki libraries. Do 34*00b67f09SDavid van Moolenbroek * not define it in applications. 35*00b67f09SDavid van Moolenbroek */ 36*00b67f09SDavid van Moolenbroek #ifdef CRYPTOKI_EXPORTS 37*00b67f09SDavid van Moolenbroek /* Specified that the function is an exported DLL entry point. */ 38*00b67f09SDavid van Moolenbroek #define CK_EXPORT_SPEC __declspec(dllexport) 39*00b67f09SDavid van Moolenbroek #else 40*00b67f09SDavid van Moolenbroek #define CK_EXPORT_SPEC CK_IMPORT_SPEC 41*00b67f09SDavid van Moolenbroek #endif 42*00b67f09SDavid van Moolenbroek 43*00b67f09SDavid van Moolenbroek /* Ensures the calling convention for Win32 builds */ 44*00b67f09SDavid van Moolenbroek #define CK_CALL_SPEC __cdecl 45*00b67f09SDavid van Moolenbroek 46*00b67f09SDavid van Moolenbroek #define CK_PTR * 47*00b67f09SDavid van Moolenbroek 48*00b67f09SDavid van Moolenbroek #define CK_DEFINE_FUNCTION(returnType, name) \ 49*00b67f09SDavid van Moolenbroek returnType CK_EXPORT_SPEC CK_CALL_SPEC name 50*00b67f09SDavid van Moolenbroek 51*00b67f09SDavid van Moolenbroek #define CK_DECLARE_FUNCTION(returnType, name) \ 52*00b67f09SDavid van Moolenbroek returnType CK_EXPORT_SPEC CK_CALL_SPEC name 53*00b67f09SDavid van Moolenbroek 54*00b67f09SDavid van Moolenbroek #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ 55*00b67f09SDavid van Moolenbroek returnType CK_IMPORT_SPEC (CK_CALL_SPEC CK_PTR name) 56*00b67f09SDavid van Moolenbroek 57*00b67f09SDavid van Moolenbroek #define CK_CALLBACK_FUNCTION(returnType, name) \ 58*00b67f09SDavid van Moolenbroek returnType (CK_CALL_SPEC CK_PTR name) 59*00b67f09SDavid van Moolenbroek 60*00b67f09SDavid van Moolenbroek #ifndef NULL_PTR 61*00b67f09SDavid van Moolenbroek #define NULL_PTR 0 62*00b67f09SDavid van Moolenbroek #endif 63*00b67f09SDavid van Moolenbroek 64*00b67f09SDavid van Moolenbroek #include <pkcs11/pkcs11.h> 65*00b67f09SDavid van Moolenbroek 66*00b67f09SDavid van Moolenbroek #pragma pack(pop, cryptoki) 67*00b67f09SDavid van Moolenbroek 68*00b67f09SDavid van Moolenbroek #endif /* ___CRYPTOKI_H_INC___ */ 69