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