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
26 /* some typedefs for function parameters */
27 typedef unsigned int ALG_ID
;
28 typedef unsigned long HCRYPTPROV
;
29 typedef unsigned long HCRYPTKEY
;
30 typedef unsigned long HCRYPTHASH
;
31 typedef void *HCERTSTORE
;
35 typedef struct _CRYPTOAPI_BLOB
{
38 } CRYPT_INTEGER_BLOB
, *PCRYPT_INTEGER_BLOB
,
39 CRYPT_UINT_BLOB
, *PCRYPT_UINT_BLOB
,
40 CRYPT_OBJID_BLOB
, *PCRYPT_OBJID_BLOB
,
41 CERT_NAME_BLOB
, *PCERT_NAME_BLOB
,
42 CERT_RDN_VALUE_BLOB
, *PCERT_RDN_VALUE_BLOB
,
43 CERT_BLOB
, *PCERT_BLOB
,
45 DATA_BLOB
, *PDATA_BLOB
,
46 CRYPT_DATA_BLOB
, *PCRYPT_DATA_BLOB
,
47 CRYPT_HASH_BLOB
, *PCRYPT_HASH_BLOB
,
48 CRYPT_DIGEST_BLOB
, *PCRYPT_DIGEST_BLOB
,
49 CRYPT_DER_BLOB
, *PCRYPT_DER_BLOB
,
50 CRYPT_ATTR_BLOB
, *PCRYPT_ATTR_BLOB
;
52 typedef struct _CRYPTPROTECT_PROMPTSTRUCT
{
57 } CRYPTPROTECT_PROMPTSTRUCT
, *PCRYPTPROTECT_PROMPTSTRUCT
;
59 typedef struct _CRYPT_ALGORITHM_IDENTIFIER
{
61 CRYPT_OBJID_BLOB Parameters
;
62 } CRYPT_ALGORITHM_IDENTIFIER
, *PCRYPT_ALGORITHM_IDENTIFIER
;
64 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE
{
66 CRYPT_OBJID_BLOB Value
;
67 } CRYPT_ATTRIBUTE_TYPE_VALUE
, *PCRYPT_ATTRIBUTE_TYPE_VALUE
;
69 typedef struct _PUBLICKEYSTRUC
{
74 } BLOBHEADER
, PUBLICKEYSTRUC
;
76 typedef struct _CRYPT_BIT_BLOB
{
80 } CRYPT_BIT_BLOB
, *PCRYPT_BIT_BLOB
;
82 typedef struct _CERT_PUBLIC_KEY_INFO
{
83 CRYPT_ALGORITHM_IDENTIFIER Algorithm
;
84 CRYPT_BIT_BLOB PublicKey
;
85 } CERT_PUBLIC_KEY_INFO
, *PCERT_PUBLIC_KEY_INFO
;
87 typedef struct _CERT_EXTENSION
{
90 CRYPT_OBJID_BLOB Value
;
91 } CERT_EXTENSION
, *PCERT_EXTENSION
;
93 typedef struct _CERT_INFO
{
95 CRYPT_INTEGER_BLOB SerialNumber
;
96 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
97 CERT_NAME_BLOB Issuer
;
100 CERT_NAME_BLOB Subject
;
101 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo
;
102 CRYPT_BIT_BLOB IssuerUniqueId
;
103 CRYPT_BIT_BLOB SubjectUniqueId
;
105 PCERT_EXTENSION rgExtension
;
106 } CERT_INFO
, *PCERT_INFO
;
108 typedef struct _CERT_CONTEXT
{
109 DWORD dwCertEncodingType
;
112 PCERT_INFO pCertInfo
;
113 HCERTSTORE hCertStore
;
114 } CERT_CONTEXT
, *PCERT_CONTEXT
;
115 typedef const CERT_CONTEXT
*PCCERT_CONTEXT
;
117 typedef struct _VTableProvStruc
{
119 FARPROC pFuncVerifyImage
;
120 FARPROC pFuncReturnhWnd
;
125 } VTableProvStruc
, *PVTableProvStruc
;
129 #define GET_ALG_CLASS(x) (x & (7 << 13))
130 #define GET_ALG_TYPE(x) (x & (15 << 9))
131 #define GET_ALG_SID(x) (x & (511))
133 /* Algorithm Classes */
134 #define ALG_CLASS_ANY (0)
135 #define ALG_CLASS_SIGNATURE (1 << 13)
136 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
137 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
138 #define ALG_CLASS_HASH (4 << 13)
139 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
140 /* Algorithm types */
141 #define ALG_TYPE_ANY (0)
142 #define ALG_TYPE_DSS (1 << 9)
143 #define ALG_TYPE_RSA (2 << 9)
144 #define ALG_TYPE_BLOCK (3 << 9)
145 #define ALG_TYPE_STREAM (4 << 9)
148 #define ALG_SID_ANY (0)
150 #define ALG_SID_RSA_ANY 0
151 #define ALG_SID_RSA_PKCS 1
152 #define ALG_SID_RSA_MSATWORK 2
153 #define ALG_SID_RSA_ENTRUST 3
154 #define ALG_SID_RSA_PGP 4
156 #define ALG_SID_DSS_ANY 0
157 #define ALG_SID_DSS_PKCS 1
158 #define ALG_SID_DSS_DMS 2
161 #define ALG_SID_DES 1
162 #define ALG_SID_3DES 3
163 #define ALG_SID_DESX 4
164 #define ALG_SID_IDEA 5
165 #define ALG_SID_CAST 6
166 #define ALG_SID_SAFERSK64 7
167 #define ALD_SID_SAFERSK128 8
169 #define ALG_SID_RC4 1
170 #define ALG_SID_RC2 2
171 #define ALG_SID_SEAL 2
173 #define ALG_SID_MD2 1
174 #define ALG_SID_MD4 2
175 #define ALG_SID_MD5 3
176 #define ALG_SID_SHA 4
177 #define ALG_SID_MAC 5
178 #define ALG_SID_RIPEMD 6
179 #define ALG_SID_RIPEMD160 7
180 #define ALG_SID_SSL3SHAMD5 8
182 /* Algorithm Definitions */
183 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
184 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
185 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
186 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
187 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
188 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
189 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
190 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
191 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
192 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
193 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
194 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
197 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
198 #if defined(__GNUC__)
199 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
200 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
201 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
202 #elif defined(_MSC_VER)
203 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
205 static const WCHAR MS_DEF_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
206 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
207 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
209 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
211 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
212 #if defined(__GNUC__)
213 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
214 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
215 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
216 #elif defined(_MSC_VER)
217 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
219 static const WCHAR MS_ENHANCED_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
220 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
221 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
223 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
225 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
226 #if defined(__GNUC__)
227 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
228 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
229 'P','r','o','v','i','d','e','r',0 }
230 #elif defined(_MSC_VER)
231 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
233 static const WCHAR MS_STRONG_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
234 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
235 'P','r','o','v','i','d','e','r',0 };
237 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
239 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
240 #if defined(__GNUC__)
241 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
242 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
243 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
244 #elif defined(_MSC_VER)
245 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
247 static const WCHAR MS_DEF_RSA_SIG_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
248 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
249 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
251 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
253 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
254 #if defined(__GNUC__)
255 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
256 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
257 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
258 #elif defined(_MSC_VER)
259 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
261 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
262 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
263 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
265 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
267 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
268 #if defined(__GNUC__)
269 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
270 'B','a','s','e',' ','D','S','S',' ', \
271 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
272 #elif defined(_MSC_VER)
273 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
275 static const WCHAR MS_DEF_DSS_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
276 'B','a','s','e',' ','D','S','S',' ',
277 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
279 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
281 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
282 #if defined(__GNUC__)
283 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
284 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
285 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
286 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
287 #elif defined(_MSC_VER)
288 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
290 static const WCHAR MS_DEF_DSS_DH_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
291 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
292 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
293 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
295 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
297 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
298 #if defined(__GNUC__)
299 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
300 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
301 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
302 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
303 #elif defined(_MSC_VER)
304 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
306 static const WCHAR MS_ENH_DSS_DH_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
307 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
308 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
309 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
311 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
313 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
314 #if defined(__GNUC__)
315 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
316 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
317 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
318 #elif defined(_MSC_VER)
319 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
321 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
322 'D','H',' ','S','C','h','a','n','n','e','l',' ',
323 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
325 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
327 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
328 #if defined(__GNUC__)
329 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
330 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
331 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
332 #elif defined(_MSC_VER)
333 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
335 static const WCHAR MS_SCARD_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
336 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
337 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
339 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
342 #define AT_KEYEXCHANGE 1
343 #define AT_SIGNATURE 2
346 #define PROV_RSA_FULL 1
347 #define PROV_RSA_SIG 2
349 #define PROV_FORTEZZA 4
350 #define PROV_MS_EXCHANGE 5
352 #define PROV_RSA_SCHANNEL 12
353 #define PROV_DSS_DH 13
354 #define PROV_EC_ECDSA_SIG 14
355 #define PROV_EC_ECNRA_SIG 15
356 #define PROV_EC_ECDSA_FULL 16
357 #define PROV_EC_ECNRA_FULL 17
358 #define PROV_DH_SCHANNEL 18
359 #define PROV_SPYRUS_LYNKS 20
361 #define PROV_INTEL_SEC 22
362 #define PROV_REPLACE_OWF 23
363 #define PROV_RSA_AES 24
367 /* Provider Parameters */
368 #define PP_ENUMALGS 1
369 #define PP_ENUMCONTAINERS 2
373 #define PP_CONTAINER 6
375 #define CRYPT_FIRST 1
378 #define CRYPT_IMPL_HARDWARE 1
379 #define CRYPT_IMPL_SOFTWARE 2
380 #define CRYPT_IMPL_MIXED 3
381 #define CRYPT_IMPL_UNKNOWN 4
383 /* CryptAcquireContext */
384 #define CRYPT_VERIFYCONTEXT 0xF0000000
385 #define CRYPT_NEWKEYSET 0x00000008
386 #define CRYPT_MACHINE_KEYSET 0x00000000
387 #define CRYPT_DELETEKEYSET 0x00000010
388 #define CRYPT_SILENT 0x00000000
390 /* Crypt{Get|Set}Provider */
391 #define CRYPT_MACHINE_DEFAULT 0x00000001
392 #define CRYPT_USER_DEFAULT 0x00000002
393 #define CRYPT_DELETE_DEFAULT 0x00000004
395 /* Crypt{Get/Set}ProvParam */
396 #define PP_CLIENT_HWND 1
397 #define PP_ENUMALGS 1
398 #define PP_ENUMCONTAINERS 2
402 #define PP_CONTAINER 6
403 #define PP_CHANGE_PASSWORD 7
404 #define PP_KEYSET_SEC_DESCR 8
405 #define PP_KEY_TYPE_SUBTYPE 10
406 #define PP_CONTEXT_INFO 11
407 #define PP_KEYEXCHANGE_KEYSIZE 12
408 #define PP_SIGNATURE_KEYSIZE 13
409 #define PP_KEYEXCHANGE_ALG 14
410 #define PP_SIGNATURE_ALG 15
411 #define PP_PROVTYPE 16
412 #define PP_KEYSTORAGE 17
413 #define PP_SYM_KEYSIZE 19
414 #define PP_SESSION_KEYSIZE 20
415 #define PP_UI_PROMPT 21
416 #define PP_ENUMALGS_EX 22
417 #define PP_DELETEKEY 24
418 #define PP_ENUMMANDROOTS 25
419 #define PP_ENUMELECTROOTS 26
420 #define PP_KEYSET_TYPE 27
421 #define PP_ADMIN_PIN 31
422 #define PP_KEYEXCHANGE_PIN 32
423 #define PP_SIGNATURE_PIN 33
424 #define PP_SIG_KEYSIZE_INC 34
425 #define PP_KEYX_KEYSIZE_INC 35
426 #define PP_UNIQUE_CONTAINER 36
427 #define PP_SGC_INFO 37
428 #define PP_USE_HARDWARE_RNG 38
429 #define PP_KEYSPEC 39
430 #define PP_ENUMEX_SIGNING_PROT 40
432 /* CryptSignHash/CryptVerifySignature */
433 #define CRYPT_NOHASHOID 0x00000001
434 #define CRYPT_TYPE2_FORMAT 0x00000002
435 #define CRYPT_X931_FORMAT 0x00000004
438 #define CRYPT_EXPORTABLE 0x00000001
439 #define CRYPT_USER_PROTECTED 0x00000002
440 #define CRYPT_CREATE_SALT 0x00000004
441 #define CRYPT_UPDATE_KEY 0x00000008
442 #define CRYPT_NO_SALT 0x00000010
443 #define CRYPT_PREGEN 0x00000040
444 #define CRYPT_ARCHIVABLE 0x00004000
445 #define CRYPT_SSL2_FALLBACK 0x00000002
446 #define CRYPT_DESTROYKEY 0x00000004
447 #define CRYPT_OAEP 0x00000040
450 #define SIMPLEBLOB 0x1
451 #define PUBLICKEYBLOB 0x6
452 #define PRIVATEKEYBLOB 0x7
453 #define PLAINTEXTKEYBLOB 0x8
454 #define OPAQUEKEYBLOB 0x9
455 #define PUBLICKEYBLOBEX 0xA
456 #define SYMMETRICWRAPKEYBLOB 0xB
458 /* function declarations */
460 BOOL WINAPI
CryptAcquireContextA(HCRYPTPROV
*phProv
, LPCSTR pszContainer
,
461 LPCSTR pszProvider
, DWORD dwProvType
,
463 BOOL WINAPI
CryptAcquireContextW (HCRYPTPROV
*phProv
, LPCWSTR pszContainer
,
464 LPCWSTR pszProvider
, DWORD dwProvType
, DWORD dwFlags
);
465 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
466 BOOL WINAPI
CryptGenRandom (HCRYPTPROV hProv
, DWORD dwLen
, BYTE
*pbBuffer
);
467 BOOL WINAPI
CryptContextAddRef (HCRYPTPROV hProv
, DWORD
*pdwReserved
, DWORD dwFlags
);
468 BOOL WINAPI
CryptCreateHash (HCRYPTPROV hProv
, ALG_ID Algid
, HCRYPTKEY hKey
,
469 DWORD dwFlags
, HCRYPTHASH
*phHash
);
470 BOOL WINAPI
CryptDecrypt (HCRYPTKEY hKey
, HCRYPTHASH hHash
, BOOL Final
,
471 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
);
472 BOOL WINAPI
CryptDeriveKey (HCRYPTPROV hProv
, ALG_ID Algid
, HCRYPTHASH hBaseData
,
473 DWORD dwFlags
, HCRYPTKEY
*phKey
);
474 BOOL WINAPI
CryptDestroyHash (HCRYPTHASH hHash
);
475 BOOL WINAPI
CryptDestroyKey (HCRYPTKEY hKey
);
476 BOOL WINAPI
CryptDuplicateKey (HCRYPTKEY hKey
, DWORD
*pdwReserved
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
477 BOOL WINAPI
CryptDuplicateHash (HCRYPTHASH hHash
, DWORD
*pdwReserved
,
478 DWORD dwFlags
, HCRYPTHASH
*phHash
);
479 BOOL WINAPI
CryptEncrypt (HCRYPTKEY hKey
, HCRYPTHASH hHash
, BOOL Final
,
480 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
, DWORD dwBufLen
);
481 BOOL WINAPI
CryptEnumProvidersA (DWORD dwIndex
, DWORD
*pdwReserved
,
482 DWORD dwFlags
, DWORD
*pdwProvType
, LPSTR pszProvName
, DWORD
*pcbProvName
);
483 BOOL WINAPI
CryptEnumProvidersW (DWORD dwIndex
, DWORD
*pdwReserved
,
484 DWORD dwFlags
, DWORD
*pdwProvType
, LPWSTR pszProvName
, DWORD
*pcbProvName
);
485 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
486 BOOL WINAPI
CryptEnumProviderTypesA (DWORD dwIndex
, DWORD
*pdwReserved
,
487 DWORD dwFlags
, DWORD
*pdwProvType
, LPSTR pszTypeName
, DWORD
*pcbTypeName
);
488 BOOL WINAPI
CryptEnumProviderTypesW (DWORD dwIndex
, DWORD
*pdwReserved
,
489 DWORD dwFlags
, DWORD
*pdwProvType
, LPWSTR pszTypeName
, DWORD
*pcbTypeName
);
490 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
491 BOOL WINAPI
CryptExportKey (HCRYPTKEY hKey
, HCRYPTKEY hExpKey
, DWORD dwBlobType
,
492 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
);
493 BOOL WINAPI
CryptGenKey (HCRYPTPROV hProv
, ALG_ID Algid
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
494 BOOL WINAPI
CryptGetKeyParam (HCRYPTKEY hKey
, DWORD dwParam
, BYTE
*pbData
,
495 DWORD
*pdwDataLen
, DWORD dwFlags
);
496 BOOL WINAPI
CryptGetHashParam (HCRYPTHASH hHash
, DWORD dwParam
, BYTE
*pbData
,
497 DWORD
*pdwDataLen
, DWORD dwFlags
);
498 BOOL WINAPI
CryptGetProvParam (HCRYPTPROV hProv
, DWORD dwParam
, BYTE
*pbData
,
499 DWORD
*pdwDataLen
, DWORD dwFlags
);
500 BOOL WINAPI
CryptGetDefaultProviderA (DWORD dwProvType
, DWORD
*pdwReserved
,
501 DWORD dwFlags
, LPSTR pszProvName
, DWORD
*pcbProvName
);
502 BOOL WINAPI
CryptGetDefaultProviderW (DWORD dwProvType
, DWORD
*pdwReserved
,
503 DWORD dwFlags
, LPWSTR pszProvName
, DWORD
*pcbProvName
);
504 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
505 BOOL WINAPI
CryptGetUserKey (HCRYPTPROV hProv
, DWORD dwKeySpec
, HCRYPTKEY
*phUserKey
);
506 BOOL WINAPI
CryptHashData (HCRYPTHASH hHash
, BYTE
*pbData
, DWORD dwDataLen
, DWORD dwFlags
);
507 BOOL WINAPI
CryptHashSessionKey (HCRYPTHASH hHash
, HCRYPTKEY hKey
, DWORD dwFlags
);
508 BOOL WINAPI
CryptImportKey (HCRYPTPROV hProv
, BYTE
*pbData
, DWORD dwDataLen
,
509 HCRYPTKEY hPubKey
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
510 BOOL WINAPI
CryptReleaseContext (HCRYPTPROV hProv
, DWORD dwFlags
);
511 BOOL WINAPI
CryptSignHashA (HCRYPTHASH hHash
, DWORD dwKeySpec
, LPCSTR sDescription
,
512 DWORD dwFlags
, BYTE
*pbSignature
, DWORD
*pdwSigLen
);
513 BOOL WINAPI
CryptSignHashW (HCRYPTHASH hHash
, DWORD dwKeySpec
, LPCWSTR sDescription
,
514 DWORD dwFlags
, BYTE
*pbSignature
, DWORD
*pdwSigLen
);
515 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
516 BOOL WINAPI
CryptSetHashParam (HCRYPTHASH hHash
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
517 BOOL WINAPI
CryptSetKeyParam (HCRYPTKEY hKey
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
518 BOOL WINAPI
CryptSetProviderA (LPCSTR pszProvName
, DWORD dwProvType
);
519 BOOL WINAPI
CryptSetProviderW (LPCWSTR pszProvName
, DWORD dwProvType
);
520 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
521 BOOL WINAPI
CryptSetProviderExA (LPCSTR pszProvName
, DWORD dwProvType
, DWORD
*pdwReserved
, DWORD dwFlags
);
522 BOOL WINAPI
CryptSetProviderExW (LPCWSTR pszProvName
, DWORD dwProvType
, DWORD
*pdwReserved
, DWORD dwFlags
);
523 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
524 BOOL WINAPI
CryptSetProvParam (HCRYPTPROV hProv
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
525 BOOL WINAPI
CryptVerifySignatureA (HCRYPTHASH hHash
, BYTE
*pbSignature
, DWORD dwSigLen
,
526 HCRYPTKEY hPubKey
, LPCSTR sDescription
, DWORD dwFlags
);
527 BOOL WINAPI
CryptVerifySignatureW (HCRYPTHASH hHash
, BYTE
*pbSignature
, DWORD dwSigLen
,
528 HCRYPTKEY hPubKey
, LPCWSTR sDescription
, DWORD dwFlags
);
529 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)