2 * Copyright (C) 2002 Travis Michielsen
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_WINCRYPT_H
20 #define __WINE_WINCRYPT_H
24 /* some typedefs for function parameters */
25 typedef unsigned int ALG_ID;
26 typedef unsigned long HCRYPTPROV;
27 typedef unsigned long HCRYPTKEY;
28 typedef unsigned long HCRYPTHASH;
32 typedef struct _CRYPTOAPI_BLOB {
35 } CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
36 CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB,
37 CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
38 CERT_NAME_BLOB, *PCERT_NAME_BLOB,
39 CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
40 CERT_BLOB, *PCERT_BLOB,
42 DATA_BLOB, *PDATA_BLOB,
43 CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB,
44 CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB,
45 CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB,
46 CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
47 CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
49 typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
51 CRYPT_OBJID_BLOB Parameters;
52 } CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
54 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
56 CRYPT_OBJID_BLOB Value;
57 } CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
59 typedef struct _PUBLICKEYSTRUC {
64 } BLOBHEADER, PUBLICKEYSTRUC;
68 #define GET_ALG_CLASS(x) (x & (7 << 13))
69 #define GET_ALG_TYPE(x) (x & (15 << 9))
70 #define GET_ALG_SID(x) (x & (511))
72 /* Algorithm Classes */
73 #define ALG_CLASS_ANY (0)
74 #define ALG_CLASS_SIGNATURE (1 << 13)
75 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
76 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
77 #define ALG_CLASS_HASH (4 << 13)
78 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
80 #define ALG_TYPE_ANY (0)
81 #define ALG_TYPE_DSS (1 << 9)
82 #define ALG_TYPE_RSA (2 << 9)
83 #define ALG_TYPE_BLOCK (3 << 9)
84 #define ALG_TYPE_STREAM (4 << 9)
87 #define ALG_SID_ANY (0)
89 #define ALG_SID_RSA_ANY 0
90 #define ALG_SID_RSA_PKCS 1
91 #define ALG_SID_RSA_MSATWORK 2
92 #define ALG_SID_RSA_ENTRUST 3
93 #define ALG_SID_RSA_PGP 4
95 #define ALG_SID_DSS_ANY 0
96 #define ALG_SID_DSS_PKCS 1
97 #define ALG_SID_DSS_DMS 2
100 #define ALG_SID_DES 1
101 #define ALG_SID_3DES 3
102 #define ALG_SID_DESX 4
103 #define ALG_SID_IDEA 5
104 #define ALG_SID_CAST 6
105 #define ALG_SID_SAFERSK64 7
106 #define ALD_SID_SAFERSK128 8
108 #define ALG_SID_RC4 1
109 #define ALG_SID_RC2 2
110 #define ALG_SID_SEAL 2
112 #define ALG_SID_MD2 1
113 #define ALG_SID_MD4 2
114 #define ALG_SID_MD5 3
115 #define ALG_SID_SHA 4
116 #define ALG_SID_MAC 5
117 #define ALG_SID_RIPEMD 6
118 #define ALG_SID_RIPEMD160 7
119 #define ALG_SID_SSL3SHAMD5 8
121 /* Algorithm Definitions */
122 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
123 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
124 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
125 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
126 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
127 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
128 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
129 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
130 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
131 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
132 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
133 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
136 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
137 #if defined(__GNUC__)
138 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
139 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
140 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
141 #elif defined(_MSC_VER)
142 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
144 static const WCHAR MS_DEF_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
145 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
146 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
148 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
150 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
151 #if defined(__GNUC__)
152 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
153 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
154 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
155 #elif defined(_MSC_VER)
156 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
158 static const WCHAR MS_ENHANCED_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
159 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
160 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
162 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
164 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
165 #if defined(__GNUC__)
166 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
167 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
168 'P','r','o','v','i','d','e','r',0 }
169 #elif defined(_MSC_VER)
170 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
172 static const WCHAR MS_STRONG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
173 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
174 'P','r','o','v','i','d','e','r',0 };
176 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
178 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
179 #if defined(__GNUC__)
180 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
181 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
182 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
183 #elif defined(_MSC_VER)
184 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
186 static const WCHAR MS_DEF_RSA_SIG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
187 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
188 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
190 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
192 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
193 #if defined(__GNUC__)
194 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
195 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
196 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
197 #elif defined(_MSC_VER)
198 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
200 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
201 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
202 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
204 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
206 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
207 #if defined(__GNUC__)
208 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
209 'B','a','s','e',' ','D','S','S',' ', \
210 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
211 #elif defined(_MSC_VER)
212 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
214 static const WCHAR MS_DEF_DSS_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
215 'B','a','s','e',' ','D','S','S',' ',
216 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
218 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
220 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
221 #if defined(__GNUC__)
222 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
223 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
224 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
225 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
226 #elif defined(_MSC_VER)
227 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
229 static const WCHAR MS_DEF_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
230 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
231 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
232 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
234 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
236 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
237 #if defined(__GNUC__)
238 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
239 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
240 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
241 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
242 #elif defined(_MSC_VER)
243 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
245 static const WCHAR MS_ENH_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
246 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
247 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
248 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
250 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
252 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
253 #if defined(__GNUC__)
254 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
255 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
256 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
257 #elif defined(_MSC_VER)
258 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
260 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
261 'D','H',' ','S','C','h','a','n','n','e','l',' ',
262 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
264 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
266 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
267 #if defined(__GNUC__)
268 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
269 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
270 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
271 #elif defined(_MSC_VER)
272 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
274 static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
275 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
276 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
278 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
281 #define AT_KEYEXCHANGE 1
282 #define AT_SIGNATURE 2
285 #define PROV_RSA_FULL 1
286 #define PROV_RSA_SIG 2
288 #define PROV_FORTEZZA 4
289 #define PROV_MS_EXCHANGE 5
291 #define PROV_RSA_SCHANNEL 12
292 #define PROV_DSS_DH 13
293 #define PROV_EC_ECDSA_SIG 14
294 #define PROV_EC_ECNRA_SIG 15
295 #define PROV_EC_ECDSA_FULL 16
296 #define PROV_EC_ECNRA_FULL 17
297 #define PROV_DH_SCHANNEL 18
298 #define PROV_SPYRUS_LYNKS 20
300 #define PROV_INTEL_SEC 22
301 #define PROV_REPLACE_OWF 23
302 #define PROV_RSA_AES 24
306 /* Provider Parameters */
307 #define PP_ENUMALGS 1
308 #define PP_ENUMCONTAINERS 2
312 #define PP_CONTAINER 6
314 #define CRYPT_FIRST 1
317 #define CRYPT_IMPL_HARDWARE 1
318 #define CRYPT_IMPL_SOFTWARE 2
319 #define CRYPT_IMPL_MIXED 3
320 #define CRYPT_IMPL_UNKNOWN 4
322 /* CryptAcquireContext */
323 #define CRYPT_VERIFYCONTEXT 0xF0000000
324 #define CRYPT_NEWKEYSET 0x00000008
325 #define CRYPT_MACHINE_KEYSET 0x00000000
326 #define CRYPT_DELETEKEYSET 0x00000010
327 #define CRYPT_SILENT 0x00000000
329 /* Crypt{Get|Set}Provider */
330 #define CRYPT_MACHINE_DEFAULT 0x00000001
331 #define CRYPT_USER_DEFAULT 0x00000002
332 #define CRYPT_DELETE_DEFAULT 0x00000004
334 /* Crypt{Get/Set}ProvParam */
335 #define PP_CLIENT_HWND 1
336 #define PP_ENUMALGS 1
337 #define PP_ENUMCONTAINERS 2
341 #define PP_CONTAINER 6
342 #define PP_CHANGE_PASSWORD 7
343 #define PP_KEYSET_SEC_DESCR 8
344 #define PP_KEY_TYPE_SUBTYPE 10
345 #define PP_CONTEXT_INFO 11
346 #define PP_KEYEXCHANGE_KEYSIZE 12
347 #define PP_SIGNATURE_KEYSIZE 13
348 #define PP_KEYEXCHANGE_ALG 14
349 #define PP_SIGNATURE_ALG 15
350 #define PP_PROVTYPE 16
351 #define PP_KEYSTORAGE 17
352 #define PP_SYM_KEYSIZE 19
353 #define PP_SESSION_KEYSIZE 20
354 #define PP_UI_PROMPT 21
355 #define PP_ENUMALGS_EX 22
356 #define PP_DELETEKEY 24
357 #define PP_ENUMMANDROOTS 25
358 #define PP_ENUMELECTROOTS 26
359 #define PP_KEYSET_TYPE 27
360 #define PP_ADMIN_PIN 31
361 #define PP_KEYEXCHANGE_PIN 32
362 #define PP_SIGNATURE_PIN 33
363 #define PP_SIG_KEYSIZE_INC 34
364 #define PP_KEYX_KEYSIZE_INC 35
365 #define PP_UNIQUE_CONTAINER 36
366 #define PP_SGC_INFO 37
367 #define PP_USE_HARDWARE_RNG 38
368 #define PP_KEYSPEC 39
369 #define PP_ENUMEX_SIGNING_PROT 40
371 /* CryptSignHash/CryptVerifySignature */
372 #define CRYPT_NOHASHOID 0x00000001
373 #define CRYPT_TYPE2_FORMAT 0x00000002
374 #define CRYPT_X931_FORMAT 0x00000004
377 #define CRYPT_EXPORTABLE 0x00000001
378 #define CRYPT_USER_PROTECTED 0x00000002
379 #define CRYPT_CREATE_SALT 0x00000004
380 #define CRYPT_UPDATE_KEY 0x00000008
381 #define CRYPT_NO_SALT 0x00000010
382 #define CRYPT_PREGEN 0x00000040
383 #define CRYPT_ARCHIVABLE 0x00004000
384 #define CRYPT_SSL2_FALLBACK 0x00000002
385 #define CRYPT_DESTROYKEY 0x00000004
386 #define CRYPT_OAEP 0x00000040
389 #define SIMPLEBLOB 0x1
390 #define PUBLICKEYBLOB 0x6
391 #define PRIVATEKEYBLOB 0x7
392 #define PLAINTEXTKEYBLOB 0x8
393 #define OPAQUEKEYBLOB 0x9
394 #define PUBLICKEYBLOBEX 0xA
395 #define SYMMETRICWRAPKEYBLOB 0xB
397 /* function declarations */
399 BOOL WINAPI CryptAcquireContextA(HCRYPTPROV *phProv, LPCSTR pszContainer,
400 LPCSTR pszProvider, DWORD dwProvType,
402 BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
403 LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags);
404 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
405 BOOL WINAPI CryptGenRandom (HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer);
406 BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFlags);
407 BOOL WINAPI CryptCreateHash (HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey,
408 DWORD dwFlags, HCRYPTHASH *phHash);
409 BOOL WINAPI CryptDecrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
410 DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
411 BOOL WINAPI CryptDeriveKey (HCRYPTPROV hProv, ALG_ID Algid, HCRYPTHASH hBaseData,
412 DWORD dwFlags, HCRYPTKEY *phKey);
413 BOOL WINAPI CryptDestroyHash (HCRYPTHASH hHash);
414 BOOL WINAPI CryptDestroyKey (HCRYPTKEY hKey);
415 BOOL WINAPI CryptDuplicateKey (HCRYPTKEY hKey, DWORD *pdwReserved, DWORD dwFlags, HCRYPTKEY *phKey);
416 BOOL WINAPI CryptDuplicateHash (HCRYPTHASH hHash, DWORD *pdwReserved,
417 DWORD dwFlags, HCRYPTHASH *phHash);
418 BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
419 DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen, DWORD dwBufLen);
420 BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
421 DWORD dwFlags, DWORD *pdwProvType, LPSTR pszProvName, DWORD *pcbProvName);
422 BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved,
423 DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszProvName, DWORD *pcbProvName);
424 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
425 BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
426 DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName);
427 BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
428 DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszTypeName, DWORD *pcbTypeName);
429 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
430 BOOL WINAPI CryptExportKey (HCRYPTKEY hKey, HCRYPTKEY hExpKey, DWORD dwBlobType,
431 DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
432 BOOL WINAPI CryptGenKey (HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKEY *phKey);
433 BOOL WINAPI CryptGetKeyParam (HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData,
434 DWORD *pdwDataLen, DWORD dwFlags);
435 BOOL WINAPI CryptGetHashParam (HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData,
436 DWORD *pdwDataLen, DWORD dwFlags);
437 BOOL WINAPI CryptGetProvParam (HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData,
438 DWORD *pdwDataLen, DWORD dwFlags);
439 BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved,
440 DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName);
441 BOOL WINAPI CryptGetDefaultProviderW (DWORD dwProvType, DWORD *pdwReserved,
442 DWORD dwFlags, LPWSTR pszProvName, DWORD *pcbProvName);
443 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
444 BOOL WINAPI CryptGetUserKey (HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUserKey);
445 BOOL WINAPI CryptHashData (HCRYPTHASH hHash, BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
446 BOOL WINAPI CryptHashSessionKey (HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags);
447 BOOL WINAPI CryptImportKey (HCRYPTPROV hProv, BYTE *pbData, DWORD dwDataLen,
448 HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey);
449 BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags);
450 BOOL WINAPI CryptSignHashA (HCRYPTHASH hHash, DWORD dwKeySpec, LPCSTR sDescription,
451 DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen);
452 /*BOOL WINAPI CryptSignHashW (HCRYPTHASH hHash, DWORD dwKeySpec, LPCWSTR sDescription,
453 DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen);*/
454 #define CryptSignHashW(hHash, dwKeySpec, sDescription, dwFlags, pbSignature, pdwSigLen) \\
455 CryptSignHashA(hHash, dwKeySpec, (LPCSTR)sDescription, dwFlags, pbSignature, pdwSigLen)
456 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
457 BOOL WINAPI CryptSetHashParam (HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD dwFlags);
458 BOOL WINAPI CryptSetKeyParam (HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD dwFlags);
459 BOOL WINAPI CryptSetProviderA (LPCSTR pszProvName, DWORD dwProvType);
460 BOOL WINAPI CryptSetProviderW (LPCWSTR pszProvName, DWORD dwProvType);
461 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
462 BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags);
463 BOOL WINAPI CryptSetProviderExW (LPCWSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags);
464 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
465 BOOL WINAPI CryptSetProvParam (HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD dwFlags);
466 BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH hHash, BYTE *pbSignature, DWORD dwSigLen,
467 HCRYPTKEY hPubKey, LPCSTR sDescription, DWORD dwFlags);
468 /*BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH hHash, BYTE *pbSignature, DWORD dwSigLen,
469 HCRYPTKEY hPubKey, LPCWSTR sDescription, DWORD dwFlags);*/
470 #define CryptVerifySignatureW(hHash, pbSignature, dwSigLen, hPubKey, sDescription, dwFlags) \\
471 CryptVerifySignatureA(hHash, pbSignature, dwSigLen, hPubKey, (LPCSTR)sDescription, dwFlags)
472 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)