17 #define CK_DEFINE_FUNCTION( returnType, name ) \
18 returnType __export _far _pascal name
19 #define CK_DECLARE_FUNCTION( returnType, name ) \
20 returnType __export _far _pascal name
21 #define CK_DECLARE_FUNCTION_POINTER( returnType, name ) \
22 returnType __export _far _pascal (* name)
23 #define CK_CALLBACK_FUNCTION( returnType, name ) \
24 returnType (_far _pascal * name)
26 #pragma pack( push, cryptoki, 1 )
28 #define CK_DEFINE_FUNCTION( returnType, name ) \
29 returnType __declspec( dllexport ) name
30 #define CK_DECLARE_FUNCTION( returnType, name ) \
31 returnType __declspec( dllimport ) name
32 #define CK_DECLARE_FUNCTION_POINTER( returnType, name ) \
33 returnType __declspec( dllimport ) (* name)
34 #define CK_CALLBACK_FUNCTION( returnType, name ) \
39 #define CK_DEFINE_FUNCTION( returnType, name ) \
41 #define CK_DECLARE_FUNCTION( returnType, name ) \
43 #define CK_DECLARE_FUNCTION_POINTER( returnType, name ) \
45 #define CK_CALLBACK_FUNCTION( returnType, name ) \
54 #if defined( INC_ALL )
66 #define MAX_BUFFER_SIZE 1024
73 #define C_CloseSession ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_CloseSession
74 #define C_CreateObject ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_CreateObject
75 #define C_Decrypt ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Decrypt
76 #define C_DecryptInit ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_DecryptInit
77 #define C_DeriveKey ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_DeriveKey
78 #define C_DestroyObject ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_DestroyObject
79 #define C_Digest ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Digest
80 #define C_DigestInit ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_DigestInit
81 #define C_Encrypt ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Encrypt
82 #define C_EncryptInit ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_EncryptInit
83 #define C_Finalize ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Finalize
84 #define C_FindObjects ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_FindObjects
85 #define C_FindObjectsFinal ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_FindObjectsFinal
86 #define C_FindObjectsInit ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_FindObjectsInit
87 #define C_GenerateKey ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GenerateKey
88 #define C_GenerateKeyPair ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GenerateKeyPair
89 #define C_GenerateRandom ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GenerateRandom
90 #define C_GetAttributeValue ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GetAttributeValue
91 #define C_GetMechanismInfo ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GetMechanismInfo
92 #define C_GetInfo ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GetInfo
93 #define C_GetSlotInfo ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GetSlotInfo
94 #define C_GetSlotList ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GetSlotList
95 #define C_GetTokenInfo ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_GetTokenInfo
96 #define C_Initialize ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Initialize
97 #define C_InitPIN ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_InitPIN
98 #define C_InitToken ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_InitToken
99 #define C_Login ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Login
100 #define C_Logout ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Logout
101 #define C_OpenSession ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_OpenSession
102 #define C_SetAttributeValue ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_SetAttributeValue
103 #define C_SetPIN ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_SetPIN
104 #define C_Sign ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Sign
105 #define C_SignFinal ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_SignFinal
106 #define C_SignInit ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_SignInit
107 #define C_SignUpdate ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_SignUpdate
108 #define C_Verify ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_Verify
109 #define C_VerifyInit ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_VerifyInit
110 #define C_WrapKey ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_WrapKey
111 #define C_UnwrapKey ( ( CK_FUNCTION_LIST_PTR )( pkcs11Info->functionListPtr ) )->C_UnwrapKey
165 } PKCS11_MECHANISM_INFO;
171 #define paramKeyType param1
172 #define paramKeyGen param2
173 #define paramDefaultMech param3
184 #define CKM_NONE ( ( CK_MECHANISM_TYPE ) CRYPT_ERROR )
185 #define CK_OBJECT_NONE ( ( CK_OBJECT_HANDLE ) CRYPT_ERROR )
186 #define CKA_NONE ( ( CK_ATTRIBUTE_TYPE ) CRYPT_ERROR )
197 #define VENDOR_NCIPHER 0xDE436972UL
198 #define CKA_NCIPHER ( CKA_VENDOR_DEFINED | VENDOR_NCIPHER )
199 #define CKM_NCIPHER ( CKM_VENDOR_DEFINED | VENDOR_NCIPHER )
200 #define CKK_NCIPHER ( CKK_VENDOR_DEFINED | VENDOR_NCIPHER )
202 #ifdef NCIPHER_PKCS11
203 #define CKK_MD5_HMAC ( CKK_NCIPHER + 2 )
204 #define CKK_SHA_1_HMAC ( CKK_NCIPHER + 1 )
205 #define CKK_RIPEMD160_HMAC CKK_GENERIC_SECRET
206 #define CKK_SHA256_HMAC CKK_GENERIC_SECRET
207 #define CKM_MD5_HMAC_KEY_GEN ( CKM_NCIPHER + 6 )
208 #define CKM_SHA_1_HMAC_KEY_GEN ( CKM_NCIPHER + 3 )
209 #define CKM_RIPEMD160_HMAC_KEY_GEN CKK_GENERIC_SECRET
210 #define CKM_SHA256_HMAC_KEY_GEN CKK_GENERIC_SECRET
212 #define CKK_MD5_HMAC CKK_GENERIC_SECRET
213 #define CKK_SHA_1_HMAC CKK_GENERIC_SECRET
214 #define CKK_RIPEMD160_HMAC CKK_GENERIC_SECRET
215 #define CKK_SHA256_HMAC CKK_GENERIC_SECRET
216 #define CKM_MD5_HMAC_KEY_GEN CKM_GENERIC_SECRET_KEY_GEN
217 #define CKM_SHA_1_HMAC_KEY_GEN CKM_GENERIC_SECRET_KEY_GEN
218 #define CKM_RIPEMD160_HMAC_KEY_GEN CKK_GENERIC_SECRET
219 #define CKM_SHA256_HMAC_KEY_GEN CKM_GENERIC_SECRET_KEY_GEN
234 const PKCS11_MECHANISM_INFO *getMechanismInfoConv(
OUT_LENGTH_SHORT int *mechanismInfoSize );
236 int genericEndFunction(
const CONTEXT_INFO *contextInfoPtr );
243 const char *
name,
const int nameLength ) \
244 STDC_NONNULL_ARG( ( 1, 2 ) );
249 const PKCS11_MECHANISM_INFO *getMechanismInfoPKC(
OUT int *mechanismInfoSize ) \
250 STDC_NONNULL_ARG( ( 1 ) );
256 IN_BUFFER( iAndSLength )
const void *iAndSPtr,
276 STDC_NONNULL_ARG( ( 1 ) );
278 STDC_NONNULL_ARG( ( 1 ) );