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
;
32 typedef void *HCRYPTMSG
;
36 typedef struct _PROV_ENUMALGS
{
43 typedef struct _PROV_ENUMALGS_EX
{
55 typedef struct HMAC_INFO
{
61 } HMAC_INFO
, *PHMAC_INFO
;
63 typedef struct _CRYPTOAPI_BLOB
{
66 } CRYPT_INTEGER_BLOB
, *PCRYPT_INTEGER_BLOB
,
67 CRYPT_UINT_BLOB
, *PCRYPT_UINT_BLOB
,
68 CRYPT_OBJID_BLOB
, *PCRYPT_OBJID_BLOB
,
69 CERT_NAME_BLOB
, *PCERT_NAME_BLOB
,
70 CERT_RDN_VALUE_BLOB
, *PCERT_RDN_VALUE_BLOB
,
71 CERT_BLOB
, *PCERT_BLOB
,
73 DATA_BLOB
, *PDATA_BLOB
,
74 CRYPT_DATA_BLOB
, *PCRYPT_DATA_BLOB
,
75 CRYPT_HASH_BLOB
, *PCRYPT_HASH_BLOB
,
76 CRYPT_DIGEST_BLOB
, *PCRYPT_DIGEST_BLOB
,
77 CRYPT_DER_BLOB
, *PCRYPT_DER_BLOB
,
78 CRYPT_ATTR_BLOB
, *PCRYPT_ATTR_BLOB
;
80 typedef struct _CRYPTPROTECT_PROMPTSTRUCT
{
85 } CRYPTPROTECT_PROMPTSTRUCT
, *PCRYPTPROTECT_PROMPTSTRUCT
;
87 typedef struct _CRYPT_ALGORITHM_IDENTIFIER
{
89 CRYPT_OBJID_BLOB Parameters
;
90 } CRYPT_ALGORITHM_IDENTIFIER
, *PCRYPT_ALGORITHM_IDENTIFIER
;
92 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE
{
94 CRYPT_OBJID_BLOB Value
;
95 } CRYPT_ATTRIBUTE_TYPE_VALUE
, *PCRYPT_ATTRIBUTE_TYPE_VALUE
;
97 typedef struct _PUBLICKEYSTRUC
{
102 } BLOBHEADER
, PUBLICKEYSTRUC
;
104 typedef struct _RSAPUBKEY
{
110 typedef struct _CRYPT_BIT_BLOB
{
114 } CRYPT_BIT_BLOB
, *PCRYPT_BIT_BLOB
;
116 typedef struct _CERT_PUBLIC_KEY_INFO
{
117 CRYPT_ALGORITHM_IDENTIFIER Algorithm
;
118 CRYPT_BIT_BLOB PublicKey
;
119 } CERT_PUBLIC_KEY_INFO
, *PCERT_PUBLIC_KEY_INFO
;
121 typedef struct _CERT_EXTENSION
{
124 CRYPT_OBJID_BLOB Value
;
125 } CERT_EXTENSION
, *PCERT_EXTENSION
;
127 typedef struct _CERT_INFO
{
129 CRYPT_INTEGER_BLOB SerialNumber
;
130 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
131 CERT_NAME_BLOB Issuer
;
134 CERT_NAME_BLOB Subject
;
135 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo
;
136 CRYPT_BIT_BLOB IssuerUniqueId
;
137 CRYPT_BIT_BLOB SubjectUniqueId
;
139 PCERT_EXTENSION rgExtension
;
140 } CERT_INFO
, *PCERT_INFO
;
142 typedef struct _CERT_CONTEXT
{
143 DWORD dwCertEncodingType
;
146 PCERT_INFO pCertInfo
;
147 HCERTSTORE hCertStore
;
148 } CERT_CONTEXT
, *PCERT_CONTEXT
;
149 typedef const CERT_CONTEXT
*PCCERT_CONTEXT
;
151 typedef struct _CRL_ENTRY
{
152 CRYPT_INTEGER_BLOB SerialNumber
;
153 FILETIME RevocationDate
;
155 PCERT_EXTENSION rgExtension
;
156 } CRL_ENTRY
, *PCRL_ENTRY
;
158 typedef struct _CRL_INFO
{
160 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
161 CERT_NAME_BLOB Issuer
;
165 PCRL_ENTRY rgCRLEntry
;
167 PCERT_EXTENSION rgExtension
;
168 } CRL_INFO
, *PCRL_INFO
;
170 typedef struct _CRL_CONTEXT
{
171 DWORD dwCertEncodingType
;
175 HCERTSTORE hCertStore
;
176 } CRL_CONTEXT
, *PCRL_CONTEXT
;
177 typedef const CRL_CONTEXT
*PCCRL_CONTEXT
;
179 typedef struct _VTableProvStruc
{
181 FARPROC pFuncVerifyImage
;
182 FARPROC pFuncReturnhWnd
;
187 } VTableProvStruc
, *PVTableProvStruc
;
189 typedef struct _CRYPT_ATTRIBUTE
{
192 CRYPT_DATA_BLOB rgValue
;
193 } CRYPT_ATTRIBUTE
, *PCRYPT_ATTRIBUTE
;
195 typedef struct _CRYPT_ATTRIBUTES
{
197 PCRYPT_ATTRIBUTE rgAttr
;
198 } CRYPT_ATTRIBUTES
, *PCRYPT_ATTRIBUTES
;
200 typedef struct _CTL_USAGE
{
201 DWORD cUsageIdentifier
;
202 LPSTR
*rgpszUsageIdentifier
;
203 } CTL_USAGE
, *PCTL_USAGE
, CERT_ENHKEY_USAGE
, *PCERT_ENHKEY_USAGE
;
205 typedef struct _CTL_ENTRY
{
206 CRYPT_DATA_BLOB SubjectIdentifier
;
208 PCRYPT_ATTRIBUTE rgAttribute
;
209 } CTL_ENTRY
, *PCTL_ENTRY
;
211 typedef struct _CTL_INFO
{
213 CTL_USAGE SubjectUsage
;
214 CRYPT_DATA_BLOB ListIdentifier
;
215 CRYPT_INTEGER_BLOB SequenceNumber
;
218 CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm
;
220 PCTL_ENTRY rgCTLEntry
;
222 PCERT_EXTENSION rgExtension
;
223 } CTL_INFO
, *PCTL_INFO
;
225 typedef struct _CTL_CONTEXT
{
226 DWORD dwMsgAndCertEncodingType
;
230 HCERTSTORE hCertStore
;
234 } CTL_CONTEXT
, *PCTL_CONTEXT
;
235 typedef const CTL_CONTEXT
*PCCTL_CONTEXT
;
237 typedef struct _CMSG_SIGNER_INFO
{
239 CERT_NAME_BLOB Issuer
;
240 CRYPT_INTEGER_BLOB SerialNumber
;
241 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm
;
242 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm
;
243 CRYPT_DATA_BLOB EncryptedHash
;
244 CRYPT_ATTRIBUTES AuthAttrs
;
245 CRYPT_ATTRIBUTES UnauthAttrs
;
246 } CMSG_SIGNER_INFO
, *PCMSG_SIGNER_INFO
;
248 typedef struct _CERT_REVOCATION_CRL_INFO
{
250 PCCRL_CONTEXT pBaseCrlContext
;
251 PCCRL_CONTEXT pDeltaCrlContext
;
252 PCRL_ENTRY pCrlEntry
;
254 } CERT_REVOCATION_CRL_INFO
, *PCERT_REVOCATION_CRL_INFO
;
256 typedef struct _CERT_REVOCATION_INFO
{
258 DWORD dwRevocationResult
;
259 LPCSTR pszRevocationOid
;
260 LPVOID pvOidSpecificInfo
;
261 BOOL fHasFreshnessTime
;
262 DWORD dwFreshnessTime
;
263 PCERT_REVOCATION_CRL_INFO pCrlInfo
;
264 } CERT_REVOCATION_INFO
, *PCERT_REVOCATION_INFO
;
266 typedef struct _CERT_TRUST_LIST_INFO
{
268 PCTL_ENTRY pCtlEntry
;
269 PCCTL_CONTEXT pCtlContext
;
270 } CERT_TRUST_LIST_INFO
, *PCERT_TRUST_LIST_INFO
;
272 typedef struct _CERT_TRUST_STATUS
{
275 } CERT_TRUST_STATUS
, *PCERT_TRUST_STATUS
;
277 typedef struct _CERT_CHAIN_ELEMENT
{
279 PCCERT_CONTEXT pCertContext
;
280 CERT_TRUST_STATUS TrustStatus
;
281 PCERT_REVOCATION_INFO pRevocationInfo
;
282 PCERT_ENHKEY_USAGE pIssuanceUsage
;
283 PCERT_ENHKEY_USAGE pApplicationUsage
;
284 LPCWSTR pwszExtendedErrorInfo
;
285 } CERT_CHAIN_ELEMENT
, *PCERT_CHAIN_ELEMENT
;
287 typedef struct _CERT_SIMPLE_CHAIN
{
289 CERT_TRUST_STATUS TrustStatus
;
291 PCERT_CHAIN_ELEMENT
*rgpElement
;
292 PCERT_TRUST_LIST_INFO pTrustListInfo
;
293 BOOL fHasRevocationFreshnessTime
;
294 DWORD dwRevocationFreshnessTime
;
295 } CERT_SIMPLE_CHAIN
, *PCERT_SIMPLE_CHAIN
;
297 typedef struct _CERT_CHAIN_CONTEXT CERT_CHAIN_CONTEXT
, *PCERT_CHAIN_CONTEXT
;
298 typedef const CERT_CHAIN_CONTEXT
*PCCERT_CHAIN_CONTEXT
;
300 struct _CERT_CHAIN_CONTEXT
{
302 CERT_TRUST_STATUS TrustStatus
;
304 PCERT_SIMPLE_CHAIN
*rgpChain
;
305 DWORD cLowerQualityChainContext
;
306 PCCERT_CHAIN_CONTEXT
*rgbLowerQualityChainContext
;
307 BOOL fHasRevocationFreshnessTime
;
308 DWORD dwRevocationFreshnessTime
;
311 typedef struct _CERT_CHAIN_POLICY_PARA
{
314 void *pvExtraPolicyPara
;
315 } CERT_CHAIN_POLICY_PARA
, *PCERT_CHAIN_POLICY_PARA
;
317 typedef struct _CERT_CHAIN_POLICY_STATUS
{
322 void *pvExtraPolicyStatus
;
323 } CERT_CHAIN_POLICY_STATUS
, *PCERT_CHAIN_POLICY_STATUS
;
325 typedef struct _CERT_SYSTEM_STORE_INFO
{
327 } CERT_SYSTEM_STORE_INFO
, *PCERT_SYSTEM_STORE_INFO
;
329 typedef struct _CERT_PHYSICAL_STORE_INFO
{
331 LPSTR pszOpenStoreProvider
;
332 DWORD dwOpenEncodingType
;
334 CRYPT_DATA_BLOB OpenParameters
;
337 } CERT_PHYSICAL_STORE_INFO
, *PCERT_PHYSICAL_STORE_INFO
;
339 typedef struct _CERT_SYSTEM_STORE_RELOCATE_PARA
{
346 LPCSTR pszSystemStore
;
347 LPCWSTR pwszSystemStore
;
349 } CERT_SYSTEM_STORE_RELOCATE_PARA
, *PCERT_SYSTEM_STORE_RELOCATE_PARA
;
351 typedef BOOL (WINAPI
*PFN_CERT_ENUM_SYSTEM_STORE_LOCATION
)(
352 LPCWSTR pwszStoreLocation
, DWORD dwFlags
, void *pvReserved
, void *pvArg
);
354 typedef BOOL (WINAPI
*PFN_CERT_ENUM_SYSTEM_STORE
)(const void *pvSystemStore
,
355 DWORD dwFlags
, PCERT_SYSTEM_STORE_INFO pStoreInfo
, void *pvReserved
,
358 typedef BOOL (WINAPI
*PFN_CERT_ENUM_PHYSICAL_STORE
)(const void *pvSystemStore
,
359 DWORD dwFlags
, LPCWSTR pwszStoreName
, PCERT_PHYSICAL_STORE_INFO pStoreInfo
,
360 void *pvReserved
, void *pvArg
);
364 #define GET_ALG_CLASS(x) (x & (7 << 13))
365 #define GET_ALG_TYPE(x) (x & (15 << 9))
366 #define GET_ALG_SID(x) (x & (511))
368 /* Algorithm Classes */
369 #define ALG_CLASS_ANY (0)
370 #define ALG_CLASS_SIGNATURE (1 << 13)
371 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
372 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
373 #define ALG_CLASS_HASH (4 << 13)
374 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
375 /* Algorithm types */
376 #define ALG_TYPE_ANY (0)
377 #define ALG_TYPE_DSS (1 << 9)
378 #define ALG_TYPE_RSA (2 << 9)
379 #define ALG_TYPE_BLOCK (3 << 9)
380 #define ALG_TYPE_STREAM (4 << 9)
383 #define ALG_SID_ANY (0)
385 #define ALG_SID_RSA_ANY 0
386 #define ALG_SID_RSA_PKCS 1
387 #define ALG_SID_RSA_MSATWORK 2
388 #define ALG_SID_RSA_ENTRUST 3
389 #define ALG_SID_RSA_PGP 4
391 #define ALG_SID_DSS_ANY 0
392 #define ALG_SID_DSS_PKCS 1
393 #define ALG_SID_DSS_DMS 2
396 #define ALG_SID_DES 1
397 #define ALG_SID_3DES 3
398 #define ALG_SID_DESX 4
399 #define ALG_SID_IDEA 5
400 #define ALG_SID_CAST 6
401 #define ALG_SID_SAFERSK64 7
402 #define ALG_SID_SAFERSK128 8
403 #define ALG_SID_3DES_112 9
405 #define ALG_SID_RC4 1
406 #define ALG_SID_RC2 2
407 #define ALG_SID_SEAL 2
409 #define ALG_SID_MD2 1
410 #define ALG_SID_MD4 2
411 #define ALG_SID_MD5 3
412 #define ALG_SID_SHA 4
413 #define ALG_SID_MAC 5
414 #define ALG_SID_RIPEMD 6
415 #define ALG_SID_RIPEMD160 7
416 #define ALG_SID_SSL3SHAMD5 8
417 #define ALG_SID_HMAC 9
419 /* Algorithm Definitions */
420 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
421 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
422 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
423 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
424 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
425 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
426 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
427 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
428 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
429 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
430 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
431 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
432 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES)
433 #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112)
434 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
435 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
438 #define CRYPT_FLAG_PCT1 0x0001
439 #define CRYPT_FLAG_SSL2 0x0002
440 #define CRYPT_FLAG_SSL3 0x0004
441 #define CRYPT_FLAG_TLS1 0x0008
442 #define CRYPT_FLAG_IPSEC 0x0010
443 #define CRYPT_FLAG_SIGNING 0x0020
446 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
447 #if defined(__GNUC__)
448 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
449 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
450 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
451 #elif defined(_MSC_VER)
452 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
454 static const WCHAR MS_DEF_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
455 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
456 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
458 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
460 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
461 #if defined(__GNUC__)
462 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
463 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
464 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
465 #elif defined(_MSC_VER)
466 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
468 static const WCHAR MS_ENHANCED_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
469 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
470 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
472 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
474 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
475 #if defined(__GNUC__)
476 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
477 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
478 'P','r','o','v','i','d','e','r',0 }
479 #elif defined(_MSC_VER)
480 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
482 static const WCHAR MS_STRONG_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
483 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
484 'P','r','o','v','i','d','e','r',0 };
486 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
488 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
489 #if defined(__GNUC__)
490 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
491 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
492 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
493 #elif defined(_MSC_VER)
494 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
496 static const WCHAR MS_DEF_RSA_SIG_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
497 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
498 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
500 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
502 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
503 #if defined(__GNUC__)
504 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
505 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
506 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
507 #elif defined(_MSC_VER)
508 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
510 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
511 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
512 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
514 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
516 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
517 #if defined(__GNUC__)
518 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
519 'B','a','s','e',' ','D','S','S',' ', \
520 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
521 #elif defined(_MSC_VER)
522 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
524 static const WCHAR MS_DEF_DSS_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
525 'B','a','s','e',' ','D','S','S',' ',
526 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
528 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
530 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
531 #if defined(__GNUC__)
532 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
533 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
534 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
535 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
536 #elif defined(_MSC_VER)
537 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
539 static const WCHAR MS_DEF_DSS_DH_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
540 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
541 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
542 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
544 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
546 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
547 #if defined(__GNUC__)
548 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
549 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
550 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
551 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
552 #elif defined(_MSC_VER)
553 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
555 static const WCHAR MS_ENH_DSS_DH_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
556 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
557 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
558 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
560 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
562 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
563 #if defined(__GNUC__)
564 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
565 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
566 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
567 #elif defined(_MSC_VER)
568 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
570 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
571 'D','H',' ','S','C','h','a','n','n','e','l',' ',
572 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
574 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
576 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
577 #if defined(__GNUC__)
578 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
579 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
580 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
581 #elif defined(_MSC_VER)
582 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
584 static const WCHAR MS_SCARD_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
585 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
586 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
588 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
591 #define AT_KEYEXCHANGE 1
592 #define AT_SIGNATURE 2
595 #define PROV_RSA_FULL 1
596 #define PROV_RSA_SIG 2
598 #define PROV_FORTEZZA 4
599 #define PROV_MS_EXCHANGE 5
601 #define PROV_RSA_SCHANNEL 12
602 #define PROV_DSS_DH 13
603 #define PROV_EC_ECDSA_SIG 14
604 #define PROV_EC_ECNRA_SIG 15
605 #define PROV_EC_ECDSA_FULL 16
606 #define PROV_EC_ECNRA_FULL 17
607 #define PROV_DH_SCHANNEL 18
608 #define PROV_SPYRUS_LYNKS 20
610 #define PROV_INTEL_SEC 22
611 #define PROV_REPLACE_OWF 23
612 #define PROV_RSA_AES 24
616 /* Provider Parameters */
617 #define PP_ENUMALGS 1
618 #define PP_ENUMCONTAINERS 2
622 #define PP_CONTAINER 6
624 #define CRYPT_FIRST 1
627 #define CRYPT_IMPL_HARDWARE 1
628 #define CRYPT_IMPL_SOFTWARE 2
629 #define CRYPT_IMPL_MIXED 3
630 #define CRYPT_IMPL_UNKNOWN 4
632 /* CryptAcquireContext */
633 #define CRYPT_VERIFYCONTEXT 0xF0000000
634 #define CRYPT_NEWKEYSET 0x00000008
635 #define CRYPT_MACHINE_KEYSET 0x00000000
636 #define CRYPT_DELETEKEYSET 0x00000010
637 #define CRYPT_SILENT 0x00000000
639 /* Crypt{Get|Set}Provider */
640 #define CRYPT_MACHINE_DEFAULT 0x00000001
641 #define CRYPT_USER_DEFAULT 0x00000002
642 #define CRYPT_DELETE_DEFAULT 0x00000004
644 /* Crypt{Get/Set}ProvParam */
645 #define PP_CLIENT_HWND 1
646 #define PP_ENUMALGS 1
647 #define PP_ENUMCONTAINERS 2
651 #define PP_CONTAINER 6
652 #define PP_CHANGE_PASSWORD 7
653 #define PP_KEYSET_SEC_DESCR 8
654 #define PP_KEY_TYPE_SUBTYPE 10
655 #define PP_CONTEXT_INFO 11
656 #define PP_KEYEXCHANGE_KEYSIZE 12
657 #define PP_SIGNATURE_KEYSIZE 13
658 #define PP_KEYEXCHANGE_ALG 14
659 #define PP_SIGNATURE_ALG 15
660 #define PP_PROVTYPE 16
661 #define PP_KEYSTORAGE 17
662 #define PP_SYM_KEYSIZE 19
663 #define PP_SESSION_KEYSIZE 20
664 #define PP_UI_PROMPT 21
665 #define PP_ENUMALGS_EX 22
666 #define PP_DELETEKEY 24
667 #define PP_ENUMMANDROOTS 25
668 #define PP_ENUMELECTROOTS 26
669 #define PP_KEYSET_TYPE 27
670 #define PP_ADMIN_PIN 31
671 #define PP_KEYEXCHANGE_PIN 32
672 #define PP_SIGNATURE_PIN 33
673 #define PP_SIG_KEYSIZE_INC 34
674 #define PP_KEYX_KEYSIZE_INC 35
675 #define PP_UNIQUE_CONTAINER 36
676 #define PP_SGC_INFO 37
677 #define PP_USE_HARDWARE_RNG 38
678 #define PP_KEYSPEC 39
679 #define PP_ENUMEX_SIGNING_PROT 40
681 /* Crypt{Get/Set}KeyParam */
686 #define KP_MODE_BITS 5
687 #define KP_PERMISSIONS 6
689 #define KP_BLOCKLEN 8
691 #define KP_SALT_EX 10
700 #define KP_EFFECTIVE_KEYLEN 19
701 #define KP_SCHANNEL_ALG 20
702 #define KP_CLIENT_RANDOM 21
703 #define KP_SERVER_RANDOM 22
705 #define KP_PRECOMP_MD5 24
706 #define KP_PRECOMP_SHA 25
707 #define KP_CERTIFICATE 26
708 #define KP_CLEAR_KEY 27
709 #define KP_PUB_EX_LEN 28
710 #define KP_PUB_EX_VAL 29
712 #define KP_ADMIN_PIN 31
713 #define KP_KEYEXCHANGE_PIN 32
714 #define KP_SIGNATURE_PIN 33
715 #define KP_PREHASH 34
717 /* CryptSignHash/CryptVerifySignature */
718 #define CRYPT_NOHASHOID 0x00000001
719 #define CRYPT_TYPE2_FORMAT 0x00000002
720 #define CRYPT_X931_FORMAT 0x00000004
722 /* Crypt{Get,Set}HashParam */
723 #define HP_ALGID 0x0001
724 #define HP_HASHVAL 0x0002
725 #define HP_HASHSIZE 0x0004
726 #define HP_HMAC_INFO 0x0005
727 #define HP_TLS1PRF_LABEL 0x0006
728 #define HP_TLS1PRF_SEED 0x0007
730 /* Crypt{Get,Set}KeyParam */
731 #define CRYPT_MODE_CBC 1
732 #define CRYPT_MODE_ECB 2
733 #define CRYPT_MODE_OFB 3
734 #define CRYPT_MODE_CFB 4
736 #define CRYPT_ENCRYPT 0x0001
737 #define CRYPT_DECRYPT 0x0002
738 #define CRYPT_EXPORT 0x0004
739 #define CRYPT_READ 0x0008
740 #define CRYPT_WRITE 0x0010
741 #define CRYPT_MAC 0x0020
744 #define CRYPT_EXPORTABLE 0x00000001
745 #define CRYPT_USER_PROTECTED 0x00000002
746 #define CRYPT_CREATE_SALT 0x00000004
747 #define CRYPT_UPDATE_KEY 0x00000008
748 #define CRYPT_NO_SALT 0x00000010
749 #define CRYPT_PREGEN 0x00000040
750 #define CRYPT_ARCHIVABLE 0x00004000
751 #define CRYPT_SSL2_FALLBACK 0x00000002
752 #define CRYPT_DESTROYKEY 0x00000004
753 #define CRYPT_OAEP 0x00000040
756 #define SIMPLEBLOB 0x1
757 #define PUBLICKEYBLOB 0x6
758 #define PRIVATEKEYBLOB 0x7
759 #define PLAINTEXTKEYBLOB 0x8
760 #define OPAQUEKEYBLOB 0x9
761 #define PUBLICKEYBLOBEX 0xA
762 #define SYMMETRICWRAPKEYBLOB 0xB
764 #define CUR_BLOB_VERSION 2
766 /* cert store provider types */
767 #define CERT_STORE_PROV_MSG ((LPCSTR)1)
768 #define CERT_STORE_PROV_MEMORY ((LPCSTR)2)
769 #define CERT_STORE_PROV_FILE ((LPCSTR)3)
770 #define CERT_STORE_PROV_REG ((LPCSTR)4)
771 #define CERT_STORE_PROV_PKCS7 ((LPCSTR)5)
772 #define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6)
773 #define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7)
774 #define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8)
775 #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9)
776 #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10)
777 #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
778 #define CERT_STORE_PROV_COLLECTION ((LPCSTR)11)
779 #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12)
780 #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13)
781 #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
782 #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14)
783 #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
784 #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15)
785 #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
786 #define CERT_STORE_PROV_LDAP_W ((LPCSTR)16)
787 #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
789 #define sz_CERT_STORE_PROV_MEMORY "Memory"
790 #define sz_CERT_STORE_PROV_FILENAME_W "File"
791 #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
792 #define sz_CERT_STORE_PROV_SYSTEM_W "System"
793 #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
794 #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
795 #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
796 #define sz_CERT_STORE_PROV_COLLECTION "Collection"
797 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
798 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
799 #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
800 #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
801 #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
802 #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
803 #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
804 #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
806 /* types for CertOpenStore dwEncodingType */
807 #define X509_ASN_ENCODING 0x00000001
808 #define X509_NDR_ENCODING 0x00000002
809 #define PKCS_7_ASN_ENCODING 0x00010000
810 #define PKCS_7_NDR_ENCODING 0x00020000
812 /* system store locations */
813 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000
814 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
816 /* system store location ids */
818 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
820 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
821 /* hklm\Software\Microsoft\Cryptography\Services */
822 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
823 #define CERT_SYSTEM_STORE_SERVICES_ID 5
825 #define CERT_SYSTEM_STORE_USERS_ID 6
826 /* hkcu\Software\Microsoft\Policies\Microsoft\SystemCertificates */
827 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7
828 /* hklm\Software\Microsoft\Policies\Microsoft\SystemCertificates */
829 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8
830 /* hklm\Software\Microsoft\EnterpriseCertificates */
831 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9
833 /* system store location values */
834 #define CERT_SYSTEM_STORE_CURRENT_USER \
835 (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
836 #define CERT_SYSTEM_STORE_LOCAL_MACHINE \
837 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
838 #define CERT_SYSTEM_STORE_CURRENT_SERVICE \
839 (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
840 #define CERT_SYSTEM_STORE_SERVICE \
841 (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
842 #define CERT_SYSTEM_STORE_USERS \
843 (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
844 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \
845 (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
846 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \
847 (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
848 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \
849 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
851 /* flags for CertOpenStore dwFlags */
852 #define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001
853 #define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002
854 #define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004
855 #define CERT_STORE_DELETE_FLAG 0x00000010
856 #define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020
857 #define CERT_STORE_SHARE_STORE_FLAG 0x00000040
858 #define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080
859 #define CERT_STORE_MANIFOLD_FLAG 0x00000100
860 #define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200
861 #define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400
862 #define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800
863 #define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000
864 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000
865 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
866 #define CERT_STORE_READONLY_FLAG 0x00008000
868 /* physical store dwFlags, also used by CertAddStoreToCollection as
871 #define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1
872 #define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2
873 #define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4
874 #define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8
876 /* dwFlag values for CertEnumPhysicalStore callback */
877 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
879 /* predefined store names */
880 #if defined(__GNUC__)
881 # define CERT_PHYSICAL_STORE_DEFAULT_NAME (const WCHAR[])\
882 {'.','D','e','f','a','u','l','t','0'}
883 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME (const WCHAR[])\
884 {'.','G','r','o','u','p','P','o','l','i','c','y',0}
885 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME (const WCHAR[])\
886 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0}
887 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME (const WCHAR[])\
888 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0}
889 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME (const WCHAR[])\
890 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',\
891 'P','o','l','i','c','y',0}
892 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME (const WCHAR[])\
893 {'.','E','n','t','e','r','p','r','i','s','e',0}
894 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME (const WCHAR[])\
895 {'.','A','u','t','h','R','o','o','t',0}
896 #elif defined(_MSC_VER)
897 # define CERT_PHYSICAL_STORE_DEFAULT_NAME \
899 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \
901 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \
903 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \
905 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
906 L".LocalMachineGroupPolicy"
907 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \
909 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \
912 static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME
[] =
913 {'.','D','e','f','a','u','l','t','0'};
914 static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME
[] =
915 {'.','G','r','o','u','p','P','o','l','i','c','y',0};
916 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME
[] =
917 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0};
918 static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME
[] =
919 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0};
920 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME
[] =
921 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',
922 'P','o','l','i','c','y',0};
923 static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME
[] =
924 {'.','E','n','t','e','r','p','r','i','s','e',0};
925 static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME
[] =
926 {'.','A','u','t','h','R','o','o','t',0};
929 /* cert system store flags */
930 #define CERT_SYSTEM_STORE_MASK 0xffff0000
931 #define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000
933 /* CertFindChainInStore dwFindType types */
934 #define CERT_CHAIN_FIND_BY_ISSUER 1
936 /* function declarations */
938 BOOL WINAPI
CryptAcquireContextA(HCRYPTPROV
*phProv
, LPCSTR pszContainer
,
939 LPCSTR pszProvider
, DWORD dwProvType
,
941 BOOL WINAPI
CryptAcquireContextW (HCRYPTPROV
*phProv
, LPCWSTR pszContainer
,
942 LPCWSTR pszProvider
, DWORD dwProvType
, DWORD dwFlags
);
943 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
944 BOOL WINAPI
CryptGenRandom (HCRYPTPROV hProv
, DWORD dwLen
, BYTE
*pbBuffer
);
945 BOOL WINAPI
CryptContextAddRef (HCRYPTPROV hProv
, DWORD
*pdwReserved
, DWORD dwFlags
);
946 BOOL WINAPI
CryptCreateHash (HCRYPTPROV hProv
, ALG_ID Algid
, HCRYPTKEY hKey
,
947 DWORD dwFlags
, HCRYPTHASH
*phHash
);
948 BOOL WINAPI
CryptDecrypt (HCRYPTKEY hKey
, HCRYPTHASH hHash
, BOOL Final
,
949 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
);
950 BOOL WINAPI
CryptDeriveKey (HCRYPTPROV hProv
, ALG_ID Algid
, HCRYPTHASH hBaseData
,
951 DWORD dwFlags
, HCRYPTKEY
*phKey
);
952 BOOL WINAPI
CryptDestroyHash (HCRYPTHASH hHash
);
953 BOOL WINAPI
CryptDestroyKey (HCRYPTKEY hKey
);
954 BOOL WINAPI
CryptDuplicateKey (HCRYPTKEY hKey
, DWORD
*pdwReserved
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
955 BOOL WINAPI
CryptDuplicateHash (HCRYPTHASH hHash
, DWORD
*pdwReserved
,
956 DWORD dwFlags
, HCRYPTHASH
*phHash
);
957 BOOL WINAPI
CryptEncrypt (HCRYPTKEY hKey
, HCRYPTHASH hHash
, BOOL Final
,
958 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
, DWORD dwBufLen
);
959 BOOL WINAPI
CryptEnumProvidersA (DWORD dwIndex
, DWORD
*pdwReserved
,
960 DWORD dwFlags
, DWORD
*pdwProvType
, LPSTR pszProvName
, DWORD
*pcbProvName
);
961 BOOL WINAPI
CryptEnumProvidersW (DWORD dwIndex
, DWORD
*pdwReserved
,
962 DWORD dwFlags
, DWORD
*pdwProvType
, LPWSTR pszProvName
, DWORD
*pcbProvName
);
963 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
964 BOOL WINAPI
CryptEnumProviderTypesA (DWORD dwIndex
, DWORD
*pdwReserved
,
965 DWORD dwFlags
, DWORD
*pdwProvType
, LPSTR pszTypeName
, DWORD
*pcbTypeName
);
966 BOOL WINAPI
CryptEnumProviderTypesW (DWORD dwIndex
, DWORD
*pdwReserved
,
967 DWORD dwFlags
, DWORD
*pdwProvType
, LPWSTR pszTypeName
, DWORD
*pcbTypeName
);
968 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
969 BOOL WINAPI
CryptExportKey (HCRYPTKEY hKey
, HCRYPTKEY hExpKey
, DWORD dwBlobType
,
970 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
);
971 BOOL WINAPI
CryptGenKey (HCRYPTPROV hProv
, ALG_ID Algid
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
972 BOOL WINAPI
CryptGetKeyParam (HCRYPTKEY hKey
, DWORD dwParam
, BYTE
*pbData
,
973 DWORD
*pdwDataLen
, DWORD dwFlags
);
974 BOOL WINAPI
CryptGetHashParam (HCRYPTHASH hHash
, DWORD dwParam
, BYTE
*pbData
,
975 DWORD
*pdwDataLen
, DWORD dwFlags
);
976 BOOL WINAPI
CryptGetProvParam (HCRYPTPROV hProv
, DWORD dwParam
, BYTE
*pbData
,
977 DWORD
*pdwDataLen
, DWORD dwFlags
);
978 BOOL WINAPI
CryptGetDefaultProviderA (DWORD dwProvType
, DWORD
*pdwReserved
,
979 DWORD dwFlags
, LPSTR pszProvName
, DWORD
*pcbProvName
);
980 BOOL WINAPI
CryptGetDefaultProviderW (DWORD dwProvType
, DWORD
*pdwReserved
,
981 DWORD dwFlags
, LPWSTR pszProvName
, DWORD
*pcbProvName
);
982 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
983 BOOL WINAPI
CryptGetUserKey (HCRYPTPROV hProv
, DWORD dwKeySpec
, HCRYPTKEY
*phUserKey
);
984 BOOL WINAPI
CryptHashData (HCRYPTHASH hHash
, BYTE
*pbData
, DWORD dwDataLen
, DWORD dwFlags
);
985 BOOL WINAPI
CryptHashSessionKey (HCRYPTHASH hHash
, HCRYPTKEY hKey
, DWORD dwFlags
);
986 BOOL WINAPI
CryptImportKey (HCRYPTPROV hProv
, BYTE
*pbData
, DWORD dwDataLen
,
987 HCRYPTKEY hPubKey
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
988 BOOL WINAPI
CryptRegisterOIDFunction(DWORD
,LPCSTR
,LPCSTR
,LPCWSTR
,LPCSTR
);
990 BOOL WINAPI
CryptReleaseContext (HCRYPTPROV hProv
, DWORD dwFlags
);
991 BOOL WINAPI
CryptSignHashA (HCRYPTHASH hHash
, DWORD dwKeySpec
, LPCSTR sDescription
,
992 DWORD dwFlags
, BYTE
*pbSignature
, DWORD
*pdwSigLen
);
993 BOOL WINAPI
CryptSignHashW (HCRYPTHASH hHash
, DWORD dwKeySpec
, LPCWSTR sDescription
,
994 DWORD dwFlags
, BYTE
*pbSignature
, DWORD
*pdwSigLen
);
995 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
996 BOOL WINAPI
CryptSetHashParam (HCRYPTHASH hHash
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
997 BOOL WINAPI
CryptSetKeyParam (HCRYPTKEY hKey
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
998 BOOL WINAPI
CryptSetProviderA (LPCSTR pszProvName
, DWORD dwProvType
);
999 BOOL WINAPI
CryptSetProviderW (LPCWSTR pszProvName
, DWORD dwProvType
);
1000 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
1001 BOOL WINAPI
CryptSetProviderExA (LPCSTR pszProvName
, DWORD dwProvType
, DWORD
*pdwReserved
, DWORD dwFlags
);
1002 BOOL WINAPI
CryptSetProviderExW (LPCWSTR pszProvName
, DWORD dwProvType
, DWORD
*pdwReserved
, DWORD dwFlags
);
1003 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
1004 BOOL WINAPI
CryptSetProvParam (HCRYPTPROV hProv
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
1005 BOOL WINAPI
CryptVerifySignatureA (HCRYPTHASH hHash
, BYTE
*pbSignature
, DWORD dwSigLen
,
1006 HCRYPTKEY hPubKey
, LPCSTR sDescription
, DWORD dwFlags
);
1007 BOOL WINAPI
CryptVerifySignatureW (HCRYPTHASH hHash
, BYTE
*pbSignature
, DWORD dwSigLen
,
1008 HCRYPTKEY hPubKey
, LPCWSTR sDescription
, DWORD dwFlags
);
1009 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
1011 /* cert store functions */
1012 HCERTSTORE WINAPI
CertOpenStore(LPCSTR lpszStoreProvider
, DWORD dwEncodingType
,
1013 HCRYPTPROV hCryptProv
, DWORD dwFlags
, const void *pvPara
);
1015 HCERTSTORE WINAPI
CertOpenSystemStoreA(HCRYPTPROV hProv
,
1016 LPCSTR szSubSystemProtocol
);
1017 HCERTSTORE WINAPI
CertOpenSystemStoreW(HCRYPTPROV hProv
,
1018 LPCWSTR szSubSystemProtocol
);
1019 #define CertOpenSystemStore WINELIB_NAME_AW(CertOpenSystemStore)
1021 PCCERT_CONTEXT WINAPI
CertEnumCertificatesInStore(HCERTSTORE hCertStore
, PCCERT_CONTEXT pPrev
);
1023 BOOL WINAPI
CertEnumSystemStoreLocation(DWORD dwFlags
, void *pvArg
,
1024 PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum
);
1026 BOOL WINAPI
CertEnumSystemStore(DWORD dwFlags
, void *pvSystemStoreLocationPara
,
1027 void *pvArg
, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum
);
1029 BOOL WINAPI
CertEnumPhysicalStore(const void *pvSystemStore
, DWORD dwFlags
,
1030 void *pvArg
, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum
);
1032 BOOL WINAPI
CertSaveStore(HCERTSTORE hCertStore
, DWORD dwMsgAndCertEncodingType
,
1033 DWORD dwSaveAs
, DWORD dwSaveTo
, void* pvSaveToPara
, DWORD dwFlags
);
1035 PCCRL_CONTEXT WINAPI
CertCreateCRLContext( DWORD dwCertEncodingType
,
1036 const BYTE
* pbCrlEncoded
, DWORD cbCrlEncoded
);
1038 BOOL WINAPI
CertAddStoreToCollection(HCERTSTORE hCollectionStore
,
1039 HCERTSTORE hSiblingStore
, DWORD dwUpdateFlags
, DWORD dwPriority
);
1041 void WINAPI
CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore
,
1042 HCERTSTORE hSiblingStore
);
1044 PCCERT_CHAIN_CONTEXT WINAPI
CertFindChainInStore(HCERTSTORE hCertStore
,
1045 DWORD dwCertEncodingType
, DWORD dwFindFlags
, DWORD dwFindType
,
1046 const void *pvFindPara
, PCCERT_CHAIN_CONTEXT pPrevChainContext
);
1048 BOOL WINAPI
CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID
,
1049 PCCERT_CHAIN_CONTEXT pChainContext
, PCERT_CHAIN_POLICY_PARA pPolicyPara
,
1050 PCERT_CHAIN_POLICY_STATUS pPolicyStatus
);
1052 BOOL WINAPI
CertCloseStore( HCERTSTORE hCertStore
, DWORD dwFlags
);
1054 BOOL WINAPI
CertFreeCertificateContext( PCCERT_CONTEXT pCertContext
);