winealsa: Use dedicated macros to call interface functions.
[wine.git] / include / wincrypt.h
blob81ae7d040dac766e2f1dbfdf928147752ba257a3
1 /*
2 * Copyright (C) 2002 Travis Michielsen
3 * Copyright (C) 2004-2005 Juan Lang
4 * Copyright (C) 2007 Vijay Kiran Kamuju
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WINCRYPT_H
22 #define __WINE_WINCRYPT_H
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 #include <bcrypt.h>
29 /* FIXME: #include <ncrypt.h> */
31 #ifndef WINADVAPI
32 #ifdef _ADVAPI32_
33 # define WINADVAPI
34 #else
35 # define WINADVAPI DECLSPEC_IMPORT
36 #endif
37 #endif
39 #ifndef WINCRYPT32API
40 #ifdef _CRYPT32_
41 # define WINCRYPT32API
42 #else
43 # define WINCRYPT32API DECLSPEC_IMPORT
44 #endif
45 #endif
47 /* some typedefs for function parameters */
48 typedef unsigned int ALG_ID;
49 typedef ULONG_PTR HCRYPTPROV;
50 typedef ULONG_PTR HCRYPTPROV_OR_NCRYPT_KEY_HANDLE;
51 typedef ULONG_PTR HCRYPTPROV_LEGACY;
52 typedef ULONG_PTR HCRYPTKEY;
53 typedef ULONG_PTR HCRYPTHASH;
54 typedef void *HCERTSTORE;
55 typedef void *HCRYPTMSG;
56 typedef void *HCERTSTOREPROV;
57 typedef void *HCRYPTOIDFUNCSET;
58 typedef void *HCRYPTOIDFUNCADDR;
59 typedef void *HCRYPTDEFAULTCONTEXT;
61 /* CSP Structs */
63 typedef struct _PROV_ENUMALGS {
64 ALG_ID aiAlgid;
65 DWORD dwBitLen;
66 DWORD dwNameLen;
67 CHAR szName[20];
68 } PROV_ENUMALGS;
70 typedef struct _PROV_ENUMALGS_EX {
71 ALG_ID aiAlgid;
72 DWORD dwDefaultLen;
73 DWORD dwMinLen;
74 DWORD dwMaxLen;
75 DWORD dwProtocols;
76 DWORD dwNameLen;
77 CHAR szName[20];
78 DWORD dwLongNameLen;
79 CHAR szLongName[40];
80 } PROV_ENUMALGS_EX;
82 #define SCHANNEL_MAC_KEY 0
83 #define SCHANNEL_ENC_KEY 1
85 typedef struct _SCHANNEL_ALG {
86 DWORD dwUse;
87 ALG_ID Algid;
88 DWORD cBits;
89 DWORD dwFlags;
90 DWORD dwReserved;
91 } SCHANNEL_ALG, *PSCHANNEL_ALG;
94 #define CRYPT_IPSEC_HMAC_KEY 0x0100
96 typedef struct _HMAC_INFO {
97 ALG_ID HashAlgid;
98 BYTE* pbInnerString;
99 DWORD cbInnerString;
100 BYTE* pbOuterString;
101 DWORD cbOuterString;
102 } HMAC_INFO, *PHMAC_INFO;
104 typedef struct _CRYPTOAPI_BLOB {
105 DWORD cbData;
106 BYTE* pbData;
107 } CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
108 CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB,
109 CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
110 CERT_NAME_BLOB, *PCERT_NAME_BLOB,
111 CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
112 CERT_BLOB, *PCERT_BLOB,
113 CRL_BLOB, *PCRL_BLOB,
114 DATA_BLOB, *PDATA_BLOB,
115 CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB,
116 CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB,
117 CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB,
118 CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
119 CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
121 typedef struct _CRYPTPROTECT_PROMPTSTRUCT{
122 DWORD cbSize;
123 DWORD dwPromptFlags;
124 HWND hwndApp;
125 LPCWSTR szPrompt;
126 } CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT;
128 typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
129 LPSTR pszObjId;
130 CRYPT_OBJID_BLOB Parameters;
131 } CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
133 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
134 LPSTR pszObjId;
135 CRYPT_OBJID_BLOB Value;
136 } CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
138 typedef struct _PUBLICKEYSTRUC {
139 BYTE bType;
140 BYTE bVersion;
141 WORD reserved;
142 ALG_ID aiKeyAlg;
143 } BLOBHEADER, PUBLICKEYSTRUC;
145 typedef struct _RSAPUBKEY {
146 DWORD magic;
147 DWORD bitlen;
148 DWORD pubexp;
149 } RSAPUBKEY;
151 typedef struct _PUBKEY {
152 DWORD magic;
153 DWORD bitlen;
154 } DHPUBKEY, DSSPUBKEY, KEAPUBKEY, TEKPUBKEY;
156 typedef struct _DSSSEED {
157 DWORD counter;
158 BYTE seed[20];
159 } DSSSEED;
161 typedef struct _PUBKEYVER3 {
162 DWORD magic;
163 DWORD bitlenP;
164 DWORD bitlenQ;
165 DWORD bitlenJ;
166 DSSSEED DSSSeed;
167 } DHPUBKEY_VER3, DSSPUBKEY_VER3;
169 typedef struct _PRIVKEYVER3 {
170 DWORD magic;
171 DWORD bitlenP;
172 DWORD bitlenQ;
173 DWORD bitlenJ;
174 DWORD bitlenX;
175 DSSSEED DSSSeed;
176 } DHPRIVKEY_VER3, DSSPRIVKEY_VER3;
178 typedef struct _KEY_TYPE_SUBTYPE {
179 DWORD dwKeySpec;
180 GUID Type;
181 GUID SubType;
182 } KEY_TYPE_SUBTYPE, *PKEY_TYPE_SUBTYPE;
184 typedef struct _CERT_FORTEZZA_DATA_PROP {
185 unsigned char SerialNumber[8];
186 int CertIndex;
187 unsigned char CertLabel[36];
188 } CERT_FORTEZZA_DATA_PROP;
190 typedef struct _CMS_DH_KEY_INFO {
191 DWORD dwVersion;
192 ALG_ID Algid;
193 LPSTR pszContentEncObjId;
194 CRYPT_DATA_BLOB PubInfo;
195 void *pReserved;
196 } CMS_DH_KEY_INFO, *PCMS_DH_KEY_INFO;
198 typedef struct _CRYPT_BIT_BLOB {
199 DWORD cbData;
200 BYTE *pbData;
201 DWORD cUnusedBits;
202 } CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
204 typedef struct _CRYPT_KEY_PROV_PARAM {
205 DWORD dwParam;
206 BYTE *pbData;
207 DWORD cbData;
208 DWORD dwFlags;
209 } CRYPT_KEY_PROV_PARAM, *PCRYPT_KEY_PROV_PARAM;
211 typedef struct _CRYPT_KEY_PROV_INFO {
212 LPWSTR pwszContainerName;
213 LPWSTR pwszProvName;
214 DWORD dwProvType;
215 DWORD dwFlags;
216 DWORD cProvParam;
217 PCRYPT_KEY_PROV_PARAM rgProvParam;
218 DWORD dwKeySpec;
219 } CRYPT_KEY_PROV_INFO, *PCRYPT_KEY_PROV_INFO;
221 typedef struct _CERT_KEY_CONTEXT {
222 DWORD cbSize;
223 HCRYPTPROV hCryptProv;
224 DWORD dwKeySpec;
225 } CERT_KEY_CONTEXT, *PCERT_KEY_CONTEXT;
227 typedef struct _CERT_PUBLIC_KEY_INFO {
228 CRYPT_ALGORITHM_IDENTIFIER Algorithm;
229 CRYPT_BIT_BLOB PublicKey;
230 } CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
232 typedef struct _CERT_EXTENSION {
233 LPSTR pszObjId;
234 BOOL fCritical;
235 CRYPT_OBJID_BLOB Value;
236 } CERT_EXTENSION, *PCERT_EXTENSION;
238 typedef struct _CERT_EXTENSIONS {
239 DWORD cExtension;
240 PCERT_EXTENSION rgExtension;
241 } CERT_EXTENSIONS, *PCERT_EXTENSIONS;
243 typedef struct _CERT_INFO {
244 DWORD dwVersion;
245 CRYPT_INTEGER_BLOB SerialNumber;
246 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
247 CERT_NAME_BLOB Issuer;
248 FILETIME NotBefore;
249 FILETIME NotAfter;
250 CERT_NAME_BLOB Subject;
251 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
252 CRYPT_BIT_BLOB IssuerUniqueId;
253 CRYPT_BIT_BLOB SubjectUniqueId;
254 DWORD cExtension;
255 PCERT_EXTENSION rgExtension;
256 } CERT_INFO, *PCERT_INFO;
258 typedef struct _CERT_RDN_ATTR {
259 LPSTR pszObjId;
260 DWORD dwValueType;
261 CERT_RDN_VALUE_BLOB Value;
262 } CERT_RDN_ATTR, *PCERT_RDN_ATTR;
264 typedef struct _CERT_RDN {
265 DWORD cRDNAttr;
266 PCERT_RDN_ATTR rgRDNAttr;
267 } CERT_RDN, *PCERT_RDN;
269 typedef struct _CERT_NAME_INFO {
270 DWORD cRDN;
271 PCERT_RDN rgRDN;
272 } CERT_NAME_INFO, *PCERT_NAME_INFO;
274 typedef struct _CERT_NAME_VALUE {
275 DWORD dwValueType;
276 CERT_RDN_VALUE_BLOB Value;
277 } CERT_NAME_VALUE, *PCERT_NAME_VALUE;
279 typedef struct _CERT_ENCRYPTED_PRIVATE_KEY_INFO {
280 CRYPT_ALGORITHM_IDENTIFIER EncryptionAlgorithm;
281 CRYPT_DATA_BLOB EncryptedPrivateKey;
282 } CERT_ENCRYPTED_PRIVATE_KEY_INFO, *PCERT_ENCRYPTED_PRIVATE_KEY_INFO;
284 typedef struct _CERT_AUTHORITY_KEY_ID_INFO {
285 CRYPT_DATA_BLOB KeyId;
286 CERT_NAME_BLOB CertIssuer;
287 CRYPT_INTEGER_BLOB CertSerialNumber;
288 } CERT_AUTHORITY_KEY_ID_INFO, *PCERT_AUTHORITY_KEY_ID_INFO;
290 typedef struct _CERT_PRIVATE_KEY_VALIDITY {
291 FILETIME NotBefore;
292 FILETIME NotAfter;
293 } CERT_PRIVATE_KEY_VALIDITY, *PCERT_PRIVATE_KEY_VALIDITY;
295 typedef struct _CERT_KEY_ATTRIBUTES_INFO {
296 CRYPT_DATA_BLOB KeyId;
297 CRYPT_BIT_BLOB IntendedKeyUsage;
298 PCERT_PRIVATE_KEY_VALIDITY pPrivateKeyUsagePeriod;
299 } CERT_KEY_ATTRIBUTES_INFO, *PCERT_KEY_ATTRIBUTES_INFO;
301 typedef struct _CERT_ECC_SIGNATURE {
302 CRYPT_UINT_BLOB r;
303 CRYPT_UINT_BLOB s;
304 } CERT_ECC_SIGNATURE, *PCERT_ECC_SIGNATURE;
306 /* byte 0 */
307 #define CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80
308 #define CERT_NON_REPUDIATION_KEY_USAGE 0x40
309 #define CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20
310 #define CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10
311 #define CERT_KEY_AGREEMENT_KEY_USAGE 0x08
312 #define CERT_KEY_CERT_SIGN_KEY_USAGE 0x04
313 #define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x02
314 #define CERT_CRL_SIGN_KEY_USAGE 0x02
315 #define CERT_ENCIPHER_ONLY_KEY_USAGE 0x01
316 /* byte 1 */
317 #define CERT_DECIPHER_ONLY_KEY_USAGE 0x80
319 typedef struct _CERT_POLICY_ID {
320 DWORD cCertPolicyElementId;
321 LPSTR *rgbszCertPolicyElementId;
322 } CERT_POLICY_ID, *PCERT_POLICY_ID;
324 typedef struct _CERT_KEY_USAGE_RESTRICTION_INFO {
325 DWORD cCertPolicyId;
326 PCERT_POLICY_ID rgCertPolicyId;
327 CRYPT_BIT_BLOB RestrictedKeyUsage;
328 } CERT_KEY_USAGE_RESTRICTION_INFO, *PCERT_KEY_USAGE_RESTRICTION_INFO;
330 typedef struct _CERT_OTHER_NAME {
331 LPSTR pszObjId;
332 CRYPT_OBJID_BLOB Value;
333 } CERT_OTHER_NAME, *PCERT_OTHER_NAME;
335 typedef struct _CERT_ALT_NAME_ENTRY {
336 DWORD dwAltNameChoice;
337 union {
338 PCERT_OTHER_NAME pOtherName;
339 LPWSTR pwszRfc822Name;
340 LPWSTR pwszDNSName;
341 CERT_NAME_BLOB DirectoryName;
342 LPWSTR pwszURL;
343 CRYPT_DATA_BLOB IPAddress;
344 LPSTR pszRegisteredID;
345 } DUMMYUNIONNAME;
346 } CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY;
348 #define CERT_ALT_NAME_OTHER_NAME 1
349 #define CERT_ALT_NAME_RFC822_NAME 2
350 #define CERT_ALT_NAME_DNS_NAME 3
351 #define CERT_ALT_NAME_X400_ADDRESS 4
352 #define CERT_ALT_NAME_DIRECTORY_NAME 5
353 #define CERT_ALT_NAME_EDI_PARTY_NAME 6
354 #define CERT_ALT_NAME_URL 7
355 #define CERT_ALT_NAME_IP_ADDRESS 8
356 #define CERT_ALT_NAME_REGISTERED_ID 9
358 typedef struct _CERT_ALT_NAME_INFO {
359 DWORD cAltEntry;
360 PCERT_ALT_NAME_ENTRY rgAltEntry;
361 } CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO;
363 #define CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK 0xff
364 #define CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT 16
365 #define CERT_ALT_NAME_VALUE_ERR_INDEX_MASK 0x0000ffff
366 #define CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT 0
367 #define GET_CERT_ALT_NAME_ENTRY_ERR_INDEX(x) \
368 (((x) >> CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT) & \
369 CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK)
370 #define GET_CERT_ALT_NAME_VALUE_ERR_INDEX(x) \
371 ((x) & CERT_ALT_NAME_VALUE_ERR_INDEX_MASK)
373 typedef struct _CERT_BASIC_CONSTRAINTS_INFO {
374 CRYPT_BIT_BLOB SubjectType;
375 BOOL fPathLenConstraint;
376 DWORD dwPathLenConstraint;
377 DWORD cSubtreesConstraint;
378 CERT_NAME_BLOB *rgSubtreesConstraint;
379 } CERT_BASIC_CONSTRAINTS_INFO, *PCERT_BASIC_CONSTRAINTS_INFO;
381 #define CERT_CA_SUBJECT_FLAG 0x80
382 #define CERT_END_ENTITY_SUBJECT_FLAG 0x40
384 typedef struct _CERT_BASIC_CONSTRAINTS2_INFO {
385 BOOL fCA;
386 BOOL fPathLenConstraint;
387 DWORD dwPathLenConstraint;
388 } CERT_BASIC_CONSTRAINTS2_INFO, *PCERT_BASIC_CONSTRAINTS2_INFO;
390 typedef struct _CERT_POLICY_QUALIFIER_INFO {
391 LPSTR pszPolicyQualifierId;
392 CRYPT_OBJID_BLOB Qualifier;
393 } CERT_POLICY_QUALIFIER_INFO, *PCERT_POLICY_QUALIFIER_INFO;
395 typedef struct _CERT_POLICY_INFO {
396 LPSTR pszPolicyIdentifier;
397 DWORD cPolicyQualifier;
398 CERT_POLICY_QUALIFIER_INFO *rgPolicyQualifier;
399 } CERT_POLICY_INFO, *PCERT_POLICY_INFO;
401 typedef struct _CERT_POLICIES_INFO {
402 DWORD cPolicyInfo;
403 CERT_POLICY_INFO *rgPolicyInfo;
404 } CERT_POLICIES_INFO, *PCERT_POLICIES_INFO;
406 typedef struct _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE {
407 LPSTR pszOrganization;
408 DWORD cNoticeNumbers;
409 int *rgNoticeNumbers;
410 } CERT_POLICY_QUALIFIER_NOTICE_REFERENCE,
411 *PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE;
413 typedef struct _CERT_POLICY_QUALIFIER_USER_NOTICE {
414 CERT_POLICY_QUALIFIER_NOTICE_REFERENCE *pNoticeReference;
415 LPWSTR pszDisplayText;
416 } CERT_POLICY_QUALIFIER_USER_NOTICE, *PCERT_POLICY_QUALIFIER_USER_NOTICE;
418 typedef struct _CPS_URLS {
419 LPWSTR pszURL;
420 CRYPT_ALGORITHM_IDENTIFIER *pAlgorithm;
421 CRYPT_DATA_BLOB *pDigest;
422 } CPS_URLS, *PCPS_URLS;
424 typedef struct _CERT_POLICY95_QUALIFIER1 {
425 LPWSTR pszPracticesReference;
426 LPSTR pszNoticeIdentifier;
427 LPSTR pszNSINoticeIdentifier;
428 DWORD cCPSURLs;
429 CPS_URLS *rgCPSURLs;
430 } CERT_POLICY95_QUALIFIER1, *PCERT_POLICY95_QUALIFIER1;
432 typedef struct _CERT_POLICY_MAPPING {
433 LPSTR pszIssuerDomainPolicy;
434 LPSTR pszSubjectDomainPolicy;
435 } CERT_POLICY_MAPPING, *PCERT_POLICY_MAPPING;
437 typedef struct _CERT_POLICY_MAPPINGS_INFO {
438 DWORD cPolicyMapping;
439 PCERT_POLICY_MAPPING rgPolicyMapping;
440 } CERT_POLICY_MAPPINGS_INFO, *PCERT_POLICY_MAPPINGS_INFO;
442 typedef struct _CERT_POLICY_CONSTRAINTS_INFO {
443 BOOL fRequireExplicitPolicy;
444 DWORD dwRequireExplicitPolicySkipCerts;
445 BOOL fInhibitPolicyMapping;
446 DWORD dwInhibitPolicyMappingSkipCerts;
447 } CERT_POLICY_CONSTRAINTS_INFO, *PCERT_POLICY_CONSTRAINTS_INFO;
449 typedef struct _CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY {
450 LPSTR pszObjId;
451 DWORD cValue;
452 PCRYPT_DER_BLOB rgValue;
453 } CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY, *PCRYPT_CONTENT_INFO_SEQUENCE_OF_ANY;
455 typedef struct _CRYPT_CONTENT_INFO {
456 LPSTR pszObjId;
457 CRYPT_DER_BLOB Content;
458 } CRYPT_CONTENT_INFO, *PCRYPT_CONTENT_INFO;
460 typedef struct _CRYPT_SEQUENCE_OF_ANY {
461 DWORD cValue;
462 PCRYPT_DER_BLOB rgValue;
463 } CRYPT_SEQUENCE_OF_ANY, *PCRYPT_SEQUENCE_OF_ANY;
465 typedef struct _CERT_AUTHORITY_KEY_ID2_INFO {
466 CRYPT_DATA_BLOB KeyId;
467 CERT_ALT_NAME_INFO AuthorityCertIssuer;
468 CRYPT_INTEGER_BLOB AuthorityCertSerialNumber;
469 } CERT_AUTHORITY_KEY_ID2_INFO, *PCERT_AUTHORITY_KEY_ID2_INFO;
471 typedef struct _CERT_ACCESS_DESCRIPTION {
472 LPSTR pszAccessMethod;
473 CERT_ALT_NAME_ENTRY AccessLocation;
474 } CERT_ACCESS_DESCRIPTION, *PCERT_ACCESS_DESCRIPTION;
476 typedef struct _CERT_AUTHORITY_INFO_ACCESS {
477 DWORD cAccDescr;
478 PCERT_ACCESS_DESCRIPTION rgAccDescr;
479 } CERT_AUTHORITY_INFO_ACCESS, *PCERT_AUTHORITY_INFO_ACCESS;
481 typedef struct _CERT_CONTEXT {
482 DWORD dwCertEncodingType;
483 BYTE *pbCertEncoded;
484 DWORD cbCertEncoded;
485 PCERT_INFO pCertInfo;
486 HCERTSTORE hCertStore;
487 } CERT_CONTEXT, *PCERT_CONTEXT;
488 typedef const CERT_CONTEXT *PCCERT_CONTEXT;
490 typedef struct _CRL_ENTRY {
491 CRYPT_INTEGER_BLOB SerialNumber;
492 FILETIME RevocationDate;
493 DWORD cExtension;
494 PCERT_EXTENSION rgExtension;
495 } CRL_ENTRY, *PCRL_ENTRY;
497 typedef struct _CRL_INFO {
498 DWORD dwVersion;
499 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
500 CERT_NAME_BLOB Issuer;
501 FILETIME ThisUpdate;
502 FILETIME NextUpdate;
503 DWORD cCRLEntry;
504 PCRL_ENTRY rgCRLEntry;
505 DWORD cExtension;
506 PCERT_EXTENSION rgExtension;
507 } CRL_INFO, *PCRL_INFO;
509 typedef struct _CRL_DIST_POINT_NAME {
510 DWORD dwDistPointNameChoice;
511 union {
512 CERT_ALT_NAME_INFO FullName;
513 } DUMMYUNIONNAME;
514 } CRL_DIST_POINT_NAME, *PCRL_DIST_POINT_NAME;
516 #define CRL_DIST_POINT_NO_NAME 0
517 #define CRL_DIST_POINT_FULL_NAME 1
518 #define CRL_DIST_POINT_ISSUER_RDN_NAME 2
520 typedef struct _CRL_DIST_POINT {
521 CRL_DIST_POINT_NAME DistPointName;
522 CRYPT_BIT_BLOB ReasonFlags;
523 CERT_ALT_NAME_INFO CRLIssuer;
524 } CRL_DIST_POINT, *PCRL_DIST_POINT;
526 #define CRL_REASON_UNUSED_FLAG 0x80
527 #define CRL_REASON_KEY_COMPROMISE_FLAG 0x40
528 #define CRL_REASON_CA_COMPROMISE_FLAG 0x20
529 #define CRL_REASON_AFFILIATION_CHANGED_FLAG 0x10
530 #define CRL_REASON_SUPERSEDED_FLAG 0x08
531 #define CRL_REASON_CESSATION_OF_OPERATION_FLAG 0x04
532 #define CRL_REASON_CERTIFICATE_HOLD_FLAG 0x02
534 typedef struct _CRL_DIST_POINTS_INFO {
535 DWORD cDistPoint;
536 PCRL_DIST_POINT rgDistPoint;
537 } CRL_DIST_POINTS_INFO, *PCRL_DIST_POINTS_INFO;
539 #define CRL_DIST_POINT_ERR_INDEX_MASK 0x7f
540 #define CRL_DIST_POINT_ERR_INDEX_SHIFT 24
541 #define GET_CRL_DIST_POINT_ERR_INDEX(x) \
542 (((x) >> CRL_DIST_POINT_ERR_INDEX_SHIFT) & CRL_DIST_POINT_ERR_INDEX_MASK)
544 #define CRL_DIST_POINT_ERR_CRL_ISSUER_BIT __MSABI_LONG(0x80000000)
545 #define IS_CRL_DIST_POINT_ERR_CRL_ISSUER(x) \
546 ((x) & CRL_DIST_POINT_ERR_CRL_ISSUER_BIT)
548 typedef struct _CROSS_CERT_DIST_POINTS_INFO {
549 DWORD dwSyncDeltaTime;
550 DWORD cDistPoint;
551 PCERT_ALT_NAME_INFO rgDistPoint;
552 } CROSS_CERT_DIST_POINTS_INFO, *PCROSS_CERT_DIST_POINTS_INFO;
554 #define CROSS_CERT_DIST_POINT_ERR_INDEX_MASK 0xff
555 #define CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT 24
556 #define GET_CROSS_CERT_DIST_POINT_ERR_INDEX(x) \
557 (((x) >> CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT) & \
558 CROSS_CERT_DIST_POINT_ERR_INDEX_MASK)
560 typedef struct _CERT_PAIR {
561 CERT_BLOB Forward;
562 CERT_BLOB Reverse;
563 } CERT_PAIR, *PCERT_PAIR;
565 typedef struct _CRL_ISSUING_DIST_POINT {
566 CRL_DIST_POINT_NAME DistPointName;
567 BOOL fOnlyContainsUserCerts;
568 BOOL fOnlyContainsCACerts;
569 CRYPT_BIT_BLOB OnlySomeReasonFlags;
570 BOOL fIndirectCRL;
571 } CRL_ISSUING_DIST_POINT, *PCRL_ISSUING_DIST_POINT;
573 typedef struct _CERT_GENERAL_SUBTREE {
574 CERT_ALT_NAME_ENTRY Base;
575 DWORD dwMinimum;
576 BOOL fMaximum;
577 DWORD dwMaximum;
578 } CERT_GENERAL_SUBTREE, *PCERT_GENERAL_SUBTREE;
580 typedef struct _CERT_NAME_CONSTRAINTS_INFO {
581 DWORD cPermittedSubtree;
582 PCERT_GENERAL_SUBTREE rgPermittedSubtree;
583 DWORD cExcludedSubtree;
584 PCERT_GENERAL_SUBTREE rgExcludedSubtree;
585 } CERT_NAME_CONSTRAINTS_INFO, *PCERT_NAME_CONSTRAINTS_INFO;
587 #define CERT_EXCLUDED_SUBTREE_BIT __MSABI_LONG(0x80000000)
588 #define IS_CERT_EXCLUDED_SUBTREE(x) ((x) & CERT_EXCLUDED_SUBTREE_BIT)
590 typedef struct _CRYPT_ATTRIBUTE {
591 LPSTR pszObjId;
592 DWORD cValue;
593 PCRYPT_DATA_BLOB rgValue;
594 } CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;
596 typedef struct _CRYPT_ATTRIBUTES {
597 DWORD cAttr;
598 PCRYPT_ATTRIBUTE rgAttr;
599 } CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES;
601 typedef struct _CERT_REQUEST_INFO {
602 DWORD dwVersion;
603 CERT_NAME_BLOB Subject;
604 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
605 DWORD cAttribute;
606 PCRYPT_ATTRIBUTE rgAttribute;
607 } CERT_REQUEST_INFO, *PCERT_REQUEST_INFO;
609 typedef struct _CERT_KEYGEN_REQUEST_INFO {
610 DWORD dwVersion;
611 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
612 LPWSTR pwszChallengeString;
613 } CERT_KEYGEN_REQUEST_INFO, *PCERT_KEYGEN_REQUEST_INFO;
615 typedef struct _CERT_SIGNED_CONTENT_INFO {
616 CRYPT_DER_BLOB ToBeSigned;
617 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
618 CRYPT_BIT_BLOB Signature;
619 } CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO;
621 typedef struct _OCSP_SIGNATURE_INFO {
622 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
623 CRYPT_BIT_BLOB Signature;
624 DWORD cCertEncoded;
625 PCERT_BLOB rgCertEncoded;
626 } OCSP_SIGNATURE_INFO, *POCSP_SIGNATURE_INFO;
628 typedef struct _OCSP_SIGNED_REQUEST_INFO {
629 CRYPT_DER_BLOB ToBeSigned;
630 POCSP_SIGNATURE_INFO pOptionalSignatureInfo;
631 } OCSP_SIGNED_REQUEST_INFO, *POCSP_SIGNED_REQUEST_INFO;
633 typedef struct _OCSP_CERT_ID {
634 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
635 CRYPT_HASH_BLOB IssuerNameHash;
636 CRYPT_HASH_BLOB IssuerKeyHash;
637 CRYPT_INTEGER_BLOB SerialNumber;
638 } OCSP_CERT_ID, *POCSP_CERT_ID;
640 typedef struct _OCSP_REQUEST_ENTRY {
641 OCSP_CERT_ID CertId;
642 DWORD cExtension;
643 PCERT_EXTENSION rgExtension;
644 } OCSP_REQUEST_ENTRY, *POCSP_REQUEST_ENTRY;
646 #define OCSP_REQUEST_V1 0
648 typedef struct _OCSP_REQUEST_INFO {
649 DWORD dwVersion;
650 PCERT_ALT_NAME_ENTRY pRequestorName;
651 DWORD cRequestEntry;
652 POCSP_REQUEST_ENTRY rgRequestEntry;
653 DWORD cExtension;
654 PCERT_EXTENSION rgExtension;
655 } OCSP_REQUEST_INFO, *POCSP_REQUEST_INFO;
657 #define OCSP_SUCCESSFUL_RESPONSE 0
658 #define OCSP_MALFORMED_REQUEST_RESPONSE 1
659 #define OCSP_INTERNAL_ERROR_RESPONSE 2
660 #define OCSP_TRY_LATER_RESPONSE 3
661 #define OCSP_SIG_REQUIRED_RESPONSE 5
662 #define OCSP_UNAUTHORIZED_RESPONSE 6
664 #define szOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE "1.3.6.1.5.5.7.48.1.1"
666 typedef struct _OCSP_RESPONSE_INFO {
667 DWORD dwStatus;
668 LPSTR pszObjId;
669 CRYPT_OBJID_BLOB Value;
670 } OCSP_RESPONSE_INFO, *POCSP_RESPONSE_INFO;
672 typedef struct _OCSP_BASIC_SIGNED_RESPONSE_INFO {
673 CRYPT_DER_BLOB ToBeSigned;
674 OCSP_SIGNATURE_INFO SignatureInfo;
675 } OCSP_BASIC_SIGNED_RESPONSE_INFO, *POCSP_BASIC_SIGNED_RESPONSE_INFO;
677 typedef struct _OCSP_BASIC_REVOKED_INFO {
678 FILETIME RevocationDate;
679 DWORD dwCrlReasonCode;
680 } OCSP_BASIC_REVOKED_INFO, *POCSP_BASIC_REVOKED_INFO;
682 #define OCSP_BASIC_GOOD_CERT_STATUS 0
683 #define OCSP_BASIC_REVOKED_CERT_STATUS 1
684 #define OCSP_BASIC_UNKNOWN_CERT_STATUS 2
686 typedef struct _OCSP_BASIC_RESPONSE_ENTRY {
687 OCSP_CERT_ID CertId;
688 DWORD dwCertStatus;
689 union {
690 POCSP_BASIC_REVOKED_INFO pRevokedInfo;
691 } DUMMYUNIONNAME;
692 FILETIME ThisUpdate;
693 FILETIME NextUpdate;
694 DWORD cExtension;
695 PCERT_EXTENSION rgExtension;
696 } OCSP_BASIC_RESPONSE_ENTRY, *POCSP_BASIC_RESPONSE_ENTRY;
698 #define OCSP_BASIC_RESPONSE_V1 0
699 #define OCSP_BASIC_BY_NAME_RESPONDER_ID 1
700 #define OCSP_BASIC_BY_KEY_RESPONDER_ID 2
702 typedef struct _OCSP_BASIC_RESPONSE_INFO {
703 DWORD dwVersion;
704 DWORD dwResponderIdChoice;
705 union {
706 CERT_NAME_BLOB ByNameResponderId;
707 CRYPT_HASH_BLOB ByKeyResponderId;
708 } DUMMYUNIONNAME;
709 FILETIME ProducedAt;
710 DWORD cResponseEntry;
711 POCSP_BASIC_RESPONSE_ENTRY rgResponseEntry;
712 DWORD cExtension;
713 PCERT_EXTENSION rgExtension;
714 } OCSP_BASIC_RESPONSE_INFO, *POCSP_BASIC_RESPONSE_INFO;
716 typedef struct _CRL_CONTEXT {
717 DWORD dwCertEncodingType;
718 BYTE *pbCrlEncoded;
719 DWORD cbCrlEncoded;
720 PCRL_INFO pCrlInfo;
721 HCERTSTORE hCertStore;
722 } CRL_CONTEXT, *PCRL_CONTEXT;
723 typedef const CRL_CONTEXT *PCCRL_CONTEXT;
725 #define SORTED_CTL_EXT_FLAGS_OFFSET (0*4)
726 #define SORTED_CTL_EXT_COUNT_OFFSET (1*4)
727 #define SORTED_CTL_EXT_MAX_COLLISION_OFFSET (2*4)
728 #define SORTED_CTL_EXT_HASH_BUCKET_OFFSET (3*4)
730 #define SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG 0x1
732 typedef struct _CERT_DSS_PARAMETERS {
733 CRYPT_UINT_BLOB p;
734 CRYPT_UINT_BLOB q;
735 CRYPT_UINT_BLOB g;
736 } CERT_DSS_PARAMETERS, *PCERT_DSS_PARAMETERS;
738 #define CERT_DSS_R_LEN 20
739 #define CERT_DSS_S_LEN 20
740 #define CERT_DSS_SIGNATURE_LEN (CERT_DSS_R_LEN + CERT_DSS_S_LEN)
742 #define CERT_MAX_ENCODED_DSS_SIGNATURE_LEN (2 + 2*(2 + 20 +1))
744 typedef struct _CERT_DH_PARAMETERS {
745 CRYPT_UINT_BLOB p;
746 CRYPT_UINT_BLOB g;
747 } CERT_DH_PARAMETERS, *PCERT_DH_PARAMETERS;
749 typedef struct _CERT_X942_DH_VALIDATION_PARAMS {
750 CRYPT_BIT_BLOB seed;
751 DWORD pgenCounter;
752 } CERT_X942_DH_VALIDATION_PARAMS, *PCERT_X942_DH_VALIDATION_PARAMS;
754 typedef struct _CERT_X942_DH_PARAMETERS {
755 CRYPT_UINT_BLOB p;
756 CRYPT_UINT_BLOB g;
757 CRYPT_UINT_BLOB q;
758 CRYPT_UINT_BLOB j;
759 PCERT_X942_DH_VALIDATION_PARAMS pValidationParams;
760 } CERT_X942_DH_PARAMETERS, *PCERT_X942_DH_PARAMETERS;
762 #define CRYPT_X942_COUNTER_BYTE_LENGTH 4
763 #define CRYPT_X942_KEY_LENGTH_BYTE_LENGTH 4
764 #define CRYPT_X942_PUB_INFO_BYTE_LENGTH (512/8)
766 typedef struct _CRYPT_X942_OTHER_INFO {
767 LPSTR pszContentEncryptionObjId;
768 BYTE rgbCounter[CRYPT_X942_COUNTER_BYTE_LENGTH];
769 BYTE rgbKeyLength[CRYPT_X942_KEY_LENGTH_BYTE_LENGTH];
770 CRYPT_DATA_BLOB PubInfo;
771 } CRYPT_X942_OTHER_INFO, *PCRYPT_X942_OTHER_INFO;
773 typedef struct _CRYPT_RC2_CBC_PARAMETERS {
774 DWORD dwVersion;
775 BOOL fIV;
776 BYTE rgbIV[4];
777 } CRYPT_RC2_CBC_PARAMETERS, *PCRYPT_RC2_CBC_PARAMETERS;
779 #define CRYPT_RC2_40BIT_VERSION 160
780 #define CRYPT_RC2_56BIT_VERSION 52
781 #define CRYPT_RC2_64BIT_VERSION 120
782 #define CRYPT_RC2_128BIT_VERSION 58
784 typedef struct _CRYPT_SMIME_CAPABILITY {
785 LPSTR pszObjId;
786 CRYPT_OBJID_BLOB Parameters;
787 } CRYPT_SMIME_CAPABILITY, *PCRYPT_SMIME_CAPABILITY;
789 typedef struct _CRYPT_SMIME_CAPABILITIES {
790 DWORD cCapability;
791 PCRYPT_SMIME_CAPABILITY rgCapability;
792 } CRYPT_SMIME_CAPABILITIES, *PCRYPT_SMIME_CAPABILITIES;
794 typedef struct _VTableProvStruc {
795 DWORD Version;
796 #ifdef WINE_STRICT_PROTOTYPES
797 BOOL (WINAPI *FuncVerifyImage)(LPCSTR,BYTE*);
798 void (WINAPI *FuncReturnhWnd)(HWND*);
799 #else
800 FARPROC FuncVerifyImage;
801 FARPROC FuncReturnhWnd;
802 #endif
803 DWORD dwProvType;
804 BYTE *pbContextInfo;
805 DWORD cbContextInfo;
806 LPSTR pszProvName;
807 } VTableProvStruc, *PVTableProvStruc;
809 typedef struct _CERT_PRIVATE_KEY_INFO {
810 DWORD Version;
811 CRYPT_ALGORITHM_IDENTIFIER Algorithm;
812 CRYPT_DER_BLOB PrivateKey;
813 PCRYPT_ATTRIBUTES pAttributes;
814 } CERT_PRIVATE_KEY_INFO, *PCERT_PRIVATE_KEY_INFO;
816 typedef struct _CTL_USAGE {
817 DWORD cUsageIdentifier;
818 LPSTR *rgpszUsageIdentifier;
819 } CTL_USAGE, *PCTL_USAGE, CERT_ENHKEY_USAGE, *PCERT_ENHKEY_USAGE;
821 typedef struct _CTL_ENTRY {
822 CRYPT_DATA_BLOB SubjectIdentifier;
823 DWORD cAttribute;
824 PCRYPT_ATTRIBUTE rgAttribute;
825 } CTL_ENTRY, *PCTL_ENTRY;
827 typedef struct _CTL_INFO {
828 DWORD dwVersion;
829 CTL_USAGE SubjectUsage;
830 CRYPT_DATA_BLOB ListIdentifier;
831 CRYPT_INTEGER_BLOB SequenceNumber;
832 FILETIME ThisUpdate;
833 FILETIME NextUpdate;
834 CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm;
835 DWORD cCTLEntry;
836 PCTL_ENTRY rgCTLEntry;
837 DWORD cExtension;
838 PCERT_EXTENSION rgExtension;
839 } CTL_INFO, *PCTL_INFO;
841 typedef struct _CTL_CONTEXT {
842 DWORD dwMsgAndCertEncodingType;
843 BYTE *pbCtlEncoded;
844 DWORD cbCtlEncoded;
845 PCTL_INFO pCtlInfo;
846 HCERTSTORE hCertStore;
847 HCRYPTMSG hCryptMsg;
848 BYTE *pbCtlContext;
849 DWORD cbCtlContext;
850 } CTL_CONTEXT, *PCTL_CONTEXT;
851 typedef const CTL_CONTEXT *PCCTL_CONTEXT;
853 typedef struct _CRYPT_TIME_STAMP_REQUEST_INFO {
854 LPSTR pszTimeStampAlgorithm;
855 LPSTR pszContentType;
856 CRYPT_OBJID_BLOB Content;
857 DWORD cAttribute;
858 PCRYPT_ATTRIBUTE rgAttribute;
859 } CRYPT_TIME_STAMP_REQUEST_INFO, *PCRYPT_TIME_STAMP_REQUEST_INFO;
861 typedef struct _CRYPT_ENROLLMENT_NAME_VALUE_PAIR {
862 LPWSTR pwszName;
863 LPWSTR pwszValue;
864 } CRYPT_ENROLLMENT_NAME_VALUE_PAIR, *PCRYPT_ENROLLMENT_NAME_VALUE_PAIR;
866 typedef struct _CMSG_SIGNER_INFO {
867 DWORD dwVersion;
868 CERT_NAME_BLOB Issuer;
869 CRYPT_INTEGER_BLOB SerialNumber;
870 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
871 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
872 CRYPT_DATA_BLOB EncryptedHash;
873 CRYPT_ATTRIBUTES AuthAttrs;
874 CRYPT_ATTRIBUTES UnauthAttrs;
875 } CMSG_SIGNER_INFO, *PCMSG_SIGNER_INFO;
877 #define CMSG_VERIFY_SIGNER_PUBKEY 1
878 #define CMSG_VERIFY_SIGNER_CERT 2
879 #define CMSG_VERIFY_SIGNER_CHAIN 3
880 #define CMSG_VERIFY_SIGNER_NULL 4
882 typedef struct _CERT_REVOCATION_CRL_INFO {
883 DWORD cbSize;
884 PCCRL_CONTEXT pBaseCrlContext;
885 PCCRL_CONTEXT pDeltaCrlContext;
886 PCRL_ENTRY pCrlEntry;
887 BOOL fDeltaCrlEntry;
888 } CERT_REVOCATION_CRL_INFO, *PCERT_REVOCATION_CRL_INFO;
890 typedef struct _CERT_REVOCATION_INFO {
891 DWORD cbSize;
892 DWORD dwRevocationResult;
893 LPCSTR pszRevocationOid;
894 LPVOID pvOidSpecificInfo;
895 BOOL fHasFreshnessTime;
896 DWORD dwFreshnessTime;
897 PCERT_REVOCATION_CRL_INFO pCrlInfo;
898 } CERT_REVOCATION_INFO, *PCERT_REVOCATION_INFO;
900 typedef struct _CERT_REVOCATION_PARA {
901 DWORD cbSize;
902 PCCERT_CONTEXT pIssuerCert;
903 DWORD cCertStore;
904 HCERTSTORE *rgCertStore;
905 HCERTSTORE hCrlStore;
906 LPFILETIME pftTimeToUse;
907 #ifdef CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
908 DWORD dwUrlRetrievalTimeout;
909 BOOL fCheckFreshnessTime;
910 DWORD dwFreshnessTime;
911 LPFILETIME pftCurrentTime;
912 PCERT_REVOCATION_CRL_INFO pCrlInfo;
913 #endif
914 } CERT_REVOCATION_PARA, *PCERT_REVOCATION_PARA;
916 #define CERT_CONTEXT_REVOCATION_TYPE 1
917 #define CERT_VERIFY_REV_CHAIN_FLAG 0x00000001
918 #define CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION 0x00000002
919 #define CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG 0x00000004
921 typedef struct _CTL_VERIFY_USAGE_PARA {
922 DWORD cbSize;
923 CRYPT_DATA_BLOB ListIdentifier;
924 DWORD cCtlStore;
925 HCERTSTORE *rghCtlStore;
926 DWORD cSignerStore;
927 HCERTSTORE *rghSignerStore;
928 } CTL_VERIFY_USAGE_PARA, *PCTL_VERIFY_USAGE_PARA;
930 typedef struct _CTL_VERIFY_USAGE_STATUS {
931 DWORD cbSize;
932 DWORD dwError;
933 DWORD dwFlags;
934 PCCTL_CONTEXT *ppCtl;
935 DWORD dwCtlEntryIndex;
936 PCCERT_CONTEXT *ppSigner;
937 DWORD dwSignerIndex;
938 } CTL_VERIFY_USAGE_STATUS, *PCTL_VERIFY_USAGE_STATUS;
940 #define CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG 0x1
941 #define CERT_VERIFY_TRUSTED_SIGNERS_FLAG 0x2
942 #define CERT_VERIFY_NO_TIME_CHECK_FLAG 0x4
943 #define CERT_VERIFY_ALLOW_MORE_USAGE_FLAG 0x8
944 #define CERT_VERIFY_UPDATED_CTL_FLAG 0x1
946 typedef struct _CERT_CHAIN {
947 DWORD cCerts;
948 PCERT_BLOB certs;
949 CRYPT_KEY_PROV_INFO keyLocatorInfo;
950 } CERT_CHAIN, *PCERT_CHAIN;
952 typedef struct _CERT_REVOCATION_STATUS {
953 DWORD cbSize;
954 DWORD dwIndex;
955 DWORD dwError;
956 DWORD dwReason;
957 BOOL fHasFreshnessTime;
958 DWORD dwFreshnessTime;
959 } CERT_REVOCATION_STATUS, *PCERT_REVOCATION_STATUS;
961 typedef struct _CERT_TRUST_LIST_INFO {
962 DWORD cbSize;
963 PCTL_ENTRY pCtlEntry;
964 PCCTL_CONTEXT pCtlContext;
965 } CERT_TRUST_LIST_INFO, *PCERT_TRUST_LIST_INFO;
967 #define CERT_TRUST_NO_ERROR 0x00000000
968 #define CERT_TRUST_IS_NOT_TIME_VALID 0x00000001
969 #define CERT_TRUST_IS_NOT_TIME_NESTED 0x00000002
970 #define CERT_TRUST_IS_REVOKED 0x00000004
971 #define CERT_TRUST_IS_NOT_SIGNATURE_VALID 0x00000008
972 #define CERT_TRUST_IS_NOT_VALID_FOR_USAGE 0x00000010
973 #define CERT_TRUST_IS_UNTRUSTED_ROOT 0x00000020
974 #define CERT_TRUST_REVOCATION_STATUS_UNKNOWN 0x00000040
975 #define CERT_TRUST_IS_CYCLIC 0x00000080
976 #define CERT_TRUST_INVALID_EXTENSION 0x00000100
977 #define CERT_TRUST_INVALID_POLICY_CONSTRAINTS 0x00000200
978 #define CERT_TRUST_INVALID_BASIC_CONSTRAINTS 0x00000400
979 #define CERT_TRUST_INVALID_NAME_CONSTRAINTS 0x00000800
980 #define CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT 0x00001000
981 #define CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT 0x00002000
982 #define CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT 0x00004000
983 #define CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT 0x00008000
984 #define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000
985 #define CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY 0x02000000
986 #define CERT_TRUST_IS_EXPLICIT_DISTRUST 0x04000000
987 #define CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT 0x08000000
989 #define CERT_TRUST_IS_PARTIAL_CHAIN 0x00010000
990 #define CERT_TRUST_CTL_IS_NOT_TIME_VALID 0x00020000
991 #define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 0x00040000
992 #define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 0x00080000
994 #define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 0x00000001
995 #define CERT_TRUST_HAS_KEY_MATCH_ISSUER 0x00000002
996 #define CERT_TRUST_HAS_NAME_MATCH_ISSUER 0x00000004
997 #define CERT_TRUST_IS_SELF_SIGNED 0x00000008
999 #define CERT_TRUST_HAS_PREFERRED_ISSUER 0x00000100
1000 #define CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY 0x00000200
1001 #define CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS 0x00000400
1002 #define CERT_TRUST_IS_PEER_TRUSTED 0x00000800
1003 #define CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED 0x00001000
1005 #define CERT_TRUST_IS_COMPLEX_CHAIN 0x00010000
1007 typedef struct _CERT_TRUST_STATUS {
1008 DWORD dwErrorStatus;
1009 DWORD dwInfoStatus;
1010 } CERT_TRUST_STATUS, *PCERT_TRUST_STATUS;
1012 typedef struct _CERT_CHAIN_ELEMENT {
1013 DWORD cbSize;
1014 PCCERT_CONTEXT pCertContext;
1015 CERT_TRUST_STATUS TrustStatus;
1016 PCERT_REVOCATION_INFO pRevocationInfo;
1017 PCERT_ENHKEY_USAGE pIssuanceUsage;
1018 PCERT_ENHKEY_USAGE pApplicationUsage;
1019 LPCWSTR pwszExtendedErrorInfo;
1020 } CERT_CHAIN_ELEMENT, *PCERT_CHAIN_ELEMENT;
1022 typedef struct _CERT_SIMPLE_CHAIN {
1023 DWORD cbSize;
1024 CERT_TRUST_STATUS TrustStatus;
1025 DWORD cElement;
1026 PCERT_CHAIN_ELEMENT *rgpElement;
1027 PCERT_TRUST_LIST_INFO pTrustListInfo;
1028 BOOL fHasRevocationFreshnessTime;
1029 DWORD dwRevocationFreshnessTime;
1030 } CERT_SIMPLE_CHAIN, *PCERT_SIMPLE_CHAIN;
1032 typedef struct _CERT_CHAIN_CONTEXT CERT_CHAIN_CONTEXT, *PCERT_CHAIN_CONTEXT;
1033 typedef const CERT_CHAIN_CONTEXT *PCCERT_CHAIN_CONTEXT;
1035 struct _CERT_CHAIN_CONTEXT {
1036 DWORD cbSize;
1037 CERT_TRUST_STATUS TrustStatus;
1038 DWORD cChain;
1039 PCERT_SIMPLE_CHAIN *rgpChain;
1040 DWORD cLowerQualityChainContext;
1041 PCCERT_CHAIN_CONTEXT *rgpLowerQualityChainContext;
1042 BOOL fHasRevocationFreshnessTime;
1043 DWORD dwRevocationFreshnessTime;
1046 typedef struct _CERT_CHAIN_POLICY_PARA {
1047 DWORD cbSize;
1048 DWORD dwFlags;
1049 void *pvExtraPolicyPara;
1050 } CERT_CHAIN_POLICY_PARA, *PCERT_CHAIN_POLICY_PARA;
1052 typedef struct _CERT_CHAIN_POLICY_STATUS {
1053 DWORD cbSize;
1054 DWORD dwError;
1055 LONG lChainIndex;
1056 LONG lElementIndex;
1057 void *pvExtraPolicyStatus;
1058 } CERT_CHAIN_POLICY_STATUS, *PCERT_CHAIN_POLICY_STATUS;
1060 #define CERT_CHAIN_POLICY_BASE ((LPCSTR)1)
1061 #define CERT_CHAIN_POLICY_AUTHENTICODE ((LPCSTR)2)
1062 #define CERT_CHAIN_POLICY_AUTHENTICODE_TS ((LPCSTR)3)
1063 #define CERT_CHAIN_POLICY_SSL ((LPCSTR)4)
1064 #define CERT_CHAIN_POLICY_BASIC_CONSTRAINTS ((LPCSTR)5)
1065 #define CERT_CHAIN_POLICY_NT_AUTH ((LPCSTR)6)
1066 #define CERT_CHAIN_POLICY_MICROSOFT_ROOT ((LPCSTR)7)
1068 #define CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG 0x00000001
1069 #define CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG 0x00000002
1070 #define CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG 0x00000004
1071 #define CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG 0x00000008
1073 #define CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS ( \
1074 CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG \
1075 CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG \
1076 CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG )
1078 #define CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG 0x00000010
1079 #define CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG 0x00000020
1080 #define CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG 0x00000040
1081 #define CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG 0x00000080
1083 #define CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG 0x00000100
1084 #define CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG 0x00000200
1085 #define CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG 0x00000400
1086 #define CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG 0x00000800
1088 #define CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS ( \
1089 CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG \
1090 CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG \
1091 CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG \
1092 CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG )
1094 #define CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG 0x00001000
1095 #define CERT_CHAIN_POLICY_IGNORE_NOT_SUPPORTED_CRITICAL_EXT_FLAG 0x00002000
1096 #define CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG 0x00004000
1097 #define CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG 0x00008000
1098 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000
1099 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG 0x00020000
1101 typedef struct _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA {
1102 DWORD cbSize;
1103 DWORD dwRegPolicySettings;
1104 PCMSG_SIGNER_INFO pSignerInfo;
1105 } AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA,
1106 *PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA;
1108 typedef struct _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS {
1109 DWORD cbSize;
1110 BOOL fCommercial;
1111 } AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS,
1112 *PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS;
1114 typedef struct _AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA {
1115 DWORD cbSize;
1116 DWORD dwRegPolicySettings;
1117 BOOL fCommercial;
1118 } AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA,
1119 *PAUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA;
1121 typedef struct _HTTPSPolicyCallbackData {
1122 union {
1123 DWORD cbStruct;
1124 DWORD cbSize;
1125 } DUMMYUNIONNAME;
1126 DWORD dwAuthType;
1127 DWORD fdwChecks;
1128 WCHAR *pwszServerName;
1129 } HTTPSPolicyCallbackData, *PHTTPSPolicyCallbackData,
1130 SSL_EXTRA_CERT_CHAIN_POLICY_PARA, *PSSL_EXTRA_CERT_CHAIN_POLICY_PARA;
1132 /* Values for HTTPSPolicyCallbackData's dwAuthType */
1133 #define AUTHTYPE_CLIENT 1
1134 #define AUTHTYPE_SERVER 2
1135 /* Values for HTTPSPolicyCallbackData's fdwChecks are defined in wininet.h */
1137 #define BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG 0x80000000
1138 #define BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG 0x40000000
1140 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000
1142 #define USAGE_MATCH_TYPE_AND 0x00000000
1143 #define USAGE_MATCH_TYPE_OR 0x00000001
1145 typedef struct _CERT_USAGE_MATCH {
1146 DWORD dwType;
1147 CERT_ENHKEY_USAGE Usage;
1148 } CERT_USAGE_MATCH, *PCERT_USAGE_MATCH;
1150 typedef struct _CTL_USAGE_MATCH {
1151 DWORD dwType;
1152 CTL_USAGE Usage;
1153 } CTL_USAGE_MATCH, *PCTL_USAGE_MATCH;
1155 #define CERT_CHAIN_REVOCATION_CHECK_END_CERT 0x10000000
1156 #define CERT_CHAIN_REVOCATION_CHECK_CHAIN 0x20000000
1157 #define CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 0x40000000
1158 #define CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY 0x80000000
1160 #define CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT 0x08000000
1162 #define CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING 0x00000040
1163 #define CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS 0x00000080
1164 #define CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE 0x00000100
1165 #define CERT_CHAIN_TIMESTAMP_TIME 0x00000200
1167 typedef struct _CERT_CHAIN_PARA {
1168 DWORD cbSize;
1169 CERT_USAGE_MATCH RequestedUsage;
1170 #ifdef CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
1171 CERT_USAGE_MATCH RequestedIssuancePolicy;
1172 DWORD dwUrlRetrievalTimeout;
1173 BOOL fCheckRevocationFreshnessTime;
1174 DWORD dwRevocationFreshnessTime;
1175 LPFILETIME pftCacheResync;
1176 #endif
1177 } CERT_CHAIN_PARA, *PCERT_CHAIN_PARA;
1179 typedef struct _CERT_SYSTEM_STORE_INFO {
1180 DWORD cbSize;
1181 } CERT_SYSTEM_STORE_INFO, *PCERT_SYSTEM_STORE_INFO;
1183 typedef struct _CERT_PHYSICAL_STORE_INFO {
1184 DWORD cbSize;
1185 LPSTR pszOpenStoreProvider;
1186 DWORD dwOpenEncodingType;
1187 DWORD dwOpenFlags;
1188 CRYPT_DATA_BLOB OpenParameters;
1189 DWORD dwFlags;
1190 DWORD dwPriority;
1191 } CERT_PHYSICAL_STORE_INFO, *PCERT_PHYSICAL_STORE_INFO;
1193 typedef struct _CERT_SYSTEM_STORE_RELOCATE_PARA {
1194 union {
1195 HKEY hKeyBase;
1196 VOID *pvBase;
1197 } DUMMYUNIONNAME;
1198 union {
1199 void *pvSystemStore;
1200 LPCSTR pszSystemStore;
1201 LPCWSTR pwszSystemStore;
1202 } DUMMYUNIONNAME2;
1203 } CERT_SYSTEM_STORE_RELOCATE_PARA, *PCERT_SYSTEM_STORE_RELOCATE_PARA;
1205 typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)(
1206 LPCWSTR pwszStoreLocation, DWORD dwFlags, void *pvReserved, void *pvArg);
1208 typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE)(const void *pvSystemStore,
1209 DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved,
1210 void *pvArg);
1212 typedef BOOL (WINAPI *PFN_CERT_ENUM_PHYSICAL_STORE)(const void *pvSystemStore,
1213 DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo,
1214 void *pvReserved, void *pvArg);
1216 /* Encode/decode object */
1217 typedef LPVOID (__WINE_ALLOC_SIZE(1) WINAPI *PFN_CRYPT_ALLOC)(size_t cbsize);
1218 typedef VOID (WINAPI *PFN_CRYPT_FREE)(LPVOID pv);
1220 typedef struct _CRYPT_ENCODE_PARA {
1221 DWORD cbSize;
1222 PFN_CRYPT_ALLOC pfnAlloc;
1223 PFN_CRYPT_FREE pfnFree;
1224 } CRYPT_ENCODE_PARA, *PCRYPT_ENCODE_PARA;
1226 typedef struct _CRYPT_DECODE_PARA {
1227 DWORD cbSize;
1228 PFN_CRYPT_ALLOC pfnAlloc;
1229 PFN_CRYPT_FREE pfnFree;
1230 } CRYPT_DECODE_PARA, *PCRYPT_DECODE_PARA;
1232 typedef struct _CERT_STORE_PROV_INFO {
1233 DWORD cbSize;
1234 DWORD cStoreProvFunc;
1235 void **rgpvStoreProvFunc;
1236 HCERTSTOREPROV hStoreProv;
1237 DWORD dwStoreProvFlags;
1238 HCRYPTOIDFUNCADDR hStoreProvFuncAddr2;
1239 } CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO;
1241 typedef BOOL (WINAPI *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(
1242 LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV_LEGACY hCryptProv,
1243 DWORD dwFlags, const void *pvPara, HCERTSTORE hCertStore,
1244 PCERT_STORE_PROV_INFO pStoreProvInfo);
1246 typedef void (WINAPI *PFN_CERT_STORE_PROV_CLOSE)(HCERTSTOREPROV hStoreProv,
1247 DWORD dwFlags);
1249 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)(HCERTSTOREPROV hStoreProv,
1250 PCCERT_CONTEXT pStoreCertContext, DWORD dwFlags,
1251 PCCERT_CONTEXT *ppProvCertContext);
1253 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CERT)(HCERTSTOREPROV hStoreProv,
1254 PCCERT_CONTEXT pCertContext, DWORD dwFlags);
1256 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CERT)(
1257 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwFlags);
1259 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CERT_PROPERTY)(
1260 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwPropId,
1261 DWORD dwFlags, const void *pvData);
1263 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)(HCERTSTOREPROV hStoreProv,
1264 PCCRL_CONTEXT pStoreCrlContext, DWORD dwFlags,
1265 PCCRL_CONTEXT *ppProvCrlContext);
1267 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CRL)(HCERTSTOREPROV hStoreProv,
1268 PCCRL_CONTEXT pCrlContext, DWORD dwFlags);
1270 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CRL)(HCERTSTOREPROV hStoreProv,
1271 PCCRL_CONTEXT pCrlContext, DWORD dwFlags);
1273 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CRL_PROPERTY)(
1274 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext, DWORD dwPropId,
1275 DWORD dwFlags, const void *pvData);
1277 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)(HCERTSTOREPROV hStoreProv,
1278 PCCTL_CONTEXT pStoreCtlContext, DWORD dwFlags,
1279 PCCTL_CONTEXT *ppProvCtlContext);
1281 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CTL)(HCERTSTOREPROV hStoreProv,
1282 PCCTL_CONTEXT pCtlContext, DWORD dwFlags);
1284 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CTL)(
1285 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwFlags);
1287 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CTL_PROPERTY)(
1288 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwPropId,
1289 DWORD dwFlags, const void *pvData);
1291 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)(HCERTSTOREPROV hStoreProv,
1292 DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara);
1294 typedef struct _CERT_STORE_PROV_FIND_INFO {
1295 DWORD cbSize;
1296 DWORD dwMsgAndCertEncodingType;
1297 DWORD dwFindFlags;
1298 DWORD dwFindType;
1299 const void *pvFindPara;
1300 } CERT_STORE_PROV_FIND_INFO, *PCERT_STORE_PROV_FIND_INFO;
1301 typedef const CERT_STORE_PROV_FIND_INFO CCERT_STORE_PROV_FIND_INFO,
1302 *PCCERT_STORE_PROV_FIND_INFO;
1304 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CERT)(HCERTSTOREPROV hStoreProv,
1305 PCCERT_STORE_PROV_FIND_INFO pFindInfo, PCCERT_CONTEXT pPrevCertContext,
1306 DWORD dwFlags, void **ppvStoreProvFindInfo, PCCERT_CONTEXT *ppProvCertContext);
1308 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CERT)(
1309 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext,
1310 void *pvStoreProvFindInfo, DWORD dwFlags);
1312 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CERT_PROPERTY)(
1313 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwPropId,
1314 DWORD dwFlags, void *pvData, DWORD *pcbData);
1316 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CRL)(HCERTSTOREPROV hStoreProv,
1317 PCCERT_STORE_PROV_FIND_INFO pFindInfo, PCCRL_CONTEXT pPrevCrlContext,
1318 DWORD dwFlags, void **ppvStoreProvFindInfo, PCCRL_CONTEXT *ppProvCrlContext);
1320 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CRL)(
1321 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext,
1322 void *pvStoreProvFindInfo, DWORD dwFlags);
1324 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CRL_PROPERTY)(
1325 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext, DWORD dwPropId,
1326 DWORD dwFlags, void *pvData, DWORD *pcbData);
1328 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CTL)(HCERTSTOREPROV hStoreProv,
1329 PCCTL_CONTEXT pCtlContext, void *pvStoreProvFindInfo, DWORD dwFlags);
1331 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CTL_PROPERTY)(
1332 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwPropId,
1333 DWORD dwFlags, void *pvData);
1335 typedef struct _CERT_CREATE_CONTEXT_PARA {
1336 DWORD cbSize;
1337 PFN_CRYPT_FREE pfnFree;
1338 void *pvFree;
1339 } CERT_CREATE_CONTEXT_PARA, *PCERT_CREATE_CONTEXT_PARA;
1341 typedef struct _CRYPT_OID_FUNC_ENTRY {
1342 LPCSTR pszOID;
1343 void *pvFuncAddr;
1344 } CRYPT_OID_FUNC_ENTRY, *PCRYPT_OID_FUNC_ENTRY;
1346 typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_FUNC)(DWORD dwEncodingType,
1347 LPCSTR pszFuncName, LPCSTR pszOID, DWORD cValue, const DWORD rgdwValueType[],
1348 LPCWSTR const rgpwszValueName[], const BYTE * const rgpbValueData[],
1349 const DWORD rgcbValueData[], void *pvArg);
1351 #define CRYPT_MATCH_ANY_ENCODING_TYPE 0xffffffff
1353 #define CALG_OID_INFO_CNG_ONLY 0xffffffff
1354 #define CALG_OID_INFO_PARAMETERS 0xfffffffe
1356 #if defined(_MSC_VER) || defined(__MINGW32__)
1357 #define CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM L"CryptOIDInfoHashParameters"
1358 #define CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM L"CryptOIDInfoECCParameters"
1359 #define CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM L"CryptOIDInfoMgf1Parameters"
1360 #define CRYPT_OID_INFO_NO_SIGN_ALGORITHM L"CryptOIDInfoNoSign"
1361 #define CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM L"CryptOIDInfoOAEPParameters"
1362 #define CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM L"CryptOIDInfoECCWrapParameters"
1363 #define CRYPT_OID_INFO_NO_PARAMETERS_ALGORITHM L"CryptOIDInfoNoParameters"
1364 #else
1365 static const WCHAR CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','H','a','s','h','P','a','r','a','m','e','t','e','r','s',0};
1366 static const WCHAR CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','E','C','C','P','a','r','a','m','e','t','e','r','s',0};
1367 static const WCHAR CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','M','g','f','1','P','a','r','a','m','e','t','e','r','s',0};
1368 static const WCHAR CRYPT_OID_INFO_NO_SIGN_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','N','o','S','i','g','n',0};
1369 static const WCHAR CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','O','A','E','P','P','a','r','a','m','e','t','e','r','s',0};
1370 static const WCHAR CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','E','C','C','W','r','a','p','P','a','r','a','m','e','t','e','r','s',0};
1371 static const WCHAR CRYPT_OID_INFO_NO_PARAMETERS_ALGORITHM[] = {'C','r','y','p','t','O','I','D','I','n','f','o','N','o','P','a','r','a','m','e','t','e','r','s',0};
1372 #endif
1374 typedef struct _CRYPT_OID_INFO {
1375 DWORD cbSize;
1376 LPCSTR pszOID;
1377 LPCWSTR pwszName;
1378 DWORD dwGroupId;
1379 union {
1380 DWORD dwValue;
1381 ALG_ID Algid;
1382 DWORD dwLength;
1383 } DUMMYUNIONNAME;
1384 CRYPT_DATA_BLOB ExtraInfo;
1385 #ifdef CRYPT_OID_INFO_HAS_EXTRA_FIELDS
1386 LPCWSTR pwszCNGAlgid;
1387 LPCWSTR pwszCNGExtraAlgid;
1388 #endif
1389 } CRYPT_OID_INFO, *PCRYPT_OID_INFO;
1390 typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO;
1392 typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_INFO)(PCCRYPT_OID_INFO pInfo,
1393 void *pvArg);
1395 typedef struct _CRYPT_SIGN_MESSAGE_PARA {
1396 DWORD cbSize;
1397 DWORD dwMsgEncodingType;
1398 PCCERT_CONTEXT pSigningCert;
1399 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
1400 void * pvHashAuxInfo;
1401 DWORD cMsgCert;
1402 PCCERT_CONTEXT *rgpMsgCert;
1403 DWORD cMsgCrl;
1404 PCCRL_CONTEXT *rgpMsgCrl;
1405 DWORD cAuthAttr;
1406 PCRYPT_ATTRIBUTE rgAuthAttr;
1407 DWORD cUnauthAttr;
1408 PCRYPT_ATTRIBUTE rgUnauthAttr;
1409 DWORD dwFlags;
1410 DWORD dwInnerContentType;
1411 #ifdef CRYPT_SIGN_MESSAGE_PARA_HAS_CMS_FIELDS
1412 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
1413 void * pvHashEncryptionAuxInfo;
1414 #endif
1415 } CRYPT_SIGN_MESSAGE_PARA, *PCRYPT_SIGN_MESSAGE_PARA;
1417 #define CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG 0x00000001
1418 #define CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG 0x00000002
1419 #define CRYPT_MESSAGE_KEYID_SIGNER_FLAG 0x00000004
1420 #define CRYPT_MESSAGE_SILENT_KEYSET_FLAG 0x00000008
1422 typedef PCCERT_CONTEXT (WINAPI *PFN_CRYPT_GET_SIGNER_CERTIFICATE)(void *pvArg,
1423 DWORD dwCertEncodingType, PCERT_INFO pSignerId, HCERTSTORE hMsgCertStore);
1425 typedef struct _CRYPT_VERIFY_MESSAGE_PARA {
1426 DWORD cbSize;
1427 DWORD dwMsgAndCertEncodingType;
1428 HCRYPTPROV_LEGACY hCryptProv;
1429 PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate;
1430 void * pvGetArg;
1431 } CRYPT_VERIFY_MESSAGE_PARA, *PCRYPT_VERIFY_MESSAGE_PARA;
1433 typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA {
1434 DWORD cbSize;
1435 DWORD dwMsgEncodingType;
1436 HCRYPTPROV_LEGACY hCryptProv;
1437 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
1438 void * pvEncryptionAuxInfo;
1439 DWORD dwFlags;
1440 DWORD dwInnerContentType;
1441 } CRYPT_ENCRYPT_MESSAGE_PARA, *PCRYPT_ENCRYPT_MESSAGE_PARA;
1443 #define CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG 0x00000004
1445 typedef struct _CRYPT_DECRYPT_MESSAGE_PARA {
1446 DWORD cbSize;
1447 DWORD dwMsgAndCertEncodingType;
1448 DWORD cCertStore;
1449 HCERTSTORE *rghCertStore;
1450 #ifdef CRYPT_DECRYPT_MESSAGE_PARA_HAS_EXTRA_FIELDS
1451 DWORD dwFlags;
1452 #endif
1453 } CRYPT_DECRYPT_MESSAGE_PARA, *PCRYPT_DECRYPT_MESSAGE_PARA;
1455 typedef struct _CRYPT_HASH_MESSAGE_PARA {
1456 DWORD cbSize;
1457 DWORD dwMsgEncodingType;
1458 HCRYPTPROV_LEGACY hCryptProv;
1459 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
1460 void * pvHashAuxInfo;
1461 } CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA;
1463 typedef struct _CRYPT_KEY_SIGN_MESSAGE_PARA {
1464 DWORD cbSize;
1465 DWORD dwMsgAndCertEncodingType;
1466 HCRYPTPROV hCryptProv;
1467 DWORD dwKeySpec;
1468 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
1469 void * pvHashAuxInfo;
1470 } CRYPT_KEY_SIGN_MESSAGE_PARA, *PCRYPT_KEY_SIGN_MESSAGE_PARA;
1472 typedef struct _CRYPT_KEY_VERIFY_MESSAGE_PARA {
1473 DWORD cbSize;
1474 DWORD dwMsgEncodingType;
1475 HCRYPTPROV_LEGACY hCryptProv;
1476 } CRYPT_KEY_VERIFY_MESSAGE_PARA, *PCRYPT_KEY_VERIFY_MESSAGE_PARA;
1478 typedef struct _CRYPT_URL_ARRAY {
1479 DWORD cUrl;
1480 LPWSTR *rgwszUrl;
1481 } CRYPT_URL_ARRAY, *PCRYPT_URL_ARRAY;
1483 typedef struct _CRYPT_URL_INFO {
1484 DWORD cbSize;
1485 DWORD dwSyncDeltaTime;
1486 DWORD cGroup;
1487 DWORD *rgcGroupEntry;
1488 } CRYPT_URL_INFO, *PCRYPT_URL_INFO;
1490 #define URL_OID_CERTIFICATE_ISSUER ((LPCSTR)1)
1491 #define URL_OID_CERTIFICATE_CRL_DIST_POINT ((LPCSTR)2)
1492 #define URL_OID_CTL_ISSUER ((LPCSTR)3)
1493 #define URL_OID_CTL_NEXT_UPDATE ((LPCSTR)4)
1494 #define URL_OID_CRL_ISSUER ((LPCSTR)5)
1495 #define URL_OID_CERTIFICATE_FRESHEST_CRL ((LPCSTR)6)
1496 #define URL_OID_CRL_FRESHEST_CRL ((LPCSTR)7)
1497 #define URL_OID_CROSS_CERT_DIST_POINT ((LPCSTR)8)
1498 #define URL_OID_CERTIFICATE_OCSP ((LPCSTR)9)
1499 #define URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT ((LPCSTR)10)
1500 #define URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP ((LPCSTR)11)
1501 #define URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS ((LPCSTR)12)
1503 #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
1505 typedef HANDLE HCRYPTASYNC, *PHCRYPTASYNC;
1507 typedef void (WINAPI *PFN_CRYPT_ASYNC_PARAM_FREE_FUNC)(LPSTR pszParamOid,
1508 LPVOID pvParam);
1510 #define CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION ((LPCSTR)1)
1511 #define CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL ((LPCSTR)2)
1513 typedef void (WINAPI *PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC)(
1514 void *pvCompletion, DWORD dwCompletionCode, LPCSTR pszURL, LPSTR pszObjectOid,
1515 void *pvObject);
1517 typedef struct _CRYPT_ASYNC_RETRIEVAL_COMPLETION
1519 PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC pfnCompletion;
1520 void *pvCompletion;
1521 } CRYPT_ASYNC_RETRIEVAL_COMPLETION, *PCRYPT_ASYNC_RETRIEVAL_COMPLETION;
1523 typedef BOOL (WINAPI *PFN_CANCEL_ASYNC_RETRIEVAL_FUNC)(
1524 HCRYPTASYNC hAsyncRetrieve);
1526 typedef struct _CRYPT_BLOB_ARRAY
1528 DWORD cBlob;
1529 PCRYPT_DATA_BLOB rgBlob;
1530 } CRYPT_BLOB_ARRAY, *PCRYPT_BLOB_ARRAY;
1532 typedef struct _CRYPT_CREDENTIALS {
1533 DWORD cbSize;
1534 LPCSTR pszCredentialsOid;
1535 LPVOID pvCredentials;
1536 } CRYPT_CREDENTIALS, *PCRYPT_CREDENTIALS;
1538 #define CREDENTIAL_OID_PASSWORD_CREDENTIALS_A ((LPCSTR)1)
1539 #define CREDENTIAL_OID_PASSWORD_CREDENTIALS_W ((LPCSTR)2)
1540 #define CREDENTIAL_OID_PASSWORD_CREDENTIALS \
1541 WINELIB_NAME_AW(CREDENTIAL_OID_PASSWORD_CREDENTIALS_)
1543 typedef struct _CRYPT_PASSWORD_CREDENTIALSA {
1544 DWORD cbSize;
1545 LPSTR pszUsername;
1546 LPSTR pszPassword;
1547 } CRYPT_PASSWORD_CREDENTIALSA, *PCRYPT_PASSWORD_CREDENTIALSA;
1549 typedef struct _CRYPT_PASSWORD_CREDENTIALSW {
1550 DWORD cbSize;
1551 LPWSTR pszUsername;
1552 LPWSTR pszPassword;
1553 } CRYPT_PASSWORD_CREDENTIALSW, *PCRYPT_PASSWORD_CREDENTIALSW;
1554 #define CRYPT_PASSWORD_CREDENTIALS WINELIB_NAME_AW(CRYPT_PASSWORD_CREDENTIALS)
1555 #define PCRYPT_PASSWORD_CREDENTIALS WINELIB_NAME_AW(PCRYPT_PASSWORD_CREDENTIALS)
1557 typedef struct _CRYPT_RETRIEVE_AUX_INFO {
1558 DWORD cbSize;
1559 FILETIME *pLastSyncTime;
1560 DWORD dwMaxUrlRetrievalByteCount;
1561 } CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO;
1563 typedef void (WINAPI *PFN_FREE_ENCODED_OBJECT_FUNC)(LPCSTR pszObjectOid,
1564 PCRYPT_BLOB_ARRAY pObject, void *pvFreeContext);
1566 #define SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC \
1567 "SchemeDllRetrieveEncodedObject"
1568 #define SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC \
1569 "SchemeDllRetrieveEncodedObjectW"
1570 /* The signature of SchemeDllRetrieveEncodedObjectW is:
1571 BOOL WINAPI SchemeDllRetrieveEncodedObjectW(LPCWSTR pwszUrl,
1572 LPCSTR pszObjectOid, DWORD dwRetrievalFlags, DWORD dwTimeout,
1573 PCRYPT_BLOB_ARRAY pObject, PFN_FREE_ENCODED_OBJECT_FUNC *ppfnFreeObject,
1574 void **ppvFreeContext, HCRYPTASYNC hAsyncRetrieve,
1575 PCRYPT_CREDENTIALS pCredentials, PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
1578 #define CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC "ContextDllCreateObjectContext"
1579 /* The signature of ContextDllCreateObjectContext is:
1580 BOOL WINAPI ContextDllCreateObjectContext(LPCSTR pszObjectOid,
1581 DWORD dwRetrievalFlags, PCRYPT_BLOB_ARRAY pObject, void **ppvContxt);
1584 #define CONTEXT_OID_CERTIFICATE ((LPCSTR)1)
1585 #define CONTEXT_OID_CRL ((LPCSTR)2)
1586 #define CONTEXT_OID_CTL ((LPCSTR)3)
1587 #define CONTEXT_OID_PKCS7 ((LPCSTR)4)
1588 #define CONTEXT_OID_CAPI2_ANY ((LPCSTR)5)
1590 #define CRYPT_RETRIEVE_MULTIPLE_OBJECTS 0x00000001
1591 #define CRYPT_CACHE_ONLY_RETRIEVAL 0x00000002
1592 #define CRYPT_WIRE_ONLY_RETRIEVAL 0x00000004
1593 #define CRYPT_DONT_CACHE_RESULT 0x00000008
1594 #define CRYPT_ASYNC_RETRIEVAL 0x00000010
1595 #define CRYPT_STICKY_CACHE_RETRIEVAL 0x00001000
1596 #define CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL 0x00002000
1597 #define CRYPT_OFFLINE_CHECK_RETRIEVAL 0x00004000
1598 #define CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE 0x00008000
1599 #define CRYPT_LDAP_SIGN_RETRIEVAL 0x00010000
1600 #define CRYPT_NO_AUTH_RETRIEVAL 0x00020000
1601 #define CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL 0x00040000
1602 #define CRYPT_AIA_RETRIEVAL 0x00080000
1604 #define CRYPT_VERIFY_CONTEXT_SIGNATURE 0x00000020
1605 #define CRYPT_VERIFY_DATA_HASH 0x00000040
1606 #define CRYPT_KEEP_TIME_VALID 0x00000080
1607 #define CRYPT_DONT_VERIFY_SIGNATURE 0x00000100
1608 #define CRYPT_DONT_CHECK_TIME_VALIDITY 0x00000200
1609 #define CRYPT_CHECK_FRESHNESS_TIME_VALIDITY 0x00000400
1610 #define CRYPT_ACCUMULATIVE_TIMEOUT 0x00000800
1612 typedef BOOL (WINAPI *PFN_CRYPT_CANCEL_RETRIEVAL)(DWORD dwFlags, void *pvArg);
1614 typedef struct _CERT_CRL_CONTEXT_PAIR
1616 PCCERT_CONTEXT pCertContext;
1617 PCCRL_CONTEXT pCrlContext;
1618 } CERT_CRL_CONTEXT_PAIR, *PCERT_CRL_CONTEXT_PAIR;
1619 typedef const CERT_CRL_CONTEXT_PAIR *PCCERT_CRL_CONTEXT_PAIR;
1621 #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
1623 #define TIME_VALID_OID_GET_CTL ((LPCSTR)1)
1624 #define TIME_VALID_OID_GET_CRL ((LPCSTR)2)
1625 #define TIME_VALID_OID_GET_CRL_FROM_CERT ((LPCSTR)3)
1626 #define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT ((LPCSTR)4)
1627 #define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL ((LPCSTR)5)
1629 #define TIME_VALID_OID_FLUSH_OBJECT_FUNC "TimeValidDllFlushObject"
1631 #define TIME_VALID_OID_FLUSH_CTL ((LPCSTR)1)
1632 #define TIME_VALID_OID_FLUSH_CRL ((LPCSTR)2)
1633 #define TIME_VALID_OID_FLUSH_CRL_FROM_CERT ((LPCSTR)3)
1634 #define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT ((LPCSTR)4)
1635 #define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL ((LPCSTR)5)
1637 /* OID group IDs */
1638 #define CRYPT_HASH_ALG_OID_GROUP_ID 1
1639 #define CRYPT_ENCRYPT_ALG_OID_GROUP_ID 2
1640 #define CRYPT_PUBKEY_ALG_OID_GROUP_ID 3
1641 #define CRYPT_SIGN_ALG_OID_GROUP_ID 4
1642 #define CRYPT_RDN_ATTR_OID_GROUP_ID 5
1643 #define CRYPT_EXT_OR_ATTR_OID_GROUP_ID 6
1644 #define CRYPT_ENHKEY_USAGE_OID_GROUP_ID 7
1645 #define CRYPT_POLICY_OID_GROUP_ID 8
1646 #define CRYPT_TEMPLATE_OID_GROUP_ID 9
1647 #define CRYPT_LAST_OID_GROUP_ID 9
1649 #define CRYPT_FIRST_ALG_OID_GROUP_ID CRYPT_HASH_ALG_OID_GROUP_ID
1650 #define CRYPT_LAST_ALG_OID_GROUP_ID CRYPT_SIGN_ALG_OID_GROUP_ID
1652 #define CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG 0x1
1653 #define CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG 0x2
1654 #define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG 0x4
1656 #define CRYPT_OID_INFO_OID_KEY 1
1657 #define CRYPT_OID_INFO_NAME_KEY 2
1658 #define CRYPT_OID_INFO_ALGID_KEY 3
1659 #define CRYPT_OID_INFO_SIGN_KEY 4
1661 /* Algorithm IDs */
1663 #define GET_ALG_CLASS(x) (x & (7 << 13))
1664 #define GET_ALG_TYPE(x) (x & (15 << 9))
1665 #define GET_ALG_SID(x) (x & (511))
1667 /* Algorithm Classes */
1668 #define ALG_CLASS_ANY (0)
1669 #define ALG_CLASS_SIGNATURE (1 << 13)
1670 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
1671 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
1672 #define ALG_CLASS_HASH (4 << 13)
1673 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
1674 #define ALG_CLASS_ALL (7 << 13)
1675 /* Algorithm types */
1676 #define ALG_TYPE_ANY (0)
1677 #define ALG_TYPE_DSS (1 << 9)
1678 #define ALG_TYPE_RSA (2 << 9)
1679 #define ALG_TYPE_BLOCK (3 << 9)
1680 #define ALG_TYPE_STREAM (4 << 9)
1681 #define ALG_TYPE_DH (5 << 9)
1682 #define ALG_TYPE_SECURECHANNEL (6 << 9)
1683 #define ALG_TYPE_ECDH (7 << 9)
1685 /* SIDs */
1686 #define ALG_SID_ANY (0)
1687 /* RSA SIDs */
1688 #define ALG_SID_RSA_ANY 0
1689 #define ALG_SID_RSA_PKCS 1
1690 #define ALG_SID_RSA_MSATWORK 2
1691 #define ALG_SID_RSA_ENTRUST 3
1692 #define ALG_SID_RSA_PGP 4
1693 /* DSS SIDs */
1694 #define ALG_SID_DSS_ANY 0
1695 #define ALG_SID_DSS_PKCS 1
1696 #define ALG_SID_DSS_DMS 2
1697 #define ALG_SID_ECDSA 3
1699 /* DES SIDs */
1700 #define ALG_SID_DES 1
1701 #define ALG_SID_3DES 3
1702 #define ALG_SID_DESX 4
1703 #define ALG_SID_IDEA 5
1704 #define ALG_SID_CAST 6
1705 #define ALG_SID_SAFERSK64 7
1706 #define ALG_SID_SAFERSK128 8
1707 #define ALG_SID_3DES_112 9
1708 #define ALG_SID_CYLINK_MEK 12
1709 #define ALG_SID_RC5 13
1710 #define ALG_SID_AES_128 14
1711 #define ALG_SID_AES_192 15
1712 #define ALG_SID_AES_256 16
1713 #define ALG_SID_AES 17
1714 /* Fortezza */
1715 #define ALG_SID_SKIPJACK 10
1716 #define ALG_SID_TEK 11
1717 /* Diffie-Hellmans SIDs */
1718 #define ALG_SID_DH_SANDF 1
1719 #define ALG_SID_DH_EPHEM 2
1720 #define ALG_SID_AGREED_KEY_ANY 3
1721 #define ALG_SID_KEA 4
1722 #define ALG_SID_ECDH 5
1723 #define ALG_SID_ECDH_EPHEM 6
1724 /* RC2 SIDs */
1725 #define ALG_SID_RC4 1
1726 #define ALG_SID_RC2 2
1727 #define ALG_SID_SEAL 2
1728 /* Hash SIDs */
1729 #define ALG_SID_MD2 1
1730 #define ALG_SID_MD4 2
1731 #define ALG_SID_MD5 3
1732 #define ALG_SID_SHA 4
1733 #define ALG_SID_SHA1 ALG_SID_SHA
1734 #define ALG_SID_MAC 5
1735 #define ALG_SID_RIPEMD 6
1736 #define ALG_SID_RIPEMD160 7
1737 #define ALG_SID_SSL3SHAMD5 8
1738 #define ALG_SID_HMAC 9
1739 #define ALG_SID_TLS1PRF 10
1740 #define ALG_SID_HASH_REPLACE_OWF 11
1741 #define ALG_SID_SHA_256 12
1742 #define ALG_SID_SHA_384 13
1743 #define ALG_SID_SHA_512 14
1744 /* SCHANNEL SIDs */
1745 #define ALG_SID_SSL3_MASTER 1
1746 #define ALG_SID_SCHANNEL_MASTER_HASH 2
1747 #define ALG_SID_SCHANNEL_MAC_KEY 3
1748 #define ALG_SID_PCT1_MASTER 4
1749 #define ALG_SID_SSL2_MASTER 5
1750 #define ALG_SID_TLS1_MASTER 6
1751 #define ALG_SID_SCHANNEL_ENC_KEY 7
1752 #define ALG_SID_EXAMPLE 80
1754 #define ALG_SID_ECMQV 1
1756 /* Algorithm Definitions */
1757 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
1758 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
1759 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
1760 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
1761 #define CALG_SHA1 CALG_SHA
1762 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
1763 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
1764 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
1765 #define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
1766 #define CALG_HASH_REPLACE_OWF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF)
1767 #define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256)
1768 #define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384)
1769 #define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512)
1770 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
1771 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
1772 #define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY)
1773 #define CALG_ECDSA (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_ECDSA)
1774 #define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF)
1775 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM)
1776 #define CALG_AGREEDKEY_ANY (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_AGREED_KEY_ANY)
1777 #define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_KEA)
1778 #define CALG_HUGHES_MD5 (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_MD5)
1779 #define CALG_ECDH (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ECDH)
1780 #define CALG_ECDH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ECDH | ALG_SID_ECDH_EPHEM)
1781 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
1782 #define CALG_ECMQV (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_ECMQV)
1783 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
1784 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
1785 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES)
1786 #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112)
1787 #define CALG_DESX (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DESX)
1788 #define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_128)
1789 #define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_192)
1790 #define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256)
1791 #define CALG_AES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES)
1792 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
1793 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
1794 #define CALG_RC5 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC5)
1795 #define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_SKIPJACK)
1796 #define CALG_TEK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_TEK)
1797 #define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_CYLINK_MEK)
1798 #define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER)
1799 #define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH)
1800 #define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY)
1801 #define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY)
1802 #define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER)
1803 #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER)
1804 #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER)
1807 /* Protocol Flags */
1808 #define CRYPT_FLAG_PCT1 0x0001
1809 #define CRYPT_FLAG_SSL2 0x0002
1810 #define CRYPT_FLAG_SSL3 0x0004
1811 #define CRYPT_FLAG_TLS1 0x0008
1812 #define CRYPT_FLAG_IPSEC 0x0010
1813 #define CRYPT_FLAG_SIGNING 0x0020
1815 /* Provider names */
1816 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
1817 #if defined(_MSC_VER) || defined(__MINGW32__)
1818 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
1819 #else
1820 static const WCHAR MS_DEF_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1821 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1822 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
1823 #endif
1824 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
1826 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
1827 #if defined(_MSC_VER) || defined(__MINGW32__)
1828 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
1829 #else
1830 static const WCHAR MS_ENHANCED_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1831 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1832 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
1833 #endif
1834 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
1836 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
1837 #if defined(_MSC_VER) || defined(__MINGW32__)
1838 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
1839 #else
1840 static const WCHAR MS_STRONG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1841 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1842 'P','r','o','v','i','d','e','r',0 };
1843 #endif
1844 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
1846 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
1847 #if defined(_MSC_VER) || defined(__MINGW32__)
1848 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
1849 #else
1850 static const WCHAR MS_DEF_RSA_SIG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1851 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
1852 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1853 #endif
1854 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
1856 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
1857 #if defined(_MSC_VER) || defined(__MINGW32__)
1858 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
1859 #else
1860 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1861 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
1862 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1863 #endif
1864 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
1866 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
1867 #if defined(_MSC_VER) || defined(__MINGW32__)
1868 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
1869 #else
1870 static const WCHAR MS_DEF_DSS_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1871 'B','a','s','e',' ','D','S','S',' ',
1872 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1873 #endif
1874 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
1876 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
1877 #if defined(_MSC_VER) || defined(__MINGW32__)
1878 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
1879 #else
1880 static const WCHAR MS_DEF_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1881 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
1882 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
1883 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1884 #endif
1885 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
1887 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
1888 #if defined(_MSC_VER) || defined(__MINGW32__)
1889 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
1890 #else
1891 static const WCHAR MS_ENH_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1892 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
1893 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
1894 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1895 #endif
1896 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
1898 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
1899 #if defined(_MSC_VER) || defined(__MINGW32__)
1900 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
1901 #else
1902 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1903 'D','H',' ','S','C','h','a','n','n','e','l',' ',
1904 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1905 #endif
1906 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
1908 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
1909 #if defined(_MSC_VER) || defined(__MINGW32__)
1910 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
1911 #else
1912 static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1913 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
1914 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1915 #endif
1916 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
1918 #define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Provider"
1919 #if defined(_MSC_VER) || defined(__MINGW32__)
1920 # define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic Provider"
1921 #else
1922 static const WCHAR MS_ENH_RSA_AES_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1923 'E','n','h','a','n','c','e','d',' ','R','S','A',' ','a','n','d',' ','A','E','S',' ',
1924 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1925 #endif
1926 #define MS_ENH_RSA_AES_PROV WINELIB_NAME_AW(MS_ENH_RSA_AES_PROV_)
1928 #define MS_ENH_RSA_AES_PROV_XP_A "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"
1929 #if defined(_MSC_VER) || defined(__MINGW32__)
1930 # define MS_ENH_RSA_AES_PROV_XP_W L"Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"
1931 #else
1932 static const WCHAR MS_ENH_RSA_AES_PROV_XP_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1933 'E','n','h','a','n','c','e','d',' ','R','S','A',' ','a','n','d',' ','A','E','S',' ',
1934 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',' ',
1935 '(','P','r','o','t','o','t','y','p','e',')',0 };
1936 #endif
1937 #define MS_ENH_RSA_AES_PROV_XP WINELIB_NAME_AW(MS_ENH_RSA_AES_PROV_XP_)
1939 /* Key Specs*/
1940 #define AT_KEYEXCHANGE 1
1941 #define AT_SIGNATURE 2
1943 /* Provider Types */
1944 #define PROV_RSA_FULL 1
1945 #define PROV_RSA_SIG 2
1946 #define PROV_DSS 3
1947 #define PROV_FORTEZZA 4
1948 #define PROV_MS_EXCHANGE 5
1949 #define PROV_SSL 6
1950 #define PROV_RSA_SCHANNEL 12
1951 #define PROV_DSS_DH 13
1952 #define PROV_EC_ECDSA_SIG 14
1953 #define PROV_EC_ECNRA_SIG 15
1954 #define PROV_EC_ECDSA_FULL 16
1955 #define PROV_EC_ECNRA_FULL 17
1956 #define PROV_DH_SCHANNEL 18
1957 #define PROV_SPYRUS_LYNKS 20
1958 #define PROV_RNG 21
1959 #define PROV_INTEL_SEC 22
1960 #define PROV_REPLACE_OWF 23
1961 #define PROV_RSA_AES 24
1963 /* FLAGS Section */
1965 #define CRYPT_FIRST 1
1966 #define CRYPT_NEXT 2
1968 #define CRYPT_IMPL_HARDWARE 1
1969 #define CRYPT_IMPL_SOFTWARE 2
1970 #define CRYPT_IMPL_MIXED 3
1971 #define CRYPT_IMPL_UNKNOWN 4
1973 /* CryptAcquireContext */
1974 #define CRYPT_VERIFYCONTEXT 0xF0000000
1975 #define CRYPT_NEWKEYSET 0x00000008
1976 #define CRYPT_DELETEKEYSET 0x00000010
1977 #define CRYPT_MACHINE_KEYSET 0x00000020
1978 #define CRYPT_SILENT 0x00000040
1980 /* Crypt{Get|Set}Provider */
1981 #define CRYPT_MACHINE_DEFAULT 0x00000001
1982 #define CRYPT_USER_DEFAULT 0x00000002
1983 #define CRYPT_DELETE_DEFAULT 0x00000004
1985 /* Crypt{Get/Set}ProvParam */
1986 #define PP_CLIENT_HWND 1
1987 #define PP_ENUMALGS 1
1988 #define PP_ENUMCONTAINERS 2
1989 #define PP_IMPTYPE 3
1990 #define PP_NAME 4
1991 #define PP_VERSION 5
1992 #define PP_CONTAINER 6
1993 #define PP_CHANGE_PASSWORD 7
1994 #define PP_KEYSET_SEC_DESCR 8
1995 #define PP_KEY_TYPE_SUBTYPE 10
1996 #define PP_CONTEXT_INFO 11
1997 #define PP_KEYEXCHANGE_KEYSIZE 12
1998 #define PP_SIGNATURE_KEYSIZE 13
1999 #define PP_KEYEXCHANGE_ALG 14
2000 #define PP_SIGNATURE_ALG 15
2001 #define PP_PROVTYPE 16
2002 #define PP_KEYSTORAGE 17
2003 #define PP_SYM_KEYSIZE 19
2004 #define PP_SESSION_KEYSIZE 20
2005 #define PP_UI_PROMPT 21
2006 #define PP_ENUMALGS_EX 22
2007 #define PP_DELETEKEY 24
2008 #define PP_ENUMMANDROOTS 25
2009 #define PP_ENUMELECTROOTS 26
2010 #define PP_KEYSET_TYPE 27
2011 #define PP_ADMIN_PIN 31
2012 #define PP_KEYEXCHANGE_PIN 32
2013 #define PP_SIGNATURE_PIN 33
2014 #define PP_SIG_KEYSIZE_INC 34
2015 #define PP_KEYX_KEYSIZE_INC 35
2016 #define PP_UNIQUE_CONTAINER 36
2017 #define PP_SGC_INFO 37
2018 #define PP_USE_HARDWARE_RNG 38
2019 #define PP_KEYSPEC 39
2020 #define PP_ENUMEX_SIGNING_PROT 40
2021 #define PP_CRYPT_COUNT_KEY_USE 41
2022 #define PP_USER_CERTSTORE 42
2023 #define PP_SMARTCARD_READER 43
2024 #define PP_SMARTCARD_GUID 45
2025 #define PP_ROOT_CERTSTORE 46
2027 /* Values returned by CryptGetProvParam of PP_KEYSTORAGE */
2028 #define CRYPT_SEC_DESCR 0x00000001
2029 #define CRYPT_PSTORE 0x00000002
2030 #define CRYPT_UI_PROMPT 0x00000004
2032 /* Crypt{Get/Set}KeyParam */
2033 #define KP_IV 1
2034 #define KP_SALT 2
2035 #define KP_PADDING 3
2036 #define KP_MODE 4
2037 #define KP_MODE_BITS 5
2038 #define KP_PERMISSIONS 6
2039 #define KP_ALGID 7
2040 #define KP_BLOCKLEN 8
2041 #define KP_KEYLEN 9
2042 #define KP_SALT_EX 10
2043 #define KP_P 11
2044 #define KP_G 12
2045 #define KP_Q 13
2046 #define KP_X 14
2047 #define KP_Y 15
2048 #define KP_RA 16
2049 #define KP_RB 17
2050 #define KP_INFO 18
2051 #define KP_EFFECTIVE_KEYLEN 19
2052 #define KP_SCHANNEL_ALG 20
2053 #define KP_CLIENT_RANDOM 21
2054 #define KP_SERVER_RANDOM 22
2055 #define KP_RP 23
2056 #define KP_PRECOMP_MD5 24
2057 #define KP_PRECOMP_SHA 25
2058 #define KP_CERTIFICATE 26
2059 #define KP_CLEAR_KEY 27
2060 #define KP_PUB_EX_LEN 28
2061 #define KP_PUB_EX_VAL 29
2062 #define KP_KEYVAL 30
2063 #define KP_ADMIN_PIN 31
2064 #define KP_KEYEXCHANGE_PIN 32
2065 #define KP_SIGNATURE_PIN 33
2066 #define KP_PREHASH 34
2067 #define KP_ROUNDS 35
2068 #define KP_OAEP_PARAMS 36
2069 #define KP_CMS_KEY_INFO 37
2070 #define KP_CMS_DH_KEY_INFO 38
2071 #define KP_PUB_PARAMS 39
2072 #define KP_VERIFY_PARAMS 40
2073 #define KP_HIGHEST_VERSION 41
2074 #define KP_GET_USE_COUNT 42
2076 /* Values for KP_PADDING */
2077 #define PKCS5_PADDING 1
2078 #define RANDOM_PADDING 2
2079 #define ZERO_PADDING 3
2081 /* CryptSignHash/CryptVerifySignature */
2082 #define CRYPT_NOHASHOID 0x00000001
2083 #define CRYPT_TYPE2_FORMAT 0x00000002
2084 #define CRYPT_X931_FORMAT 0x00000004
2086 /* Crypt{Get,Set}HashParam */
2087 #define HP_ALGID 0x0001
2088 #define HP_HASHVAL 0x0002
2089 #define HP_HASHSIZE 0x0004
2090 #define HP_HMAC_INFO 0x0005
2091 #define HP_TLS1PRF_LABEL 0x0006
2092 #define HP_TLS1PRF_SEED 0x0007
2094 /* Crypt{Get,Set}KeyParam */
2095 #define CRYPT_MODE_CBC 1
2096 #define CRYPT_MODE_ECB 2
2097 #define CRYPT_MODE_OFB 3
2098 #define CRYPT_MODE_CFB 4
2100 #define CRYPT_ENCRYPT 0x0001
2101 #define CRYPT_DECRYPT 0x0002
2102 #define CRYPT_EXPORT 0x0004
2103 #define CRYPT_READ 0x0008
2104 #define CRYPT_WRITE 0x0010
2105 #define CRYPT_MAC 0x0020
2106 #define CRYPT_EXPORT_KEY 0x0040
2107 #define CRYPT_IMPORT_KEY 0x0080
2108 #define CRYPT_ARCHIVE 0x0100
2110 /* Crypt*Key */
2111 #define CRYPT_EXPORTABLE 0x00000001
2112 #define CRYPT_USER_PROTECTED 0x00000002
2113 #define CRYPT_CREATE_SALT 0x00000004
2114 #define CRYPT_UPDATE_KEY 0x00000008
2115 #define CRYPT_NO_SALT 0x00000010
2116 #define CRYPT_PREGEN 0x00000040
2117 #define CRYPT_SERVER 0x00000400
2118 #define CRYPT_ARCHIVABLE 0x00004000
2120 /* CryptExportKey */
2121 #define CRYPT_SSL2_FALLBACK 0x00000002
2122 #define CRYPT_DESTROYKEY 0x00000004
2123 #define CRYPT_OAEP 0x00000040
2125 /* CryptHashSessionKey */
2126 #define CRYPT_LITTLE_ENDIAN 0x00000001
2128 /* Crypt{Protect,Unprotect}Data PROMPTSTRUCT flags */
2129 #define CRYPTPROTECT_PROMPT_ON_PROTECT 0x0001
2130 #define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x0002
2131 /* Crypt{Protect,Unprotect}Data flags */
2132 #define CRYPTPROTECT_UI_FORBIDDEN 0x0001
2133 #define CRYPTPROTECT_LOCAL_MACHINE 0x0004
2134 #define CRYPTPROTECT_AUDIT 0x0010
2135 #define CRYPTPROTECT_VERIFY_PROTECTION 0x0040
2137 /* Crypt{Protect,Unprotect}Memory */
2138 #define CRYPTPROTECTMEMORY_BLOCK_SIZE 16
2139 #define CRYPTPROTECTMEMORY_SAME_PROCESS 0x0000
2140 #define CRYPTPROTECTMEMORY_CROSS_PROCESS 0x0001
2141 #define CRYPTPROTECTMEMORY_SAME_LOGON 0x0002
2143 /* Blob Types */
2144 #define SIMPLEBLOB 0x1
2145 #define PUBLICKEYBLOB 0x6
2146 #define PRIVATEKEYBLOB 0x7
2147 #define PLAINTEXTKEYBLOB 0x8
2148 #define OPAQUEKEYBLOB 0x9
2149 #define PUBLICKEYBLOBEX 0xA
2150 #define SYMMETRICWRAPKEYBLOB 0xB
2152 #define CUR_BLOB_VERSION 2
2154 /* cert store provider types */
2155 #define CERT_STORE_PROV_MSG ((LPCSTR)1)
2156 #define CERT_STORE_PROV_MEMORY ((LPCSTR)2)
2157 #define CERT_STORE_PROV_FILE ((LPCSTR)3)
2158 #define CERT_STORE_PROV_REG ((LPCSTR)4)
2159 #define CERT_STORE_PROV_PKCS7 ((LPCSTR)5)
2160 #define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6)
2161 #define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7)
2162 #define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8)
2163 #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9)
2164 #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10)
2165 #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
2166 #define CERT_STORE_PROV_COLLECTION ((LPCSTR)11)
2167 #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12)
2168 #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13)
2169 #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
2170 #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14)
2171 #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
2172 #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15)
2173 #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
2174 #define CERT_STORE_PROV_LDAP_W ((LPCSTR)16)
2175 #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
2177 #define sz_CERT_STORE_PROV_MEMORY "Memory"
2178 #define sz_CERT_STORE_PROV_FILENAME_W "File"
2179 #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
2180 #define sz_CERT_STORE_PROV_SYSTEM_W "System"
2181 #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
2182 #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
2183 #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
2184 #define sz_CERT_STORE_PROV_COLLECTION "Collection"
2185 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
2186 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
2187 #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
2188 #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
2189 #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
2190 #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
2191 #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
2192 #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
2194 /* types for CertOpenStore dwEncodingType */
2195 #define CERT_ENCODING_TYPE_MASK 0x0000ffff
2196 #define CMSG_ENCODING_TYPE_MASK 0xffff0000
2197 #define GET_CERT_ENCODING_TYPE(x) ((x) & CERT_ENCODING_TYPE_MASK)
2198 #define GET_CMSG_ENCODING_TYPE(x) ((x) & CMSG_ENCODING_TYPE_MASK)
2200 #define CRYPT_ASN_ENCODING 0x00000001
2201 #define CRYPT_NDR_ENCODING 0x00000002
2202 #define X509_ASN_ENCODING 0x00000001
2203 #define X509_NDR_ENCODING 0x00000002
2204 #define PKCS_7_ASN_ENCODING 0x00010000
2205 #define PKCS_7_NDR_ENCODING 0x00020000
2207 /* system store locations */
2208 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000
2209 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
2211 /* system store location ids */
2212 /* hkcu */
2213 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
2214 /* hklm */
2215 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
2216 /* hklm\Software\Microsoft\Cryptography\Services */
2217 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
2218 #define CERT_SYSTEM_STORE_SERVICES_ID 5
2219 /* HKEY_USERS */
2220 #define CERT_SYSTEM_STORE_USERS_ID 6
2221 /* hkcu\Software\Policies\Microsoft\SystemCertificates */
2222 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7
2223 /* hklm\Software\Policies\Microsoft\SystemCertificates */
2224 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8
2225 /* hklm\Software\Microsoft\EnterpriseCertificates */
2226 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9
2228 /* system store location values */
2229 #define CERT_SYSTEM_STORE_CURRENT_USER \
2230 (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2231 #define CERT_SYSTEM_STORE_LOCAL_MACHINE \
2232 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2233 #define CERT_SYSTEM_STORE_CURRENT_SERVICE \
2234 (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2235 #define CERT_SYSTEM_STORE_SERVICES \
2236 (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2237 #define CERT_SYSTEM_STORE_USERS \
2238 (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2239 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \
2240 (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2241 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \
2242 (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2243 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \
2244 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
2246 #if defined(_MSC_VER) || defined(__MINGW32__)
2247 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \
2248 L"Software\\Microsoft\\SystemCertificates"
2249 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH \
2250 L"Software\\Policies\\Microsoft\\SystemCertificates"
2251 #else
2252 static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] =
2253 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
2254 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0 };
2255 static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] =
2256 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
2257 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
2258 't','i','f','i','c','a','t','e','s',0 };
2259 #endif
2261 #if defined(_MSC_VER) || defined(__MINGW32__)
2262 #define CERT_EFSBLOB_REGPATH CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\EFS"
2263 #define CERT_EFSBLOB_VALUE_NAME L"EFSBlob"
2264 #else
2265 static const WCHAR CERT_EFSBLOB_REGPATH[] =
2266 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
2267 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
2268 't','i','f','i','c','a','t','e','s','\\','E','F','S',0 };
2269 static const WCHAR CERT_EFSBLOB_VALUE_NAME[] = { 'E','F','S','B','l','o','b',0 };
2270 #endif
2272 #if defined(_MSC_VER) || defined(__MINGW32__)
2273 #define CERT_PROT_ROOT_FLAGS_REGPATH L"\\Root\\ProtectedRoots"
2274 #define CERT_PROT_ROOT_FLAGS_VALUE_NAME L"Flags"
2275 #else
2276 static const WCHAR CERT_PROT_ROOT_FLAGS_REGPATH[] =
2277 { '\\','R','o','o','t','\\','P','r','o','t','e','c','t','e','d','R','o','o',
2278 't','s',0 };
2279 static const WCHAR CERT_PROT_ROOT_FLAGS_VALUE_NAME[] = {'F','l','a','g','s',0 };
2280 #endif
2282 #define CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG 0x01
2283 #define CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG 0x02
2284 #define CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG 0x04
2285 #define CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG 0x08
2286 #define CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG 0x10
2287 #define CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG 0x20
2289 #if defined(_MSC_VER) || defined(__MINGW32__)
2290 #define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH \
2291 CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
2292 #else
2293 static const WCHAR CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH[] =
2294 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
2295 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
2296 't','i','f','i','c','a','t','e','s','\\','T','r','u','s','t','e','d',
2297 'P','u','b','l','i','s','h','e','r','\\','S','a','f','e','r',0 };
2298 #endif
2300 #if defined(_MSC_VER) || defined(__MINGW32__)
2301 #define CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH \
2302 CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
2303 #define CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME L"AuthenticodeFlags"
2304 #else
2305 static const WCHAR CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH[] =
2306 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
2307 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s','\\',
2308 'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r','\\',
2309 'S','a','f','e','r',0 };
2310 static const WCHAR CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME[] =
2311 { 'A','u','t','h','e','n','t','i','c','o','d','e','F','l','a','g','s',0 };
2312 #endif
2314 #define CERT_TRUST_PUB_ALLOW_END_USER_TRUST 0x00000000
2315 #define CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST 0x00000001
2316 #define CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST 0x00000002
2317 #define CERT_TRUST_PUB_ALLOW_TRUST_MASK 0x00000003
2318 #define CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG 0x00000100
2319 #define CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG 0x00000200
2321 /* flags for CertOpenStore dwFlags */
2322 #define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001
2323 #define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002
2324 #define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004
2325 #define CERT_STORE_DELETE_FLAG 0x00000010
2326 #define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020
2327 #define CERT_STORE_SHARE_STORE_FLAG 0x00000040
2328 #define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080
2329 #define CERT_STORE_MANIFOLD_FLAG 0x00000100
2330 #define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200
2331 #define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400
2332 #define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800
2333 #define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000
2334 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000
2335 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
2336 #define CERT_STORE_READONLY_FLAG 0x00008000
2338 #define CERT_REGISTRY_STORE_REMOTE_FLAG 0x00010000
2339 #define CERT_REGISTRY_STORE_SERIALIZED_FLAG 0x00020000
2340 #define CERT_REGISTRY_STORE_ROAMING_FLAG 0x00040000
2341 #define CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG 0x00080000
2342 #define CERT_REGISTRY_STORE_LM_GPT_FLAG 0x01000000
2343 #define CERT_REGISTRY_STORE_CLIENT_GPT_FLAG 0x80000000
2345 #define CERT_FILE_STORE_COMMIT_ENABLE_FLAG 0x00010000
2347 /* CertCloseStore dwFlags */
2348 #define CERT_CLOSE_STORE_FORCE_FLAG 0x00000001
2349 #define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002
2351 /* dwAddDisposition */
2352 #define CERT_STORE_ADD_NEW 1
2353 #define CERT_STORE_ADD_USE_EXISTING 2
2354 #define CERT_STORE_ADD_REPLACE_EXISTING 3
2355 #define CERT_STORE_ADD_ALWAYS 4
2356 #define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5
2357 #define CERT_STORE_ADD_NEWER 6
2358 #define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES 7
2360 /* Installable OID function defs */
2361 #define CRYPT_OID_OPEN_STORE_PROV_FUNC "CertDllOpenStoreProv"
2362 #define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject"
2363 #define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject"
2364 #define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx"
2365 #define CRYPT_OID_DECODE_OBJECT_EX_FUNC "CryptDllDecodeObjectEx"
2366 #define CRYPT_OID_CREATE_COM_OBJECT_FUNC "CryptDllCreateComObject"
2367 #define CRYPT_OID_VERIFY_REVOCATION_FUNC "CertDllVerifyRevocation"
2368 #define CRYPT_OID_VERIFY_CTL_USAGE_FUNC "CertDllVerifyCTLUsage"
2369 #define CRYPT_OID_FORMAT_OBJECT_FUNC "CryptDllFormatObject"
2370 #define CRYPT_OID_FIND_OID_INFO_FUNC "CryptDllFindOIDInfo"
2371 #define CRYPT_OID_FIND_LOCALIZED_NAME_FUNC "CryptDllFindLocalizedName"
2372 #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
2373 #define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC "CryptDllImportPublicKeyInfoEx"
2374 #define CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC "CryptDllExportPrivateKeyInfoEx"
2375 #define CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC "CryptDllImportPrivateKeyInfoEx"
2376 #define CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC \
2377 "CertDllVerifyCertificateChainPolicy"
2378 #define CRYPT_OID_CONVERT_PUBLIC_KEY_INFO_FUNC "CryptDllConvertPublicKeyInfo"
2379 #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
2380 #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
2381 #define CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC "CryptMsgDllGenContentEncryptKey"
2382 #define CMSG_OID_EXPORT_KEY_TRANS_FUNC "CryptMsgDllExportKeyTrans"
2383 #define CMSG_OID_IMPORT_KEY_TRANS_FUNC "CryptMsgDllImportKeyTrans"
2385 #define CRYPT_OID_REGPATH "Software\\Microsoft\\Cryptography\\OID"
2386 #define CRYPT_OID_REG_ENCODING_TYPE_PREFIX "EncodingType "
2387 #if defined(_MSC_VER) || defined(__MINGW32__)
2388 # define CRYPT_OID_REG_DLL_VALUE_NAME L"Dll"
2389 # define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME L"FuncName"
2390 # define CRYPT_OID_REG_FLAGS_VALUE_NAME L"CryptFlags"
2391 #else
2392 static const WCHAR CRYPT_OID_REG_DLL_VALUE_NAME[] = { 'D','l','l',0 };
2393 static const WCHAR CRYPT_OID_REG_FUNC_NAME_VALUE_NAME[] =
2394 { 'F','u','n','c','N','a','m','e',0 };
2395 static const WCHAR CRYPT_OID_REG_FLAGS_VALUE_NAME[] =
2396 { 'C','r','y','p','t','F','l','a','g','s',0 };
2397 #endif
2398 #define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A "FuncName"
2399 #define CRYPT_DEFAULT_OID "DEFAULT"
2401 #define CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG 1
2402 #define CRYPT_INSTALL_OID_INFO_BEFORE_FLAG 1
2404 #define CRYPT_GET_INSTALLED_OID_FUNC_FLAG 0x1
2406 #define CRYPT_REGISTER_FIRST_INDEX 0
2407 #define CRYPT_REGISTER_LAST_INDEX 0xffffffff
2409 /* values for CERT_STORE_PROV_INFO's dwStoreProvFlags */
2410 #define CERT_STORE_PROV_EXTERNAL_FLAG 0x1
2411 #define CERT_STORE_PROV_DELETED_FLAG 0x2
2412 #define CERT_STORE_PROV_NO_PERSIST_FLAG 0x4
2413 #define CERT_STORE_PROV_SYSTEM_STORE_FLAG 0x8
2414 #define CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG 0x10
2416 /* function indices */
2417 #define CERT_STORE_PROV_CLOSE_FUNC 0
2418 #define CERT_STORE_PROV_READ_CERT_FUNC 1
2419 #define CERT_STORE_PROV_WRITE_CERT_FUNC 2
2420 #define CERT_STORE_PROV_DELETE_CERT_FUNC 3
2421 #define CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC 4
2422 #define CERT_STORE_PROV_READ_CRL_FUNC 5
2423 #define CERT_STORE_PROV_WRITE_CRL_FUNC 6
2424 #define CERT_STORE_PROV_DELETE_CRL_FUNC 7
2425 #define CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC 8
2426 #define CERT_STORE_PROV_READ_CTL_FUNC 9
2427 #define CERT_STORE_PROV_WRITE_CTL_FUNC 10
2428 #define CERT_STORE_PROV_DELETE_CTL_FUNC 11
2429 #define CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC 12
2430 #define CERT_STORE_PROV_CONTROL_FUNC 13
2431 #define CERT_STORE_PROV_FIND_CERT_FUNC 14
2432 #define CERT_STORE_PROV_FREE_FIND_CERT_FUNC 15
2433 #define CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC 16
2434 #define CERT_STORE_PROV_FIND_CRL_FUNC 17
2435 #define CERT_STORE_PROV_FREE_FIND_CRL_FUNC 18
2436 #define CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC 19
2437 #define CERT_STORE_PROV_FIND_CTL_FUNC 20
2438 #define CERT_STORE_PROV_FREE_FIND_CTL_FUNC 21
2439 #define CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC 22
2441 /* physical store dwFlags, also used by CertAddStoreToCollection as
2442 * dwUpdateFlags
2444 #define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1
2445 #define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2
2446 #define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4
2447 #define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8
2449 /* dwFlag values for CertEnumPhysicalStore callback */
2450 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
2452 /* predefined store names */
2453 #if defined(_MSC_VER) || defined(__MINGW32__)
2454 # define CERT_PHYSICAL_STORE_DEFAULT_NAME \
2455 L".Default"
2456 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \
2457 L".GroupPolicy"
2458 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \
2459 L".LocalMachine"
2460 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \
2461 L".UserCertificate"
2462 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
2463 L".LocalMachineGroupPolicy"
2464 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \
2465 L".Enterprise"
2466 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \
2467 L".AuthRoot"
2468 #else
2469 static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] =
2470 {'.','D','e','f','a','u','l','t','0'};
2471 static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME[] =
2472 {'.','G','r','o','u','p','P','o','l','i','c','y',0};
2473 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME[] =
2474 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0};
2475 static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME[] =
2476 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0};
2477 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME[] =
2478 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',
2479 'P','o','l','i','c','y',0};
2480 static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME[] =
2481 {'.','E','n','t','e','r','p','r','i','s','e',0};
2482 static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME[] =
2483 {'.','A','u','t','h','R','o','o','t',0};
2484 #endif
2486 /* cert system store flags */
2487 #define CERT_SYSTEM_STORE_MASK 0xffff0000
2488 #define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000
2490 /* CertFindChainInStore dwFindType types */
2491 #define CERT_CHAIN_FIND_BY_ISSUER 1
2493 /* CertSaveStore dwSaveAs values */
2494 #define CERT_STORE_SAVE_AS_STORE 1
2495 #define CERT_STORE_SAVE_AS_PKCS7 2
2496 /* CertSaveStore dwSaveTo values */
2497 #define CERT_STORE_SAVE_TO_FILE 1
2498 #define CERT_STORE_SAVE_TO_MEMORY 2
2499 #define CERT_STORE_SAVE_TO_FILENAME_A 3
2500 #define CERT_STORE_SAVE_TO_FILENAME_W 4
2501 #define CERT_STORE_SAVE_TO_FILENAME CERT_STORE_SAVE_TO_FILENAME_W
2503 /* CERT_INFO versions/flags */
2504 #define CERT_V1 0
2505 #define CERT_V2 1
2506 #define CERT_V3 2
2507 #define CERT_INFO_VERSION_FLAG 1
2508 #define CERT_INFO_SERIAL_NUMBER_FLAG 2
2509 #define CERT_INFO_SIGNATURE_ALGORITHM_FLAG 3
2510 #define CERT_INFO_ISSUER_FLAG 4
2511 #define CERT_INFO_NOT_BEFORE_FLAG 5
2512 #define CERT_INFO_NOT_AFTER_FLAG 6
2513 #define CERT_INFO_SUBJECT_FLAG 7
2514 #define CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG 8
2515 #define CERT_INFO_ISSUER_UNIQUE_ID_FLAG 9
2516 #define CERT_INFO_SUBJECT_UNIQUE_ID_FLAG 10
2517 #define CERT_INFO_EXTENSION_FLAG 11
2519 /* CERT_REQUEST_INFO versions */
2520 #define CERT_REQUEST_V1 0
2522 /* CERT_KEYGEN_REQUEST_INFO versions */
2523 #define CERT_KEYGEN_REQUEST_V1 0
2525 /* CRL versions */
2526 #define CRL_V1 0
2527 #define CRL_V2 1
2529 /* CTL versions */
2530 #define CTL_V1 0
2532 /* Certificate, CRL, CTL property IDs */
2533 #define CERT_KEY_PROV_HANDLE_PROP_ID 1
2534 #define CERT_KEY_PROV_INFO_PROP_ID 2
2535 #define CERT_SHA1_HASH_PROP_ID 3
2536 #define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID
2537 #define CERT_MD5_HASH_PROP_ID 4
2538 #define CERT_KEY_CONTEXT_PROP_ID 5
2539 #define CERT_KEY_SPEC_PROP_ID 6
2540 #define CERT_IE30_RESERVED_PROP_ID 7
2541 #define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8
2542 #define CERT_ENHKEY_USAGE_PROP_ID 9
2543 #define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID
2544 #define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10
2545 #define CERT_FRIENDLY_NAME_PROP_ID 11
2546 #define CERT_PVK_FILE_PROP_ID 12
2547 #define CERT_DESCRIPTION_PROP_ID 13
2548 #define CERT_ACCESS_STATE_PROP_ID 14
2549 #define CERT_SIGNATURE_HASH_PROP_ID 15
2550 #define CERT_SMART_CARD_DATA_PROP_ID 16
2551 #define CERT_EFS_PROP_ID 17
2552 #define CERT_FORTEZZA_DATA_PROP_ID 18
2553 #define CERT_ARCHIVED_PROP_ID 19
2554 #define CERT_KEY_IDENTIFIER_PROP_ID 20
2555 #define CERT_AUTO_ENROLL_PROP_ID 21
2556 #define CERT_PUBKEY_ALG_PARA_PROP_ID 22
2557 #define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23
2558 #define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24
2559 #define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25
2560 #define CERT_ENROLLMENT_PROP_ID 26
2561 #define CERT_DATE_STAMP_PROP_ID 27
2562 #define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28
2563 #define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29
2564 #define CERT_EXTENDED_ERROR_INFO_PROP_ID 30
2565 /* 31 -- unused?
2566 32 -- cert prop id
2567 33 -- CRL prop id
2568 34 -- CTL prop id
2569 35 -- KeyId prop id
2570 36-63 -- reserved
2572 #define CERT_RENEWAL_PROP_ID 64
2573 #define CERT_ARCHIVED_KEY_HASH_PROP_ID 65
2574 #define CERT_AUTO_ENROLL_RETRY_PROP_ID 66
2575 #define CERT_AIA_URL_RETRIEVED_PROP_ID 67
2576 #define CERT_AUTHORITY_INFO_ACCESS_PROP_ID 68
2577 #define CERT_BACKED_UP_PROP_ID 69
2578 #define CERT_OCSP_RESPONSE_PROP_ID 70
2579 #define CERT_REQUEST_ORIGINATOR_PROP_ID 71
2580 #define CERT_SOURCE_LOCATION_PROP_ID 72
2581 #define CERT_SOURCE_URL_PROP_ID 73
2582 #define CERT_NEW_KEY_PROP_ID 74
2583 #define CERT_OCSP_CACHE_PREFIX_PROP_ID 75
2584 #define CERT_SMART_CARD_ROOT_INFO_PROP_ID 76
2585 #define CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID 77
2586 #define CERT_NCRYPT_KEY_HANDLE_PROP_ID 78
2587 #define CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID 79
2588 #define CERT_SUBJECT_INFO_ACCESS_PROP_ID 80
2589 #define CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 81
2590 #define CERT_CA_DISABLE_CRL_PROP_ID 82
2591 #define CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID 83
2592 #define CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID 84
2594 #define CERT_FIRST_RESERVED_PROP_ID 85
2595 #define CERT_LAST_RESERVED_PROP_ID 0x00007fff
2596 #define CERT_FIRST_USER_PROP_ID 0x00008000
2597 #define CERT_LAST_USER_PROP_ID 0x0000ffff
2599 #define IS_CERT_HASH_PROP_ID(x) \
2600 ((x) == CERT_SHA1_HASH_PROP_ID || (x) == CERT_MD5_HASH_PROP_ID || \
2601 (x) == CERT_SIGNATURE_HASH_PROP_ID)
2603 #define IS_PUBKEY_HASH_PROP_ID(x) \
2604 ((x) == CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2605 (x) == CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID)
2607 #define IS_CHAIN_HASH_PROP_ID(x) \
2608 ((x) == CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2609 (x) == CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2610 (x) == CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID || \
2611 (x) == CERT_SUBJECT_NAME_MD5_HASH_PROP_ID)
2613 /* access state flags */
2614 #define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1
2615 #define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2
2616 #define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4
2618 /* CertSetCertificateContextProperty flags */
2619 #define CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG 0x40000000
2620 #define CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG 0x80000000
2622 /* CERT_RDN attribute dwValueType types */
2623 #define CERT_RDN_TYPE_MASK 0x000000ff
2624 #define CERT_RDN_ANY_TYPE 0
2625 #define CERT_RDN_ENCODED_BLOB 1
2626 #define CERT_RDN_OCTET_STRING 2
2627 #define CERT_RDN_NUMERIC_STRING 3
2628 #define CERT_RDN_PRINTABLE_STRING 4
2629 #define CERT_RDN_TELETEX_STRING 5
2630 #define CERT_RDN_T61_STRING 5
2631 #define CERT_RDN_VIDEOTEX_STRING 6
2632 #define CERT_RDN_IA5_STRING 7
2633 #define CERT_RDN_GRAPHIC_STRING 8
2634 #define CERT_RDN_VISIBLE_STRING 9
2635 #define CERT_RDN_ISO646_STRING 9
2636 #define CERT_RDN_GENERAL_STRING 10
2637 #define CERT_RDN_UNIVERSAL_STRING 11
2638 #define CERT_RDN_INT4_STRING 11
2639 #define CERT_RDN_BMP_STRING 12
2640 #define CERT_RDN_UNICODE_STRING 12
2641 #define CERT_RDN_UTF8_STRING 13
2643 /* CERT_RDN attribute dwValueType flags */
2644 #define CERT_RDN_FLAGS_MASK 0xff000000
2645 #define CERT_RDN_ENABLE_T61_UNICODE_FLAG 0x80000000
2646 #define CERT_RDN_DISABLE_CHECK_TYPE_FLAG 0x4000000
2647 #define CERT_RDN_ENABLE_UTF8_UNICODE_FLAG 0x2000000
2648 #define CERT_RDN_DISABLE_IE4_UTF8_FLAG 0x0100000
2650 #define IS_CERT_RDN_CHAR_STRING(x) \
2651 (((x) & CERT_RDN_TYPE_MASK) >= CERT_RDN_NUMERIC_STRING)
2653 /* CertIsRDNAttrsInCertificateName flags */
2654 #define CERT_UNICODE_IS_RDN_ATTRS_FLAG 0x1
2655 #define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 0x2
2657 /* CRL reason codes */
2658 #define CRL_REASON_UNSPECIFIED 0
2659 #define CRL_REASON_KEY_COMPROMISE 1
2660 #define CRL_REASON_CA_COMPROMISE 2
2661 #define CRL_REASON_AFFILIATION_CHANGED 3
2662 #define CRL_REASON_SUPERSEDED 4
2663 #define CRL_REASON_CESSATION_OF_OPERATION 5
2664 #define CRL_REASON_CERTIFICATE_HOLD 6
2665 #define CRL_REASON_REMOVE_FROM_CRL 8
2667 /* CertControlStore control types */
2668 #define CERT_STORE_CTRL_RESYNC 1
2669 #define CERT_STORE_CTRL_NOTIFY_CHANGE 2
2670 #define CERT_STORE_CTRL_COMMIT 3
2671 #define CERT_STORE_CTRL_AUTO_RESYNC 4
2672 #define CERT_STORE_CTRL_CANCEL_NOTIFY 5
2674 #define CERT_STORE_CTRL_COMMIT_FORCE_FLAG 0x1
2675 #define CERT_STORE_CTRL_COMMIT_CLEAR_FLAG 0x2
2677 /* cert store properties */
2678 #define CERT_STORE_LOCALIZED_NAME_PROP_ID 0x1000
2680 /* CertCreateContext flags */
2681 #define CERT_CREATE_CONTEXT_NOCOPY_FLAG 0x1
2682 #define CERT_CREATE_CONTEXT_SORTED_FLAG 0x2
2683 #define CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG 0x4
2684 #define CERT_CREATE_CONTEXT_NO_ENTRY_FLAG 0x8
2686 #define CERT_COMPARE_MASK 0xffff
2687 #define CERT_COMPARE_SHIFT 16
2688 #define CERT_COMPARE_ANY 0
2689 #define CERT_COMPARE_SHA1_HASH 1
2690 #define CERT_COMPARE_HASH CERT_COMPARE_SHA1_HASH
2691 #define CERT_COMPARE_NAME 2
2692 #define CERT_COMPARE_ATTR 3
2693 #define CERT_COMPARE_MD5_HASH 4
2694 #define CERT_COMPARE_PROPERTY 5
2695 #define CERT_COMPARE_PUBLIC_KEY 6
2696 #define CERT_COMPARE_NAME_STR_A 7
2697 #define CERT_COMPARE_NAME_STR_W 8
2698 #define CERT_COMPARE_KEY_SPEC 9
2699 #define CERT_COMPARE_ENHKEY_USAGE 10
2700 #define CERT_COMPARE_CTL_USAGE CERT_COMPARE_ENHKEY_USAGE
2701 #define CERT_COMPARE_SUBJECT_CERT 11
2702 #define CERT_COMPARE_ISSUER_OF 12
2703 #define CERT_COMPARE_EXISTING 13
2704 #define CERT_COMPARE_SIGNATURE_HASH 14
2705 #define CERT_COMPARE_KEY_IDENTIFIER 15
2706 #define CERT_COMPARE_CERT_ID 16
2707 #define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17
2708 #define CERT_COMPARE_PUBKEY_MD5_HASH 18
2710 /* values of dwFindType for CertFind*InStore */
2711 #define CERT_FIND_ANY \
2712 (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT)
2713 #define CERT_FIND_SHA1_HASH \
2714 (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT)
2715 #define CERT_FIND_MD5_HASH \
2716 (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT)
2717 #define CERT_FIND_SIGNATURE_HASH \
2718 (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT)
2719 #define CERT_FIND_KEY_IDENTIFIER \
2720 (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT)
2721 #define CERT_FIND_HASH CERT_FIND_SHA1_HASH
2722 #define CERT_FIND_PROPERTY \
2723 (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT)
2724 #define CERT_FIND_PUBLIC_KEY \
2725 (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT)
2726 #define CERT_FIND_SUBJECT_NAME \
2727 (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2728 #define CERT_FIND_SUBJECT_ATTR \
2729 (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2730 #define CERT_FIND_ISSUER_NAME \
2731 (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2732 #define CERT_FIND_ISSUER_ATTR \
2733 (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2734 #define CERT_FIND_SUBJECT_STR_A \
2735 (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2736 #define CERT_FIND_SUBJECT_STR_W \
2737 (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2738 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W
2739 #define CERT_FIND_ISSUER_STR_A \
2740 (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2741 #define CERT_FIND_ISSUER_STR_W \
2742 (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2743 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W
2744 #define CERT_FIND_KEY_SPEC \
2745 (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT)
2746 #define CERT_FIND_ENHKEY_USAGE \
2747 (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT)
2748 #define CERT_FIND_CTL_USAGE CERT_FIND_ENHKEY_USAGE
2749 #define CERT_FIND_SUBJECT_CERT \
2750 (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT)
2751 #define CERT_FIND_ISSUER_OF \
2752 (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT)
2753 #define CERT_FIND_EXISTING \
2754 (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT)
2755 #define CERT_FIND_CERT_ID \
2756 (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT)
2757 #define CERT_FIND_CROSS_CERT_DIST_POINTS \
2758 (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT)
2759 #define CERT_FIND_PUBKEY_MD5_HASH \
2760 (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT)
2762 #define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 0x1
2763 #define CERT_FIND_OPTIONAL_CTL_USAGE_FLAG 0x1
2764 #define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 0x2
2765 #define CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG 0x2
2766 #define CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG 0x4
2767 #define CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG 0x4
2768 #define CERT_FIND_NO_ENHKEY_USAGE_FLAG 0x8
2769 #define CERT_FIND_NO_CTL_USAGE_FLAG 0x8
2770 #define CERT_FIND_OR_ENHKEY_USAGE_FLAG 0x10
2771 #define CERT_FIND_OR_CTL_USAGE_FLAG 0x10
2772 #define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 0x20
2773 #define CERT_FIND_VALID_CTL_USAGE_FLAG 0x20
2775 #define CRL_FIND_ANY 0
2776 #define CRL_FIND_ISSUED_BY 1
2777 #define CRL_FIND_EXISTING 2
2778 #define CRL_FIND_ISSUED_FOR 3
2780 #define CRL_FIND_ISSUED_BY_AKI_FLAG 0x1
2781 #define CRL_FIND_ISSUED_BY_SIGNATURE_FLAG 0x2
2782 #define CRL_FIND_ISSUED_BY_DELTA_FLAG 0x4
2783 #define CRL_FIND_ISSUED_BY_BASE_FLAG 0x8
2785 typedef struct _CRL_FIND_ISSUED_FOR_PARA
2787 PCCERT_CONTEXT pSubjectCert;
2788 PCCERT_CONTEXT pIssuerCert;
2789 } CRL_FIND_ISSUED_FOR_PARA, *PCRL_FIND_ISSUED_FOR_PARA;
2791 #define CTL_FIND_ANY 0
2792 #define CTL_FIND_SHA1_HASH 1
2793 #define CTL_FIND_MD5_HASH 2
2794 #define CTL_FIND_USAGE 3
2795 #define CTL_FIND_SUBJECT 4
2796 #define CTL_FIND_EXISTING 5
2798 typedef struct _CTL_FIND_USAGE_PARA
2800 DWORD cbSize;
2801 CTL_USAGE SubjectUsage;
2802 CRYPT_DATA_BLOB ListIdentifier;
2803 PCERT_INFO pSigner;
2804 } CTL_FIND_USAGE_PARA, *PCTL_FIND_USAGE_PARA;
2806 #define CTL_FIND_NO_LIST_ID_CBDATA 0xffffffff
2807 #define CTL_FIND_NO_SIGNER_PTR ((PCERT_INFO)-1)
2808 #define CTL_FIND_SAME_USAGE_FLAG 0x00000001
2810 typedef struct _CTL_FIND_SUBJECT_PARA
2812 DWORD cbSize;
2813 PCTL_FIND_USAGE_PARA pUsagePara;
2814 DWORD dwSubjectType;
2815 void *pvSubject;
2816 } CTL_FIND_SUBJECT_PARA, *PCTL_FIND_SUBJECT_PARA;
2818 /* PFN_CERT_STORE_PROV_WRITE_CERT dwFlags values */
2819 #define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1
2821 /* CertAddSerializedElementToStore context types */
2822 #define CERT_STORE_CERTIFICATE_CONTEXT 1
2823 #define CERT_STORE_CRL_CONTEXT 2
2824 #define CERT_STORE_CTL_CONTEXT 3
2825 #define CERT_STORE_ALL_CONTEXT_FLAG ~0U
2826 #define CERT_STORE_CERTIFICATE_CONTEXT_FLAG \
2827 (1 << CERT_STORE_CERTIFICATE_CONTEXT)
2828 #define CERT_STORE_CRL_CONTEXT_FLAG (1 << CERT_STORE_CRL_CONTEXT)
2829 #define CERT_STORE_CTL_CONTEXT_FLAG (1 << CERT_STORE_CTL_CONTEXT)
2831 /* CryptBinaryToString/CryptStringToBinary flags */
2832 #define CRYPT_STRING_BASE64HEADER 0x00000000
2833 #define CRYPT_STRING_BASE64 0x00000001
2834 #define CRYPT_STRING_BINARY 0x00000002
2835 #define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003
2836 #define CRYPT_STRING_HEX 0x00000004
2837 #define CRYPT_STRING_HEXASCII 0x00000005
2838 #define CRYPT_STRING_BASE64_ANY 0x00000006
2839 #define CRYPT_STRING_ANY 0x00000007
2840 #define CRYPT_STRING_HEX_ANY 0x00000008
2841 #define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009
2842 #define CRYPT_STRING_HEXADDR 0x0000000a
2843 #define CRYPT_STRING_HEXASCIIADDR 0x0000000b
2844 #define CRYPT_STRING_HEXRAW 0x0000000c
2845 #define CRYPT_STRING_BASE64URI 0x0000000d
2847 #define CRYPT_STRING_PERCENTESCAPE 0x08000000
2848 #define CRYPT_STRING_HASHDATA 0x10000000
2849 #define CRYPT_STRING_STRICT 0x20000000
2850 #define CRYPT_STRING_NOCRLF 0x40000000
2851 #define CRYPT_STRING_NOCR 0x80000000
2853 /* OIDs */
2854 #define szOID_RSA "1.2.840.113549"
2855 #define szOID_PKCS "1.2.840.113549.1"
2856 #define szOID_RSA_HASH "1.2.840.113549.2"
2857 #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
2858 #define szOID_PKCS_1 "1.2.840.113549.1.1"
2859 #define szOID_PKCS_2 "1.2.840.113549.1.2"
2860 #define szOID_PKCS_3 "1.2.840.113549.1.3"
2861 #define szOID_PKCS_4 "1.2.840.113549.1.4"
2862 #define szOID_PKCS_5 "1.2.840.113549.1.5"
2863 #define szOID_PKCS_6 "1.2.840.113549.1.6"
2864 #define szOID_PKCS_7 "1.2.840.113549.1.7"
2865 #define szOID_PKCS_8 "1.2.840.113549.1.8"
2866 #define szOID_PKCS_9 "1.2.840.113549.1.9"
2867 #define szOID_PKCS_10 "1.2.840.113549.1.10"
2868 #define szOID_PKCS_11 "1.2.840.113549.1.12"
2869 #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
2870 #define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA
2871 #define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA
2872 #define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA
2873 #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
2874 #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
2875 #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
2876 #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
2877 #define szOID_RSA_SET0AEP_RSA "1.2.840.113549.1.1.6"
2878 #define szOID_RSA_SHA256RSA "1.2.840.113549.1.1.11"
2879 #define szOID_RSA_SHA384RSA "1.2.840.113549.1.1.12"
2880 #define szOID_RSA_SHA512RSA "1.2.840.113549.1.1.13"
2881 #define szOID_RSA_DH "1.2.840.113549.1.3.1"
2882 #define szOID_RSA_data "1.2.840.113549.1.7.1"
2883 #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
2884 #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
2885 #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
2886 #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
2887 #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
2888 #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
2889 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
2890 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
2891 #define szOID_RSA_contentType "1.2.840.113549.1.9.3"
2892 #define szOID_RSA_messageDigest "1.2.840.113549.1.9.4"
2893 #define szOID_RSA_signingTime "1.2.840.113549.1.9.5"
2894 #define szOID_RSA_counterSign "1.2.840.113549.1.9.6"
2895 #define szOID_RSA_challengePwd "1.2.840.113549.1.9.7"
2896 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.9"
2897 #define szOID_RSA_extCertAttrs "1.2.840.113549.1.9.9"
2898 #define szOID_RSA_certExtensions "1.2.840.113549.1.9.14"
2899 #define szOID_RSA_SMIMECapabilities "1.2.840.113549.1.9.15"
2900 #define szOID_RSA_preferSignedData "1.2.840.113549.1.9.15.1"
2901 #define szOID_RSA_SMIMEalg "1.2.840.113549.1.9.16.3"
2902 #define szOID_RSA_SMIMEalgESDH "1.2.840.113549.1.9.16.3.5"
2903 #define szOID_RSA_SMIMEalgCMS3DESwrap "1.2.840.113549.1.9.16.3.6"
2904 #define szOID_RSA_SMIMEalgCMSRC2wrap "1.2.840.113549.1.9.16.3.7"
2905 #define szOID_RSA_MD2 "1.2.840.113549.2.2"
2906 #define szOID_RSA_MD4 "1.2.840.113549.2.4"
2907 #define szOID_RSA_MD5 "1.2.840.113549.2.5"
2908 #define szOID_RSA_RC2CBC "1.2.840.113549.3.2"
2909 #define szOID_RSA_RC4 "1.2.840.113549.3.4"
2910 #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
2911 #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
2912 #define szOID_ANSI_X942 "1.2.840.10046"
2913 #define szOID_ANSI_X942_DH "1.2.840.10046.2.1"
2914 #define szOID_X957 "1.2.840.10040"
2915 #define szOID_X957_DSA "1.2.840.10040.4.1"
2916 #define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
2917 #define szOID_ECC_PUBLIC_KEY "1.2.840.10045.2.1"
2918 #define szOID_ECC_CURVE_P256 "1.2.840.10045.3.1.7"
2919 #define szOID_ECDSA_SPECIFIED "1.2.840.10045.4.3"
2920 #define szOID_ECDSA_SHA256 "1.2.840.10045.4.3.2"
2921 #define szOID_ECDSA_SHA384 "1.2.840.10045.4.3.3"
2922 #define szOID_ECDSA_SHA512 "1.2.840.10045.4.3.4"
2923 #define szOID_DS "2.5"
2924 #define szOID_DSALG "2.5.8"
2925 #define szOID_DSALG_CRPT "2.5.8.1"
2926 #define szOID_DSALG_HASH "2.5.8.2"
2927 #define szOID_DSALG_SIGN "2.5.8.3"
2928 #define szOID_DSALG_RSA "2.5.8.1.1"
2929 #define szOID_OIW "1.3.14"
2930 #define szOID_OIWSEC "1.3.14.3.2"
2931 #define szOID_OIWSEC_md4RSA "1.3.14.3.2.2"
2932 #define szOID_OIWSEC_md5RSA "1.3.14.3.2.3"
2933 #define szOID_OIWSEC_md4RSA2 "1.3.14.3.2.4"
2934 #define szOID_OIWSEC_desECB "1.3.14.3.2.6"
2935 #define szOID_OIWSEC_desCBC "1.3.14.3.2.7"
2936 #define szOID_OIWSEC_desOFB "1.3.14.3.2.8"
2937 #define szOID_OIWSEC_desCFB "1.3.14.3.2.9"
2938 #define szOID_OIWSEC_desMAC "1.3.14.3.2.10"
2939 #define szOID_OIWSEC_rsaSign "1.3.14.3.2.11"
2940 #define szOID_OIWSEC_dsa "1.3.14.3.2.12"
2941 #define szOID_OIWSEC_shaDSA "1.3.14.3.2.13"
2942 #define szOID_OIWSEC_mdc2RSA "1.3.14.3.2.14"
2943 #define szOID_OIWSEC_shaRSA "1.3.14.3.2.15"
2944 #define szOID_OIWSEC_dhCommMod "1.3.14.3.2.16"
2945 #define szOID_OIWSEC_desEDE "1.3.14.3.2.17"
2946 #define szOID_OIWSEC_sha "1.3.14.3.2.18"
2947 #define szOID_OIWSEC_mdc2 "1.3.14.3.2.19"
2948 #define szOID_OIWSEC_dsaComm "1.3.14.3.2.20"
2949 #define szOID_OIWSEC_dsaCommSHA "1.3.14.3.2.21"
2950 #define szOID_OIWSEC_rsaXchg "1.3.14.3.2.22"
2951 #define szOID_OIWSEC_keyHashSeal "1.3.14.3.2.23"
2952 #define szOID_OIWSEC_md2RSASign "1.3.14.3.2.24"
2953 #define szOID_OIWSEC_md5RSASign "1.3.14.3.2.25"
2954 #define szOID_OIWSEC_sha1 "1.3.14.3.2.26"
2955 #define szOID_OIWSEC_dsaSHA1 "1.3.14.3.2.27"
2956 #define szOID_OIWSEC_dsaCommSHA1 "1.3.14.3.2.28"
2957 #define szOID_OIWSEC_sha1RSASign "1.3.14.3.2.29"
2958 #define szOID_OIWDIR "1.3.14.7.2"
2959 #define szOID_OIWDIR_CRPT "1.3.14.7.2.1"
2960 #define szOID_OIWDIR_HASH "1.3.14.7.2.2"
2961 #define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
2962 #define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
2963 #define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
2964 #define szOID_ECC_CURVE_P384 "1.3.132.0.34"
2965 #define szOID_ECC_CURVE_P521 "1.3.132.0.35"
2966 #define szOID_INFOSEC "2.16.840.1.101.2.1"
2967 #define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
2968 #define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
2969 #define szOID_INFOSEC_sdnsConfidentiality "2.16.840.1.101.2.1.1.3"
2970 #define szOID_INFOSEC_mosaicConfidentiality "2.16.840.1.101.2.1.1.4"
2971 #define szOID_INFOSEC_sdnsIntegrity "2.16.840.1.101.2.1.1.5"
2972 #define szOID_INFOSEC_mosaicIntegrity "2.16.840.1.101.2.1.1.6"
2973 #define szOID_INFOSEC_sdnsTokenProtection "2.16.840.1.101.2.1.1.7"
2974 #define szOID_INFOSEC_mosaicTokenProtection "2.16.840.1.101.2.1.1.8"
2975 #define szOID_INFOSEC_sdnsKeyManagement "2.16.840.1.101.2.1.1.9"
2976 #define szOID_INFOSEC_mosaicKeyManagement "2.16.840.1.101.2.1.1.10"
2977 #define szOID_INFOSEC_sdnsKMandSig "2.16.840.1.101.2.1.1.11"
2978 #define szOID_INFOSEC_mosaicKMandSig "2.16.840.1.101.2.1.1.12"
2979 #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
2980 #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
2981 #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
2982 #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
2983 #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
2984 #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
2985 #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
2986 #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
2987 #define szOID_INFOSEC_mosaicUpdateInteg "2.16.840.1.101.2.1.1.21"
2988 #define szOID_NIST_sha256 "2.16.840.1.101.3.4.2.1"
2989 #define szOID_NIST_sha384 "2.16.840.1.101.3.4.2.2"
2990 #define szOID_NIST_sha512 "2.16.840.1.101.3.4.2.3"
2991 #define szOID_COMMON_NAME "2.5.4.3"
2992 #define szOID_SUR_NAME "2.5.4.4"
2993 #define szOID_DEVICE_SERIAL_NUMBER "2.5.4.5"
2994 #define szOID_COUNTRY_NAME "2.5.4.6"
2995 #define szOID_LOCALITY_NAME "2.5.4.7"
2996 #define szOID_STATE_OR_PROVINCE_NAME "2.5.4.8"
2997 #define szOID_STREET_ADDRESS "2.5.4.9"
2998 #define szOID_ORGANIZATION_NAME "2.5.4.10"
2999 #define szOID_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
3000 #define szOID_TITLE "2.5.4.12"
3001 #define szOID_DESCRIPTION "2.5.4.13"
3002 #define szOID_SEARCH_GUIDE "2.5.4.14"
3003 #define szOID_BUSINESS_CATEGORY "2.5.4.15"
3004 #define szOID_POSTAL_ADDRESS "2.5.4.16"
3005 #define szOID_POSTAL_CODE "2.5.4.17"
3006 #define szOID_POST_OFFICE_BOX "2.5.4.18"
3007 #define szOID_PHYSICAL_DELIVERY_OFFICE_NAME "2.5.4.19"
3008 #define szOID_TELEPHONE_NUMBER "2.5.4.20"
3009 #define szOID_TELEX_NUMBER "2.5.4.21"
3010 #define szOID_TELETEXT_TERMINAL_IDENTIFIER "2.5.4.22"
3011 #define szOID_FACSIMILE_TELEPHONE_NUMBER "2.5.4.23"
3012 #define szOID_X21_ADDRESS "2.5.4.24"
3013 #define szOID_INTERNATIONAL_ISDN_NUMBER "2.5.4.25"
3014 #define szOID_REGISTERED_ADDRESS "2.5.4.26"
3015 #define szOID_DESTINATION_INDICATOR "2.5.4.27"
3016 #define szOID_PREFERRED_DELIVERY_METHOD "2.5.4.28"
3017 #define szOID_PRESENTATION_ADDRESS "2.5.4.29"
3018 #define szOID_SUPPORTED_APPLICATION_CONTEXT "2.5.4.30"
3019 #define szOID_MEMBER "2.5.4.31"
3020 #define szOID_OWNER "2.5.4.32"
3021 #define szOID_ROLE_OCCUPANT "2.5.4.33"
3022 #define szOID_SEE_ALSO "2.5.4.34"
3023 #define szOID_USER_PASSWORD "2.5.4.35"
3024 #define szOID_USER_CERTIFICATE "2.5.4.36"
3025 #define szOID_CA_CERTIFICATE "2.5.4.37"
3026 #define szOID_AUTHORITY_REVOCATION_LIST "2.5.4.38"
3027 #define szOID_CERTIFICATE_REVOCATION_LIST "2.5.4.39"
3028 #define szOID_CROSS_CERTIFICATE_PAIR "2.5.4.40"
3029 #define szOID_GIVEN_NAME "2.5.4.42"
3030 #define szOID_INITIALS "2.5.4.43"
3031 #define szOID_DN_QUALIFIER "2.5.4.46"
3032 #define szOID_AUTHORITY_KEY_IDENTIFIER "2.5.29.1"
3033 #define szOID_KEY_ATTRIBUTES "2.5.29.2"
3034 #define szOID_CERT_POLICIES_95 "2.5.29.3"
3035 #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
3036 #define szOID_LEGACY_POLICY_MAPPINGS "2.5.29.5"
3037 #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
3038 #define szOID_ISSUER_ALT_NAME "2.5.29.8"
3039 #define szOID_SUBJECT_DIR_ATTRS "2.5.29.9"
3040 #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
3041 #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
3042 #define szOID_KEY_USAGE "2.5.29.15"
3043 #define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16"
3044 #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
3045 #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
3046 #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
3047 #define szOID_CRL_NUMBER "2.5.29.20"
3048 #define szOID_CRL_REASON_CODE "2.5.29.21"
3049 #define szOID_REASON_CODE_HOLD "2.5.29.23"
3050 #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
3051 #define szOID_ISSUING_DIST_POINT "2.5.29.28"
3052 #define szOID_NAME_CONSTRAINTS "2.5.29.30"
3053 #define szOID_CRL_DIST_POINTS "2.5.29.31"
3054 #define szOID_CERT_POLICIES "2.5.29.32"
3055 #define szOID_ANY_CERT_POLICY "2.5.29.32.0"
3056 #define szOID_POLICY_MAPPINGS "2.5.29.33"
3057 #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
3058 #define szOID_POLICY_CONSTRAINTS "2.5.29.36"
3059 #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
3060 #define szOID_FRESHEST_CRL "2.5.29.46"
3061 #define szOID_INHIBIT_ANY_POLICY "2.5.29.54"
3062 #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25"
3063 #define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20"
3064 #define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21"
3065 #define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14"
3066 #define szOID_NEXT_UPDATE_LOCATION "1.3.6.1.4.1.311.10.2"
3067 #define szOID_KP_CTL_USAGE_SIGNING "1.3.6.1.4.1.311.10.3.1"
3068 #define szOID_KP_TIME_STAMP_SIGNING "1.3.6.1.4.1.311.10.3.2"
3069 #ifndef szOID_SERVER_GATED_CRYPTO
3070 #define szOID_SERVER_GATED_CRYPTO "1.3.6.1.4.1.311.10.3.3"
3071 #endif
3072 #ifndef szOID_SGC_NETSCAPE
3073 #define szOID_SGC_NETSCAPE "2.16.840.1.113730.4.1"
3074 #endif
3075 #define szOID_KP_EFS "1.3.6.1.4.1.311.10.3.4"
3076 #define szOID_EFS_RECOVERY "1.3.6.1.4.1.311.10.3.4.1"
3077 #define szOID_WHQL_CRYPTO "1.3.6.1.4.1.311.10.3.5"
3078 #define szOID_NT5_CRYPTO "1.3.6.1.4.1.311.10.3.6"
3079 #define szOID_OEM_WHQL_CRYPTO "1.3.6.1.4.1.311.10.3.7"
3080 #define szOID_EMBEDDED_NT_CRYPTO "1.3.6.1.4.1.311.10.3.8"
3081 #define szOID_ROOT_LIST_SIGNER "1.3.6.1.4.1.311.10.3.9"
3082 #define szOID_KP_QUALIFIED_SUBORDINATION "1.3.6.1.4.1.311.10.3.10"
3083 #define szOID_KP_KEY_RECOVERY "1.3.6.1.4.1.311.10.3.11"
3084 #define szOID_KP_DOCUMENT_SIGNING "1.3.6.1.4.1.311.10.3.12"
3085 #define szOID_KP_LIFETIME_SIGNING "1.3.6.1.4.1.311.10.3.13"
3086 #define szOID_KP_MOBILE_DEVICE_SOFTWARE "1.3.6.1.4.1.311.10.3.14"
3087 #define szOID_YESNO_TRUST_ATTR "1.3.6.1.4.1.311.10.4.1"
3088 #ifndef szOID_DRM
3089 #define szOID_DRM "1.3.6.1.4.1.311.10.5.1"
3090 #endif
3091 #ifndef szOID_DRM_INDIVIDUALIZATION
3092 #define szOID_DRM_INDIVIDUALIZATION "1.3.6.1.4.1.311.10.5.2"
3093 #endif
3094 #ifndef szOID_LICENSES
3095 #define szOID_LICENSES "1.3.6.1.4.1.311.10.6.1"
3096 #endif
3097 #ifndef szOID_LICENSE_SERVER
3098 #define szOID_LICENSE_SERVER "1.3.6.1.4.1.311.10.6.2"
3099 #endif
3100 #define szOID_REMOVE_CERTIFICATE "1.3.6.1.4.1.311.10.8.1"
3101 #define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1"
3102 #define szOID_CTL "1.3.6.1.4.1.311.10.1"
3103 #define szOID_SORTED_CTL "1.3.6.1.4.1.311.10.1.1"
3104 #define szOID_ANY_APPLICATION_POLICY "1.3.6.1.4.1.311.10.12.1"
3105 #define szOID_RENEWAL_CERTIFICATE "1.3.6.1.4.1.311.13.1"
3106 #define szOID_ENROLLMENT_NAME_VALUE_PAIR "1.3.6.1.4.1.311.13.2.1"
3107 #define szOID_ENROLLMENT_CSP_PROVIDER "1.3.6.1.4.1.311.13.2.2"
3108 #define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3"
3109 #define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1"
3110 #define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2"
3111 #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
3112 #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
3113 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
3114 #ifndef szOID_KP_SMARTCARD_LOGON
3115 #define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2"
3116 #endif
3117 #ifndef szOID_NT_PRINCIPAL_NAME
3118 #define szOID_NT_PRINCIPAL_NAME "1.3.6.1.4.1.311.20.2.3"
3119 #endif
3120 #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
3121 #ifndef szOID_CERTSRV_CA_VERSION
3122 #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
3123 #endif
3124 #define szOID_CERTSRV_PREVIOUS_CERT_HASH "1.3.6.1.4.1.311.21.2"
3125 #define szOID_CRL_VIRTUAL_BASE "1.3.6.1.4.1.311.21.3"
3126 #define szOID_CRL_NEXT_PUBLISH "1.3.6.1.4.1.311.21.4"
3127 #define szOID_KP_CA_EXCHANGE "1.3.6.1.4.1.311.21.5"
3128 #define szOID_KP_KEY_RECOVERY_AGENT "1.3.6.1.4.1.311.21.6"
3129 #define szOID_CERTIFICATE_TEMPLATE "1.3.6.1.4.1.311.21.7"
3130 #define szOID_ENTERPRISE_OID_ROOT "1.3.6.1.4.1.311.21.8"
3131 #define szOID_RDN_DUMMY_SIGNER "1.3.6.1.4.1.311.21.9"
3132 #define szOID_APPLICATION_CERT_POLICIES "1.3.6.1.4.1.311.21.10"
3133 #define szOID_APPLICATION_POLICY_MAPPINGS "1.3.6.1.4.1.311.21.11"
3134 #define szOID_APPLICATION_POLICY_CONSTRAINTS "1.3.6.1.4.1.311.21.12"
3135 #define szOID_ARCHIVED_KEY_ATTR "1.3.6.1.4.1.311.21.13"
3136 #define szOID_CRL_SELF_CDP "1.3.6.1.4.1.311.21.14"
3137 #define szOID_REQUIRE_CERT_CHAIN_POLICY "1.3.6.1.4.1.311.21.15"
3138 #define szOID_ARCHIVED_KEY_CERT_HASH "1.3.6.1.4.1.311.21.16"
3139 #define szOID_ISSUED_CERT_HASH "1.3.6.1.4.1.311.21.17"
3140 #define szOID_DS_EMAIL_REPLICATION "1.3.6.1.4.1.311.21.19"
3141 #define szOID_REQUEST_CLIENT_INFO "1.3.6.1.4.1.311.21.20"
3142 #define szOID_ENCRYPTED_KEY_HASH "1.3.6.1.4.1.311.21.21"
3143 #define szOID_CERTSRV_CROSSCA_VERSION "1.3.6.1.4.1.311.21.22"
3144 #define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1"
3145 #define szOID_PKIX "1.3.6.1.5.5.7"
3146 #define szOID_PKIX_PE "1.3.6.1.5.5.7.1"
3147 #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
3148 #define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1"
3149 #define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2"
3150 #define szOID_PKIX_KP "1.3.6.1.5.5.7.3"
3151 #define szOID_PKIX_KP_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
3152 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
3153 #define szOID_PKIX_KP_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
3154 #define szOID_PKIX_KP_EMAIL_PROTECTION "1.3.6.1.5.5.7.3.4"
3155 #define szOID_PKIX_KP_IPSEC_END_SYSTEM "1.3.6.1.5.5.7.3.5"
3156 #define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6"
3157 #define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7"
3158 #define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8"
3159 #define szOID_PKIX_NO_SIGNATURE "1.3.6.1.5.5.7.6.2"
3160 #define szOID_CMC "1.3.6.1.5.5.7.7"
3161 #define szOID_CMC_STATUS_INFO "1.3.6.1.5.5.7.7.1"
3162 #define szOID_CMC_IDENTIFICATION "1.3.6.1.5.5.7.7.2"
3163 #define szOID_CMC_IDENTITY_PROOF "1.3.6.1.5.5.7.7.3"
3164 #define szOID_CMC_DATA_RETURN "1.3.6.1.5.5.7.7.4"
3165 #define szOID_CMC_TRANSACTION_ID "1.3.6.1.5.5.7.7.5"
3166 #define szOID_CMC_SENDER_NONCE "1.3.6.1.5.5.7.7.6"
3167 #define szOID_CMC_RECIPIENT_NONCE "1.3.6.1.5.5.7.7.7"
3168 #define szOID_CMC_ADD_EXTENSIONS "1.3.6.1.5.5.7.7.8"
3169 #define szOID_CMC_ENCRYPTED_POP "1.3.6.1.5.5.7.7.9"
3170 #define szOID_CMC_DECRYPTED_POP "1.3.6.1.5.5.7.7.10"
3171 #define szOID_CMC_LRA_POP_WITNESS "1.3.6.1.5.5.7.7.11"
3172 #define szOID_CMC_GET_CERT "1.3.6.1.5.5.7.7.15"
3173 #define szOID_CMC_GET_CRL "1.3.6.1.5.5.7.7.16"
3174 #define szOID_CMC_REVOKE_REQUEST "1.3.6.1.5.5.7.7.17"
3175 #define szOID_CMC_REG_INFO "1.3.6.1.5.5.7.7.18"
3176 #define szOID_CMC_RESPONSE_INFO "1.3.6.1.5.5.7.7.19"
3177 #define szOID_CMC_QUERY_PENDING "1.3.6.1.5.5.7.7.21"
3178 #define szOID_CMC_ID_POP_LINK_RANDOM "1.3.6.1.5.5.7.7.22"
3179 #define szOID_CMC_ID_POP_LINK_WITNESS "1.3.6.1.5.5.7.7.23"
3180 #define szOID_CT_PKI_DATA "1.3.6.1.5.5.7.12.2"
3181 #define szOID_CT_PKI_RESPONSE "1.3.6.1.5.5.7.12.3"
3182 #define szOID_PKIX_ACC_DESCR "1.3.6.1.5.5.7.48"
3183 #define szOID_PKIX_OCSP "1.3.6.1.5.5.7.48.1"
3184 #define szOID_PKIX_CA_ISSUERS "1.3.6.1.5.5.7.48.2"
3185 #define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2"
3187 #ifndef szOID_SERIALIZED
3188 #define szOID_SERIALIZED "1.3.6.1.4.1.311.10.3.3.1"
3189 #endif
3191 #ifndef szOID_PRODUCT_UPDATE
3192 #define szOID_PRODUCT_UPDATE "1.3.6.1.4.1.311.31.1"
3193 #endif
3195 #define szOID_NETSCAPE "2.16.840.1.113730"
3196 #define szOID_NETSCAPE_CERT_EXTENSION "2.16.840.1.113730.1"
3197 #define szOID_NETSCAPE_CERT_TYPE "2.16.840.1.113730.1.1"
3198 #define szOID_NETSCAPE_BASE_URL "2.16.840.1.113730.1.2"
3199 #define szOID_NETSCAPE_REVOCATION_URL "2.16.840.1.113730.1.3"
3200 #define szOID_NETSCAPE_CA_REVOCATION_URL "2.16.840.1.113730.1.4"
3201 #define szOID_NETSCAPE_CERT_RENEWAL_URL "2.16.840.1.113730.1.7"
3202 #define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8"
3203 #define szOID_NETSCAPE_SSL_SERVER_NAME "2.16.840.1.113730.1.12"
3204 #define szOID_NETSCAPE_COMMENT "2.16.840.1.113730.1.13"
3205 #define szOID_NETSCAPE_DATA_TYPE "2.16.840.1.113730.2"
3206 #define szOID_NETSCAPE_CERT_SEQUENCE "2.16.840.1.113730.2.5"
3208 /* Bits for szOID_NETSCAPE_CERT_TYPE */
3209 #define NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE 0x80
3210 #define NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE 0x40
3211 #define NETSCAPE_SMIME_CERT_TYPE 0x20
3212 #define NETSCAPE_SIGN_CERT_TYPE 0x10
3213 #define NETSCAPE_SSL_CA_CERT_TYPE 0x04
3214 #define NETSCAPE_SMIME_CA_CERT_TYPE 0x02
3215 #define NETSCAPE_SIGN_CA_CERT_TYPE 0x01
3217 #define CRYPT_ENCODE_DECODE_NONE 0
3218 #define X509_CERT ((LPCSTR)1)
3219 #define X509_CERT_TO_BE_SIGNED ((LPCSTR)2)
3220 #define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR)3)
3221 #define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR)4)
3222 #define X509_EXTENSIONS ((LPCSTR)5)
3223 #define X509_NAME_VALUE ((LPCSTR)6)
3224 #define X509_ANY_STRING X509_NAME_VALUE
3225 #define X509_NAME ((LPCSTR)7)
3226 #define X509_PUBLIC_KEY_INFO ((LPCSTR)8)
3227 #define X509_AUTHORITY_KEY_ID ((LPCSTR)9)
3228 #define X509_KEY_ATTRIBUTES ((LPCSTR)10)
3229 #define X509_KEY_USAGE_RESTRICTION ((LPCSTR)11)
3230 #define X509_ALTERNATE_NAME ((LPCSTR)12)
3231 #define X509_BASIC_CONSTRAINTS ((LPCSTR)13)
3232 #define X509_KEY_USAGE ((LPCSTR)14)
3233 #define X509_BASIC_CONSTRAINTS2 ((LPCSTR)15)
3234 #define X509_CERT_POLICIES ((LPCSTR)16)
3235 #define PKCS_UTC_TIME ((LPCSTR)17)
3236 #define PKCS_TIME_REQUEST ((LPCSTR)18)
3237 #define RSA_CSP_PUBLICKEYBLOB ((LPCSTR)19)
3238 #define X509_UNICODE_NAME ((LPCSTR)20)
3239 #define X509_KEYGEN_REQUEST_TO_BE_SIGNED ((LPCSTR)21)
3240 #define PKCS_ATTRIBUTE ((LPCSTR)22)
3241 #define PKCS_CONTENT_INFO_SEQUENCE_OF_ANY ((LPCSTR)23)
3242 #define X509_UNICODE_NAME_VALUE ((LPCSTR)24)
3243 #define X509_UNICODE_ANY_STRING X509_UNICODE_NAME_VALUE
3244 #define X509_OCTET_STRING ((LPCSTR)25)
3245 #define X509_BITS ((LPCSTR)26)
3246 #define X509_INTEGER ((LPCSTR)27)
3247 #define X509_MULTI_BYTE_INTEGER ((LPCSTR)28)
3248 #define X509_ENUMERATED ((LPCSTR)29)
3249 #define X509_CRL_REASON_CODE X509_ENUMERATED
3250 #define X509_CHOICE_OF_TIME ((LPCSTR)30)
3251 #define X509_AUTHORITY_KEY_ID2 ((LPCSTR)31)
3252 #define X509_AUTHORITY_INFO_ACCESS ((LPCSTR)32)
3253 #define PKCS_CONTENT_INFO ((LPCSTR)33)
3254 #define X509_SEQUENCE_OF_ANY ((LPCSTR)34)
3255 #define X509_CRL_DIST_POINTS ((LPCSTR)35)
3256 #define X509_ENHANCED_KEY_USAGE ((LPCSTR)36)
3257 #define PKCS_CTL ((LPCSTR)37)
3258 #define X509_MULTI_BYTE_UINT ((LPCSTR)38)
3259 #define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT
3260 #define X509_DSS_PARAMETERS ((LPCSTR)39)
3261 #define X509_DSS_SIGNATURE ((LPCSTR)40)
3262 #define PKCS_RC2_CBC_PARAMETERS ((LPCSTR)41)
3263 #define PKCS_SMIME_CAPABILITIES ((LPCSTR)42)
3264 #define PKCS_RSA_PRIVATE_KEY ((LPCSTR)43)
3265 #define PKCS_PRIVATE_KEY_INFO ((LPCSTR)44)
3266 #define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR)45)
3267 #define X509_PKIX_POLICY_QUALIFIER_USERNOTICE ((LPCSTR)46)
3268 #define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
3269 #define X509_DH_PARAMETERS ((LPCSTR)47)
3270 #define X509_ECC_SIGNATURE ((LPCSTR)47)
3271 #define PKCS_ATTRIBUTES ((LPCSTR)48)
3272 #define PKCS_SORTED_CTL ((LPCSTR)49)
3273 #define X942_DH_PARAMETERS ((LPCSTR)50)
3274 #define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR)51)
3275 #define X942_OTHER_INFO ((LPCSTR)52)
3276 #define X509_CERT_PAIR ((LPCSTR)53)
3277 #define X509_ISSUING_DIST_POINT ((LPCSTR)54)
3278 #define X509_NAME_CONSTRAINTS ((LPCSTR)55)
3279 #define X509_POLICY_MAPPINGS ((LPCSTR)56)
3280 #define X509_POLICY_CONSTRAINTS ((LPCSTR)57)
3281 #define X509_CROSS_CERT_DIST_POINTS ((LPCSTR)58)
3282 #define CMC_DATA ((LPCSTR)59)
3283 #define CMC_RESPONSE ((LPCSTR)60)
3284 #define CMC_STATUS ((LPCSTR)61)
3285 #define CMC_ADD_EXTENSIONS ((LPCSTR)62)
3286 #define CMC_ADD_ATTRIBUTES ((LPCSTR)63)
3287 #define X509_CERTIFICATE_TEMPLATE ((LPCSTR)64)
3288 #define OCSP_SIGNED_REQUEST ((LPCSTR)65)
3289 #define OCSP_REQUEST ((LPCSTR)66)
3290 #define OCSP_RESPONSE ((LPCSTR)67)
3291 #define OCSP_BASIC_SIGNED_RESPONSE ((LPCSTR)68)
3292 #define OCSP_BASIC_RESPONSE ((LPCSTR)69)
3293 #define CNG_RSA_PUBLIC_KEY_BLOB ((LPCSTR)72)
3294 #define X509_OBJECT_IDENTIFIER ((LPCSTR)73)
3295 #define PKCS7_SIGNER_INFO ((LPCSTR)500)
3296 #define CMS_SIGNER_INFO ((LPCSTR)501)
3298 /* encode/decode flags */
3299 #define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
3300 #define CRYPT_ENCODE_ALLOC_FLAG 0x08000
3301 #define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000
3302 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG \
3303 CERT_RDN_ENABLE_T61_UNICODE_FLAG
3304 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG \
3305 CERT_RDN_ENABLE_UTF8_UNICODE_FLAG
3306 #define CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG \
3307 CERT_RDN_DISABLE_CHECK_TYPE_FLAG
3309 #define CRYPT_DECODE_NOCOPY_FLAG 0x00001
3310 #define CRYPT_DECODE_TO_BE_SIGNED_FLAG 0x00002
3311 #define CRYPT_DECODE_SHARE_OID_STRING_FLAG 0x00004
3312 #define CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
3313 #define CRYPT_DECODE_ALLOC_FLAG 0x08000
3314 #define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \
3315 CERT_RDN_DISABLE_IE4_UTF8_FLAG
3317 #define CERT_STORE_SIGNATURE_FLAG 0x00000001
3318 #define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002
3319 #define CERT_STORE_REVOCATION_FLAG 0x00000004
3320 #define CERT_STORE_NO_CRL_FLAG 0x00010000
3321 #define CERT_STORE_NO_ISSUER_FLAG 0x00020000
3323 #define CERT_STORE_BASE_CRL_FLAG 0x00000100
3324 #define CERT_STORE_DELTA_CRL_FLAG 0x00000200
3326 /* subject types for CryptVerifyCertificateSignatureEx */
3327 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1
3328 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2
3329 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3
3331 /* issuer types for CryptVerifyCertificateSignatureEx */
3332 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1
3333 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2
3334 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3
3335 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4
3337 #define CRYPT_GET_URL_FROM_PROPERTY 0x00000001
3338 #define CRYPT_GET_URL_FROM_EXTENSION 0x00000002
3339 #define CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE 0x00000004
3340 #define CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE 0x00000008
3342 /* Certificate name string types and flags */
3343 #define CERT_SIMPLE_NAME_STR 1
3344 #define CERT_OID_NAME_STR 2
3345 #define CERT_X500_NAME_STR 3
3346 #define CERT_NAME_STR_SEMICOLON_FLAG 0x40000000
3347 #define CERT_NAME_STR_NO_PLUS_FLAG 0x20000000
3348 #define CERT_NAME_STR_NO_QUOTING_FLAG 0x10000000
3349 #define CERT_NAME_STR_CRLF_FLAG 0x08000000
3350 #define CERT_NAME_STR_COMMA_FLAG 0x04000000
3351 #define CERT_NAME_STR_REVERSE_FLAG 0x02000000
3352 #define CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG 0x00040000
3353 #define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 0x00020000
3354 #define CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG 0x00010000
3356 #define CERT_NAME_EMAIL_TYPE 1
3357 #define CERT_NAME_RDN_TYPE 2
3358 #define CERT_NAME_ATTR_TYPE 3
3359 #define CERT_NAME_SIMPLE_DISPLAY_TYPE 4
3360 #define CERT_NAME_FRIENDLY_DISPLAY_TYPE 5
3361 #define CERT_NAME_DNS_TYPE 6
3362 #define CERT_NAME_URL_TYPE 7
3363 #define CERT_NAME_UPN_TYPE 8
3365 #define CERT_NAME_ISSUER_FLAG 0x00000001
3366 #define CERT_NAME_SEARCH_ALL_NAMES_FLAG 0x00000002
3367 #define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000
3368 #define CERT_NAME_STR_ENABLE_PUNYCODE_FLAG 0x00200000
3370 /* CryptFormatObject flags */
3371 #define CRYPT_FORMAT_STR_MULTI_LINE 0x0001
3372 #define CRYPT_FORMAT_STR_NO_HEX 0x0010
3374 #define CRYPT_FORMAT_SIMPLE 0x0001
3375 #define CRYPT_FORMAT_X509 0x0002
3376 #define CRYPT_FORMAT_OID 0x0004
3377 #define CRYPT_FORMAT_RDN_SEMICOLON 0x0100
3378 #define CRYPT_FORMAT_RDN_CRLF 0x0200
3379 #define CRYPT_FORMAT_RDN_UNQUOTE 0x0400
3380 #define CRYPT_FORMAT_RDN_REVERSE 0x0800
3382 #define CRYPT_FORMAT_COMMA 0x1000
3383 #define CRYPT_FORMAT_SEMICOLON CRYPT_FORMAT_RDN_SEMICOLON
3384 #define CRYPT_FORMAT_CRLF CRYPT_FORMAT_RDN_CRLF
3386 /* CryptQueryObject types and flags */
3387 #define CERT_QUERY_OBJECT_FILE 1
3388 #define CERT_QUERY_OBJECT_BLOB 2
3390 #define CERT_QUERY_CONTENT_CERT 1
3391 #define CERT_QUERY_CONTENT_CTL 2
3392 #define CERT_QUERY_CONTENT_CRL 3
3393 #define CERT_QUERY_CONTENT_SERIALIZED_STORE 4
3394 #define CERT_QUERY_CONTENT_SERIALIZED_CERT 5
3395 #define CERT_QUERY_CONTENT_SERIALIZED_CTL 6
3396 #define CERT_QUERY_CONTENT_SERIALIZED_CRL 7
3397 #define CERT_QUERY_CONTENT_PKCS7_SIGNED 8
3398 #define CERT_QUERY_CONTENT_PKCS7_UNSIGNED 9
3399 #define CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED 10
3400 #define CERT_QUERY_CONTENT_PKCS10 11
3401 #define CERT_QUERY_CONTENT_PFX 12
3402 #define CERT_QUERY_CONTENT_CERT_PAIR 13
3404 #define CERT_QUERY_CONTENT_FLAG_CERT (1 << CERT_QUERY_CONTENT_CERT)
3405 #define CERT_QUERY_CONTENT_FLAG_CTL (1 << CERT_QUERY_CONTENT_CTL)
3406 #define CERT_QUERY_CONTENT_FLAG_CRL (1 << CERT_QUERY_CONTENT_CRL)
3407 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE \
3408 (1 << CERT_QUERY_CONTENT_SERIALIZED_STORE)
3409 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT \
3410 (1 << CERT_QUERY_CONTENT_SERIALIZED_CERT)
3411 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL \
3412 (1 << CERT_QUERY_CONTENT_SERIALIZED_CTL)
3413 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL \
3414 (1 << CERT_QUERY_CONTENT_SERIALIZED_CRL)
3415 #define CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED \
3416 (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED)
3417 #define CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED \
3418 (1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED)
3419 #define CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED \
3420 (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED)
3421 #define CERT_QUERY_CONTENT_FLAG_PKCS10 (1 << CERT_QUERY_CONTENT_PKCS10)
3422 #define CERT_QUERY_CONTENT_FLAG_PFX (1 << CERT_QUERY_CONTENT_PFX)
3423 #define CERT_QUERY_CONTENT_FLAG_CERT_PAIR (1 << CERT_QUERY_CONTENT_CERT_PAIR)
3425 #define CERT_QUERY_CONTENT_FLAG_ALL \
3426 CERT_QUERY_CONTENT_FLAG_CERT | \
3427 CERT_QUERY_CONTENT_FLAG_CTL | \
3428 CERT_QUERY_CONTENT_FLAG_CRL | \
3429 CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \
3430 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \
3431 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | \
3432 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | \
3433 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \
3434 CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | \
3435 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | \
3436 CERT_QUERY_CONTENT_FLAG_PKCS10 | \
3437 CERT_QUERY_CONTENT_FLAG_PFX | \
3438 CERT_QUERY_CONTENT_FLAG_CERT_PAIR
3440 #define CERT_QUERY_FORMAT_BINARY 1
3441 #define CERT_QUERY_FORMAT_BASE64_ENCODED 2
3442 #define CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED 3
3444 #define CERT_QUERY_FORMAT_FLAG_BINARY (1 << CERT_QUERY_FORMAT_BINARY)
3445 #define CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED \
3446 (1 << CERT_QUERY_FORMAT_BASE64_ENCODED)
3447 #define CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
3448 (1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
3450 #define CERT_QUERY_FORMAT_FLAG_ALL \
3451 CERT_QUERY_FORMAT_FLAG_BINARY | \
3452 CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | \
3453 CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
3455 #define CERT_SET_KEY_PROV_HANDLE_PROP_ID 0x00000001
3456 #define CERT_SET_KEY_CONTEXT_PROP_ID 0x00000001
3458 #define CERT_CREATE_SELFSIGN_NO_SIGN 1
3459 #define CERT_CREATE_SELFSIGN_NO_KEY_INFO 2
3461 /* flags for CryptAcquireCertificatePrivateKey */
3462 #define CRYPT_ACQUIRE_CACHE_FLAG 0x00000001
3463 #define CRYPT_ACQUIRE_USE_PROV_INFO_FLAG 0x00000002
3464 #define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
3465 #define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040
3467 /* flags for CryptFindCertificateKeyProvInfo */
3468 #define CRYPT_FIND_USER_KEYSET_FLAG 0x00000001
3469 #define CRYPT_FIND_MACHINE_KEYSET_FLAG 0x00000002
3470 #define CRYPT_FIND_SILENT_KEYSET_FLAG 0x00000040
3472 /* Chain engines and chains */
3473 typedef HANDLE HCERTCHAINENGINE;
3474 #define HCCE_CURRENT_USER ((HCERTCHAINENGINE)NULL)
3475 #define HCCE_LOCAL_MACHINE ((HCERTCHAINENGINE)1)
3477 #define CERT_CHAIN_CACHE_END_CERT 0x00000001
3478 #define CERT_CHAIN_THREAD_STORE_SYNC 0x00000002
3479 #define CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL 0x00000004
3480 #define CERT_CHAIN_USE_LOCAL_MACHINE_STORE 0x00000008
3481 #define CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE 0x00000010
3482 #define CERT_CHAIN_ENABLE_SHARE_STORE 0x00000020
3484 typedef struct _CERT_CHAIN_ENGINE_CONFIG
3486 DWORD cbSize;
3487 HCERTSTORE hRestrictedRoot;
3488 HCERTSTORE hRestrictedTrust;
3489 HCERTSTORE hRestrictedOther;
3490 DWORD cAdditionalStore;
3491 HCERTSTORE *rghAdditionalStore;
3492 DWORD dwFlags;
3493 DWORD dwUrlRetrievalTimeout;
3494 DWORD MaximumCachedCertificates;
3495 DWORD CycleDetectionModulus;
3496 HCERTSTORE hExclusiveRoot;
3497 HCERTSTORE hExclusiveRootTrustedPeople;
3498 } CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
3500 /* message-related definitions */
3502 typedef BOOL (WINAPI *PFN_CMSG_STREAM_OUTPUT)(const void *pvArg, BYTE *pbData,
3503 DWORD cbData, BOOL fFinal);
3505 #define CMSG_INDEFINITE_LENGTH 0xffffffff
3507 typedef struct _CMSG_STREAM_INFO
3509 DWORD cbContent;
3510 PFN_CMSG_STREAM_OUTPUT pfnStreamOutput;
3511 void *pvArg;
3512 } CMSG_STREAM_INFO, *PCMSG_STREAM_INFO;
3514 typedef struct _CERT_ISSUER_SERIAL_NUMBER
3516 CERT_NAME_BLOB Issuer;
3517 CRYPT_INTEGER_BLOB SerialNumber;
3518 } CERT_ISSUER_SERIAL_NUMBER, *PCERT_ISSUER_SERIAL_NUMBER;
3520 typedef struct _CERT_ID
3522 DWORD dwIdChoice;
3523 union {
3524 CERT_ISSUER_SERIAL_NUMBER IssuerSerialNumber;
3525 CRYPT_HASH_BLOB KeyId;
3526 CRYPT_HASH_BLOB HashId;
3527 } DUMMYUNIONNAME;
3528 } CERT_ID, *PCERT_ID;
3530 #define CERT_ID_ISSUER_SERIAL_NUMBER 1
3531 #define CERT_ID_KEY_IDENTIFIER 2
3532 #define CERT_ID_SHA1_HASH 3
3534 #ifndef USE_WC_PREFIX
3535 #undef CMSG_DATA /* may be defined by sys/socket.h */
3536 #define CMSG_DATA 1
3537 #define CMSG_SIGNED 2
3538 #define CMSG_ENVELOPED 3
3539 #define CMSG_SIGNED_AND_ENVELOPED 4
3540 #define CMSG_HASHED 5
3541 #define CMSG_ENCRYPTED 6
3543 #define CMSG_ALL_FLAGS ~0U
3544 #define CMSG_DATA_FLAG (1 << CMSG_DATA)
3545 #define CMSG_SIGNED_FLAG (1 << CMSG_SIGNED)
3546 #define CMSG_ENVELOPED_FLAG (1 << CMSG_ENVELOPED)
3547 #define CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << CMSG_SIGNED_AND_ENVELOPED)
3548 #define CMSG_ENCRYPTED_FLAG (1 << CMSG_ENCRYPTED)
3549 #else
3550 #define WC_CMSG_DATA 1
3551 #define WC_CMSG_SIGNED 2
3552 #define WC_CMSG_ENVELOPED 3
3553 #define WC_CMSG_SIGNED_AND_ENVELOPED 4
3554 #define WC_CMSG_HASHED 5
3555 #define WC_CMSG_ENCRYPTED 6
3557 #define WC_CMSG_ALL_FLAGS ~0U
3558 #define WC_CMSG_DATA_FLAG (1 << WC_CMSG_DATA)
3559 #define WC_CMSG_SIGNED_FLAG (1 << WC_CMSG_SIGNED)
3560 #define WC_CMSG_ENVELOPED_FLAG (1 << WC_CMSG_ENVELOPED)
3561 #define WC_CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << WC_CMSG_SIGNED_AND_ENVELOPED)
3562 #define WC_CMSG_ENCRYPTED_FLAG (1 << WC_CMSG_ENCRYPTED)
3563 #endif
3565 typedef struct _CMSG_SIGNER_ENCODE_INFO
3567 DWORD cbSize;
3568 PCERT_INFO pCertInfo;
3569 HCRYPTPROV hCryptProv;
3570 DWORD dwKeySpec;
3571 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3572 void *pvHashAuxInfo;
3573 DWORD cAuthAttr;
3574 PCRYPT_ATTRIBUTE rgAuthAttr;
3575 DWORD cUnauthAttr;
3576 PCRYPT_ATTRIBUTE rgUnauthAttr;
3577 #ifdef CMSG_SIGNER_ENCODE_INFO_HAS_CMS_FIELDS
3578 CERT_ID SignerId;
3579 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
3580 void *pvHashEncryptionAuxInfo;
3581 #endif
3582 } CMSG_SIGNER_ENCODE_INFO, *PCMSG_SIGNER_ENCODE_INFO;
3584 typedef struct _CMSG_SIGNED_ENCODE_INFO
3586 DWORD cbSize;
3587 DWORD cSigners;
3588 PCMSG_SIGNER_ENCODE_INFO rgSigners;
3589 DWORD cCertEncoded;
3590 PCERT_BLOB rgCertEncoded;
3591 DWORD cCrlEncoded;
3592 PCRL_BLOB rgCrlEncoded;
3593 #ifdef CMSG_SIGNED_ENCODE_INFO_HAS_CMS_FIELDS
3594 DWORD cAttrCertEncoded;
3595 PCERT_BLOB rgAttrCertEncoded;
3596 #endif
3597 } CMSG_SIGNED_ENCODE_INFO, *PCMSG_SIGNED_ENCODE_INFO;
3599 typedef struct _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO
3601 DWORD cbSize;
3602 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3603 void *pvKeyEncryptionAuxInfo;
3604 HCRYPTPROV_LEGACY hCryptProv;
3605 CRYPT_BIT_BLOB RecipientPublicKey;
3606 CERT_ID RecipientId;
3607 } CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO;
3609 typedef struct _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO
3611 DWORD cbSize;
3612 CRYPT_BIT_BLOB RecipientPublicKey;
3613 CERT_ID RecipientId;
3614 FILETIME Date;
3615 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3616 } CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO,
3617 *PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO;
3619 typedef struct _CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO
3621 DWORD cbSize;
3622 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3623 void *pvKeyEncryptionAuxInfo;
3624 CRYPT_ALGORITHM_IDENTIFIER KeyWrapAlgorithm;
3625 void *pvKeyWrapAuxInfo;
3626 HCRYPTPROV_LEGACY hCryptProv;
3627 DWORD dwKeySpec;
3628 DWORD dwKeyChoice;
3629 union {
3630 PCRYPT_ALGORITHM_IDENTIFIER pEphemeralAlgorithm;
3631 PCERT_ID pSenderId;
3632 } DUMMYUNIONNAME;
3633 CRYPT_DATA_BLOB UserKeyingMaterial;
3634 DWORD cRecipientEncryptedKeys;
3635 PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO *rgpRecipientEncryptedKeys;
3636 } CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO;
3638 #define CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE 1
3639 #define CMSG_KEY_AGREE_STATIC_KEY_CHOICE 2
3641 typedef struct _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO
3643 DWORD cbSize;
3644 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3645 void *pvKeyEncryptionAuxInfo;
3646 HCRYPTPROV hCryptProv;
3647 DWORD dwKeyChoice;
3648 union {
3649 HCRYPTKEY hKeyEncryptionKey;
3650 void *pvKeyEncryptionKey;
3651 } DUMMYUNIONNAME;
3652 CRYPT_DATA_BLOB KeyId;
3653 FILETIME Date;
3654 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3655 } CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, *PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO;
3657 #define CMSG_MAIL_LIST_HANDLE_KEY_CHOICE 1
3659 typedef struct _CMSG_RECIPIENT_ENCODE_INFO
3661 DWORD dwRecipientChoice;
3662 union {
3663 PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTrans;
3664 PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO pKeyAgree;
3665 PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO pMailList;
3666 } DUMMYUNIONNAME;
3667 } CMSG_RECIPIENT_ENCODE_INFO, *PCMSG_RECIPIENT_ENCODE_INFO;
3669 #define CMSG_KEY_TRANS_RECIPIENT 1
3670 #define CMSG_KEY_AGREE_RECIPIENT 2
3671 #define CMSG_MAIL_LIST_RECIPIENT 3
3673 typedef struct _CMSG_ENVELOPED_ENCODE_INFO
3675 DWORD cbSize;
3676 HCRYPTPROV_LEGACY hCryptProv;
3677 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3678 void *pvEncryptionAuxInfo;
3679 DWORD cRecipients;
3680 PCERT_INFO *rgpRecipientCert;
3681 #ifdef CMSG_ENVELOPED_ENCODE_INFO_HAS_CMS_FIELDS
3682 PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients;
3683 DWORD cCertEncoded;
3684 PCERT_BLOB rgCertEncoded;
3685 DWORD cCrlEncoded;
3686 PCRL_BLOB rgCrlEncoded;
3687 DWORD cAttrCertEncoded;
3688 PCERT_BLOB rgAttrCertEncoded;
3689 DWORD cUnprotectedAttr;
3690 PCRYPT_ATTRIBUTE rgUnprotectedAttr;
3691 #endif
3692 } CMSG_ENVELOPED_ENCODE_INFO, *PCMSG_ENVELOPED_ENCODE_INFO;
3694 typedef struct _CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO
3696 DWORD cbSize;
3697 CMSG_SIGNED_ENCODE_INFO SignedInfo;
3698 CMSG_ENVELOPED_ENCODE_INFO EnvelopedInfo;
3699 } CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO,
3700 *PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO;
3702 typedef struct _CMSG_HASHED_ENCODE_INFO
3704 DWORD cbSize;
3705 HCRYPTPROV_LEGACY hCryptProv;
3706 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3707 void *pvHashAuxInfo;
3708 } CMSG_HASHED_ENCODE_INFO, *PCMSG_HASHED_ENCODE_INFO;
3710 typedef struct _CMSG_ENCRYPTED_ENCODE_INFO
3712 DWORD cbSize;
3713 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3714 void *pvEncryptionAuxInfo;
3715 } CMSG_ENCRYPTED_ENCODE_INFO, *PCMSG_ENCRYPTED_ENCODE_INFO;
3717 #define CMSG_BARE_CONTENT_FLAG 0x00000001
3718 #define CMSG_LENGTH_ONLY_FLAG 0x00000002
3719 #define CMSG_DETACHED_FLAG 0x00000004
3720 #define CMSG_AUTHENTICATED_ATTRIBUTES_FLAG 0x00000008
3721 #define CMSG_CONTENTS_OCTETS_FLAG 0x00000010
3722 #define CMSG_MAX_LENGTH_FLAG 0x00000020
3723 #define CMSG_CMS_ENCAPSULATED_CONTENT_FLAG 0x00000040
3724 #define CMSG_CRYPT_RELEASE_CONTEXT_FLAG 0x00008000
3726 #define CMSG_CTRL_VERIFY_SIGNATURE 1
3727 #define CMSG_CTRL_DECRYPT 2
3728 #define CMSG_CTRL_VERIFY_HASH 5
3729 #define CMSG_CTRL_ADD_SIGNER 6
3730 #define CMSG_CTRL_DEL_SIGNER 7
3731 #define CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR 8
3732 #define CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR 9
3733 #define CMSG_CTRL_ADD_CERT 10
3734 #define CMSG_CTRL_DEL_CERT 11
3735 #define CMSG_CTRL_ADD_CRL 12
3736 #define CMSG_CTRL_DEL_CRL 13
3737 #define CMSG_CTRL_ADD_ATTR_CERT 14
3738 #define CMSG_CTRL_DEL_ATTR_CERT 15
3739 #define CMSG_CTRL_KEY_TRANS_DECRYPT 16
3740 #define CMSG_CTRL_KEY_AGREE_DECRYPT 17
3741 #define CMSG_CTRL_MAIL_LIST_DECRYPT 18
3742 #define CMSG_CTRL_VERIFY_SIGNATURE_EX 19
3743 #define CMSG_CTRL_ADD_CMS_SIGNER_INFO 20
3745 typedef struct _CMSG_CTRL_DECRYPT_PARA
3747 DWORD cbSize;
3748 HCRYPTPROV hCryptProv;
3749 DWORD dwKeySpec;
3750 DWORD dwRecipientIndex;
3751 } CMSG_CTRL_DECRYPT_PARA, *PCMSG_CTRL_DECRYPT_PARA;
3753 typedef struct _CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA
3755 DWORD cbSize;
3756 DWORD dwSignerIndex;
3757 CRYPT_DATA_BLOB blob;
3758 } CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA,
3759 *PCMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA;
3761 typedef struct _CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA
3763 DWORD cbSize;
3764 DWORD dwSignerIndex;
3765 DWORD dwUnauthAttrIndex;
3766 } CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA,
3767 *PCMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA;
3769 typedef struct _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA {
3770 DWORD cbSize;
3771 HCRYPTPROV hCryptProv;
3772 DWORD dwSignerIndex;
3773 DWORD dwSignerType;
3774 void *pvSigner;
3775 } CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA, *PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA;
3777 #define CMSG_VERIFY_SIGNER_PUBKEY 1
3778 #define CMSG_VERIFY_SIGNER_CERT 2
3779 #define CMSG_VERIFY_SIGNER_CHAIN 3
3780 #define CMSG_VERIFY_SIGNER_NULL 4
3782 #define CMSG_TYPE_PARAM 1
3783 #define CMSG_CONTENT_PARAM 2
3784 #define CMSG_BARE_CONTENT_PARAM 3
3785 #define CMSG_INNER_CONTENT_TYPE_PARAM 4
3786 #define CMSG_SIGNER_COUNT_PARAM 5
3787 #define CMSG_SIGNER_INFO_PARAM 6
3788 #define CMSG_SIGNER_CERT_INFO_PARAM 7
3789 #define CMSG_SIGNER_HASH_ALGORITHM_PARAM 8
3790 #define CMSG_SIGNER_AUTH_ATTR_PARAM 9
3791 #define CMSG_SIGNER_UNAUTH_ATTR_PARAM 10
3792 #define CMSG_CERT_COUNT_PARAM 11
3793 #define CMSG_CERT_PARAM 12
3794 #define CMSG_CRL_COUNT_PARAM 13
3795 #define CMSG_CRL_PARAM 14
3796 #define CMSG_ENVELOPE_ALGORITHM_PARAM 15
3797 #define CMSG_RECIPIENT_COUNT_PARAM 17
3798 #define CMSG_RECIPIENT_INDEX_PARAM 18
3799 #define CMSG_RECIPIENT_INFO_PARAM 19
3800 #define CMSG_HASH_ALGORITHM_PARAM 20
3801 #define CMSG_HASH_DATA_PARAM 21
3802 #define CMSG_COMPUTED_HASH_PARAM 22
3803 #define CMSG_ENCRYPT_PARAM 26
3804 #define CMSG_ENCRYPTED_DIGEST 27
3805 #define CMSG_ENCODED_SIGNER 28
3806 #define CMSG_ENCODED_MESSAGE 29
3807 #define CMSG_VERSION_PARAM 30
3808 #define CMSG_ATTR_CERT_COUNT_PARAM 31
3809 #define CMSG_ATTR_CERT_PARAM 32
3810 #define CMSG_CMS_RECIPIENT_COUNT_PARAM 33
3811 #define CMSG_CMS_RECIPIENT_INDEX_PARAM 34
3812 #define CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM 35
3813 #define CMSG_CMS_RECIPIENT_INFO_PARAM 36
3814 #define CMSG_UNPROTECTED_ATTR_PARAM 37
3815 #define CMSG_SIGNER_CERT_ID_PARAM 38
3816 #define CMSG_CMS_SIGNER_INFO_PARAM 39
3818 typedef struct _CMSG_CMS_SIGNER_INFO {
3819 DWORD dwVersion;
3820 CERT_ID SignerId;
3821 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3822 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
3823 CRYPT_DATA_BLOB EncryptedHash;
3824 CRYPT_ATTRIBUTES AuthAttrs;
3825 CRYPT_ATTRIBUTES UnauthAttrs;
3826 } CMSG_CMS_SIGNER_INFO, *PCMSG_CMS_SIGNER_INFO;
3828 typedef CRYPT_ATTRIBUTES CMSG_ATTR, *PCMSG_ATTR;
3830 #define CMSG_SIGNED_DATA_V1 1
3831 #define CMSG_SIGNED_DATA_V3 3
3832 #define CMSG_SIGNED_DATA_PKCS_1_5_VERSION CMSG_SIGNED_DATA_V1
3833 #define CMSG_SIGNED_DATA_CMS_VERSION CMSG_SIGNED_DATA_V3
3835 #define CMSG_SIGNER_INFO_V1 1
3836 #define CMSG_SIGNER_INFO_V3 3
3837 #define CMSG_SIGNER_INFO_PKCS_1_5_VERSION CMSG_SIGNER_INFO_V1
3838 #define CMSG_SIGNER_INFO_CMS_VERSION CMSG_SIGNER_INFO_V3
3840 #define CMSG_HASHED_DATA_V0 0
3841 #define CMSG_HASHED_DATA_V2 2
3842 #define CMSG_HASHED_DATA_PKCS_1_5_VERSION CMSG_HASHED_DATA_V0
3843 #define CMSG_HASHED_DATA_CMS_VERSION CMSG_HASHED_DATA_V2
3845 #define CMSG_ENVELOPED_DATA_V0 0
3846 #define CMSG_ENVELOPED_DATA_V2 2
3847 #define CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION CMSG_ENVELOPED_DATA_V0
3848 #define CMSG_ENVELOPED_DATA_CMS_VERSION CMSG_ENVELOPED_DATA_V2
3850 typedef struct _CMSG_KEY_TRANS_RECIPIENT_INFO {
3851 DWORD dwVersion;
3852 CERT_ID RecipientId;
3853 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3854 CRYPT_DATA_BLOB EncryptedKey;
3855 } CMSG_KEY_TRANS_RECIPIENT_INFO, *PCMSG_KEY_TRANS_RECIPIENT_INFO;
3857 typedef struct _CMSG_RECIPIENT_ENCRYPTED_KEY_INFO {
3858 CERT_ID RecipientId;
3859 CRYPT_DATA_BLOB EncryptedKey;
3860 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3861 } CMSG_RECIPIENT_ENCRYPTED_KEY_INFO, *PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO;
3863 typedef struct _CMSG_KEY_AGREE_RECIPIENT_INFO {
3864 DWORD dwVersion;
3865 DWORD dwOriginatorChoice;
3866 union {
3867 CERT_ID OriginatorCertId;
3868 CERT_PUBLIC_KEY_INFO OriginatorPublicKeyInfo;
3869 } DUMMYUNIONNAME;
3870 CRYPT_ALGORITHM_IDENTIFIER UserKeyingMaterial;
3871 DWORD cRecipientEncryptedKeys;
3872 PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO *rgpRecipientEncryptedKeys;
3873 } CMSG_KEY_AGREE_RECIPIENT_INFO, *PCMSG_KEY_AGREE_RECIPIENT_INFO;
3875 #define CMSG_KEY_AGREE_ORIGINATOR_CERT 1
3876 #define CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY 2
3878 typedef struct _CMSG_MAIL_LIST_RECIPIENT_INFO {
3879 DWORD dwVersion;
3880 CRYPT_DATA_BLOB KeyId;
3881 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3882 CRYPT_DATA_BLOB EncryptedKey;
3883 FILETIME Date;
3884 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3885 } CMSG_MAIL_LIST_RECIPIENT_INFO, *PCMSG_MAIL_LIST_RECIPIENT_INFO;
3887 typedef struct _CMSG_CMS_RECIPIENT_INFO {
3888 DWORD dwRecipientChoice;
3889 union {
3890 PCMSG_KEY_TRANS_RECIPIENT_INFO pKeyTrans;
3891 PCMSG_KEY_AGREE_RECIPIENT_INFO pKeyAgree;
3892 PCMSG_MAIL_LIST_RECIPIENT_INFO pMailList;
3893 } DUMMYUNIONNAME;
3894 } CMSG_CMS_RECIPIENT_INFO, *PCMSG_CMS_RECIPIENT_INFO;
3896 #define CMSG_ENVELOPED_RECIPIENT_V0 0
3897 #define CMSG_ENVELOPED_RECIPIENT_V2 2
3898 #define CMSG_ENVELOPED_RECIPIENT_V3 3
3899 #define CMSG_ENVELOPED_RECIPIENT_V4 4
3900 #define CMSG_KEY_TRANS_PKCS_1_5_VERSION CMSG_ENVELOPED_RECIPIENT_V0
3901 #define CMSG_KEY_TRANS_CMS_VERSION CMSG_ENVELOPED_RECIPIENT_V2
3902 #define CMSG_KEY_AGREE_VERSION CMSG_ENVELOPED_RECIPIENT_V3
3903 #define CMSG_MAIL_LIST_VERSION CMSG_ENVELOPED_RECIPIENT_V4
3905 typedef void * (WINAPI *PFN_CMSG_ALLOC)(size_t cb);
3906 typedef void (WINAPI *PFN_CMSG_FREE)(void *pv);
3908 typedef struct _CMSG_CONTENT_ENCRYPT_INFO {
3909 DWORD cbSize;
3910 HCRYPTPROV hCryptProv;
3911 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3912 void *pvEncryptionAuxInfo;
3913 DWORD cRecipients;
3914 PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients;
3915 PFN_CMSG_ALLOC pfnAlloc;
3916 PFN_CMSG_FREE pfnFree;
3917 DWORD dwEncryptFlags;
3918 HCRYPTKEY hContentEncryptKey;
3919 DWORD dwFlags;
3920 } CMSG_CONTENT_ENCRYPT_INFO, *PCMSG_CONTENT_ENCRYPT_INFO;
3922 typedef struct _CMSG_KEY_TRANS_ENCRYPT_INFO {
3923 DWORD cbSize;
3924 DWORD dwRecipientIndex;
3925 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3926 CRYPT_DATA_BLOB EncryptedKey;
3927 DWORD dwFlags;
3928 } CMSG_KEY_TRANS_ENCRYPT_INFO, *PCMSG_KEY_TRANS_ENCRYPT_INFO;
3930 typedef struct _CMSG_CTRL_KEY_TRANS_DECRYPT_PARA {
3931 DWORD cbSize;
3932 HCRYPTPROV hCryptProv;
3933 DWORD dwKeySpec;
3934 PCMSG_KEY_TRANS_RECIPIENT_INFO pKeyTrans;
3935 DWORD dwRecipientIndex;
3936 } CMSG_CTRL_KEY_TRANS_DECRYPT_PARA, *PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA;
3938 typedef struct _CERT_STRONG_SIGN_SERIALIZED_INFO {
3939 DWORD dwFlags;
3940 WCHAR *pwszCNGSignHashAlgids;
3941 WCHAR *pwszCNGPubKeyMinBitLengths;
3942 } CERT_STRONG_SIGN_SERIALIZED_INFO, *PCERT_STRONG_SIGN_SERIALIZED_INFO;
3944 typedef struct _CERT_STRONG_SIGN_PARA {
3945 DWORD cbSize;
3946 DWORD dwInfoChoice;
3947 union {
3948 void *pvInfo;
3949 CERT_STRONG_SIGN_SERIALIZED_INFO *pSerializedInfo;
3950 char *pszOID;
3951 } DUMMYUNIONNAME;
3952 } CERT_STRONG_SIGN_PARA, *PCERT_STRONG_SIGN_PARA;
3954 #define CERT_STRONG_SIGN_SERIALIZED_INFO_CHOICE 1
3955 #define CERT_STRONG_SIGN_OID_INFO_CHOICE 2
3957 #define CERT_STRONG_SIGN_ENABLE_CRL_CHECK 0x1
3958 #define CERT_STRONG_SIGN_ENABLE_OCSP_CHECK 0x2
3960 typedef BOOL (WINAPI *PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY)(
3961 PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo, DWORD dwFlags,
3962 void *pvReserved);
3964 typedef BOOL (WINAPI *PFN_CMSG_EXPORT_KEY_TRANS)(
3965 PCMSG_CONTENT_ENCRYPT_INFO pContentEncryptInfo,
3966 PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTransEncodeInfo,
3967 PCMSG_KEY_TRANS_ENCRYPT_INFO pKeyTransEncryptInfo,
3968 DWORD dwFlags, void *pvReserved);
3970 typedef BOOL (WINAPI *PFN_CMSG_IMPORT_KEY_TRANS)(
3971 PCRYPT_ALGORITHM_IDENTIFIER pContentEncryptionAlgorithm,
3972 PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA pKeyTransDecryptPara, DWORD dwFlags,
3973 void *pvReserved, HCRYPTKEY *phContentEncryptKey);
3975 /* CryptMsgGetAndVerifySigner flags */
3976 #define CMSG_TRUSTED_SIGNER_FLAG 0x1
3977 #define CMSG_SIGNER_ONLY_FLAG 0x2
3978 #define CMSG_USE_SIGNER_INDEX_FLAG 0x4
3980 /* CryptMsgSignCTL flags */
3981 #define CMSG_CMS_ENCAPSULATED_CTL_FLAG 0x00008000
3983 /* CryptMsgEncodeAndSignCTL flags */
3984 #define CMSG_ENCODED_SORTED_CTL_FLAG 0x1
3985 #define CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x2
3987 /* PFXImportCertStore flags */
3988 #define CRYPT_USER_KEYSET 0x00001000
3989 #define PKCS12_IMPORT_SILENT 0x00000040
3990 #define PKCS12_PREFER_CNG_KSP 0x00000100
3991 #define PKCS12_ALWAYS_CNG_KSP 0x00000200
3992 #define PKCS12_ONLY_CERTIFICATES 0x00000400
3993 #define PKCS12_ONLY_NOT_ENCRYPTED_CERTIFICATES 0x00000800
3994 #define PKCS12_ALLOW_OVERWRITE_KEY 0x00004000
3995 #define PKCS12_NO_PERSIST_KEY 0x00008000
3996 #define PKCS12_VIRTUAL_ISOLATION_KEY 0x00010000
3997 #define PKCS12_IMPORT_RESERVED_MASK 0xffff0000
3998 /* PFXExportCertStore flags */
3999 #define REPORT_NO_PRIVATE_KEY 0x00000001
4000 #define REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY 0x00000002
4001 #define EXPORT_PRIVATE_KEYS 0x00000004
4002 #define PKCS12_EXPORT_RESERVED_MASK 0xffff0000
4004 #define CRYPT_USERDATA 0x00000001
4006 /* function declarations */
4007 /* advapi32.dll */
4008 WINADVAPI BOOL WINAPI CryptAcquireContextA(HCRYPTPROV *, LPCSTR, LPCSTR, DWORD, DWORD);
4009 WINADVAPI BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *, LPCWSTR, LPCWSTR, DWORD, DWORD);
4010 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
4011 WINADVAPI BOOL WINAPI CryptGenRandom (HCRYPTPROV, DWORD, BYTE *);
4012 WINADVAPI BOOL WINAPI CryptContextAddRef (HCRYPTPROV, DWORD *, DWORD);
4013 WINADVAPI BOOL WINAPI CryptCreateHash (HCRYPTPROV, ALG_ID, HCRYPTKEY, DWORD, HCRYPTHASH *);
4014 WINADVAPI BOOL WINAPI CryptDecrypt (HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *);
4015 WINADVAPI BOOL WINAPI CryptDeriveKey (HCRYPTPROV, ALG_ID, HCRYPTHASH, DWORD, HCRYPTKEY *);
4016 WINADVAPI BOOL WINAPI CryptDestroyHash (HCRYPTHASH);
4017 WINADVAPI BOOL WINAPI CryptDestroyKey (HCRYPTKEY);
4018 WINADVAPI BOOL WINAPI CryptDuplicateKey (HCRYPTKEY, DWORD *, DWORD, HCRYPTKEY *);
4019 WINADVAPI BOOL WINAPI CryptDuplicateHash (HCRYPTHASH, DWORD *, DWORD, HCRYPTHASH *);
4020 WINADVAPI BOOL WINAPI CryptEncrypt (HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *, DWORD);
4021 WINADVAPI BOOL WINAPI CryptEnumProvidersA (DWORD, DWORD *, DWORD, DWORD *, LPSTR, DWORD *);
4022 WINADVAPI BOOL WINAPI CryptEnumProvidersW (DWORD, DWORD *, DWORD, DWORD *, LPWSTR, DWORD *);
4023 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
4024 WINADVAPI BOOL WINAPI CryptEnumProviderTypesA (DWORD, DWORD *, DWORD, DWORD *, LPSTR, DWORD *);
4025 WINADVAPI BOOL WINAPI CryptEnumProviderTypesW (DWORD, DWORD *, DWORD, DWORD *, LPWSTR, DWORD *);
4026 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
4027 WINADVAPI BOOL WINAPI CryptExportKey (HCRYPTKEY, HCRYPTKEY, DWORD, DWORD, BYTE *, DWORD *);
4028 WINADVAPI BOOL WINAPI CryptGenKey (HCRYPTPROV, ALG_ID, DWORD, HCRYPTKEY *);
4029 WINADVAPI BOOL WINAPI CryptGetKeyParam (HCRYPTKEY, DWORD, BYTE *, DWORD *, DWORD);
4030 WINADVAPI BOOL WINAPI CryptGetHashParam (HCRYPTHASH, DWORD, BYTE *, DWORD *, DWORD);
4031 WINADVAPI BOOL WINAPI CryptGetProvParam (HCRYPTPROV, DWORD, BYTE *, DWORD *, DWORD);
4032 WINADVAPI BOOL WINAPI CryptGetDefaultProviderA (DWORD, DWORD *, DWORD, LPSTR, DWORD *);
4033 WINADVAPI BOOL WINAPI CryptGetDefaultProviderW (DWORD, DWORD *, DWORD, LPWSTR, DWORD *);
4034 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
4035 WINADVAPI BOOL WINAPI CryptGetUserKey (HCRYPTPROV, DWORD, HCRYPTKEY *);
4036 WINADVAPI BOOL WINAPI CryptHashData (HCRYPTHASH, const BYTE *, DWORD, DWORD);
4037 WINADVAPI BOOL WINAPI CryptHashSessionKey (HCRYPTHASH, HCRYPTKEY, DWORD);
4038 WINADVAPI BOOL WINAPI CryptImportKey (HCRYPTPROV, const BYTE *, DWORD, HCRYPTKEY, DWORD, HCRYPTKEY *);
4039 WINADVAPI BOOL WINAPI CryptReleaseContext (HCRYPTPROV, DWORD);
4040 WINADVAPI BOOL WINAPI CryptSetHashParam (HCRYPTHASH, DWORD, const BYTE *, DWORD);
4041 WINADVAPI BOOL WINAPI CryptSetKeyParam (HCRYPTKEY, DWORD, const BYTE *, DWORD);
4042 WINADVAPI BOOL WINAPI CryptSetProviderA (LPCSTR, DWORD);
4043 WINADVAPI BOOL WINAPI CryptSetProviderW (LPCWSTR, DWORD);
4044 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
4045 WINADVAPI BOOL WINAPI CryptSetProviderExA (LPCSTR, DWORD, DWORD *, DWORD);
4046 WINADVAPI BOOL WINAPI CryptSetProviderExW (LPCWSTR, DWORD, DWORD *, DWORD);
4047 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
4048 WINADVAPI BOOL WINAPI CryptSetProvParam (HCRYPTPROV, DWORD, const BYTE *, DWORD);
4049 WINADVAPI BOOL WINAPI CryptSignHashA (HCRYPTHASH, DWORD, LPCSTR, DWORD, BYTE *, DWORD *);
4050 WINADVAPI BOOL WINAPI CryptSignHashW (HCRYPTHASH, DWORD, LPCWSTR, DWORD, BYTE *, DWORD *);
4051 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
4052 WINADVAPI BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH, const BYTE *, DWORD, HCRYPTKEY, LPCSTR, DWORD);
4053 WINADVAPI BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH, const BYTE *, DWORD, HCRYPTKEY, LPCWSTR, DWORD);
4054 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
4056 /* crypt32.dll functions */
4057 WINCRYPT32API VOID WINAPI CryptMemFree(LPVOID pv);
4058 WINCRYPT32API LPVOID WINAPI CryptMemAlloc(ULONG cbSize) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(CryptMemFree) __WINE_MALLOC;
4059 WINCRYPT32API LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(CryptMemFree);
4061 WINCRYPT32API BOOL WINAPI CryptBinaryToStringA(const BYTE *pbBinary,
4062 DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD *pcchString);
4063 WINCRYPT32API BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary,
4064 DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD *pcchString);
4065 #define CryptBinaryToString WINELIB_NAME_AW(CryptBinaryToString)
4067 WINCRYPT32API BOOL WINAPI CryptStringToBinaryA(LPCSTR pszString,
4068 DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
4069 DWORD *pdwSkip, DWORD *pdwFlags);
4070 WINCRYPT32API BOOL WINAPI CryptStringToBinaryW(LPCWSTR pszString,
4071 DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
4072 DWORD *pdwSkip, DWORD *pdwFlags);
4073 #define CryptStringToBinary WINELIB_NAME_AW(CryptStringToBinary)
4075 WINCRYPT32API BOOL WINAPI CryptCreateAsyncHandle(DWORD dwFlags, PHCRYPTASYNC phAsync);
4076 WINCRYPT32API BOOL WINAPI CryptSetAsyncParam(HCRYPTASYNC hAsync, LPSTR pszParamOid,
4077 LPVOID pvParam, PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree);
4078 WINCRYPT32API BOOL WINAPI CryptGetAsyncParam(HCRYPTASYNC hAsync, LPSTR pszParamOid,
4079 LPVOID *ppvParam, PFN_CRYPT_ASYNC_PARAM_FREE_FUNC *ppfnFree);
4080 WINCRYPT32API BOOL WINAPI CryptCloseAsyncHandle(HCRYPTASYNC hAsync);
4082 WINCRYPT32API BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD,LPCSTR,DWORD,LPCWSTR);
4083 WINCRYPT32API BOOL WINAPI CryptRegisterOIDFunction(DWORD,LPCSTR,LPCSTR,LPCWSTR,LPCSTR);
4084 WINCRYPT32API BOOL WINAPI CryptGetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
4085 LPCSTR pszOID, LPCWSTR szValueName, DWORD *pdwValueType,
4086 BYTE *pbValueData, DWORD *pcbValueData);
4087 WINCRYPT32API BOOL WINAPI CryptSetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
4088 LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType,
4089 const BYTE *pbValueData, DWORD cbValueData);
4090 WINCRYPT32API BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD,LPCSTR,LPCWSTR);
4091 WINCRYPT32API BOOL WINAPI CryptUnregisterOIDFunction(DWORD,LPCSTR,LPCSTR);
4092 WINCRYPT32API BOOL WINAPI CryptEnumOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName,
4093 LPCSTR pszOID, DWORD dwFlags, void *pvArg,
4094 PFN_CRYPT_ENUM_OID_FUNC pfnEnumOIDFunc);
4095 WINCRYPT32API HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR,DWORD);
4096 WINCRYPT32API BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet,
4097 DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList);
4098 WINCRYPT32API BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
4099 DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr,
4100 HCRYPTOIDFUNCADDR *phFuncAddr);
4101 WINCRYPT32API BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
4102 DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr,
4103 HCRYPTOIDFUNCADDR *phFuncAddr);
4104 WINCRYPT32API BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr,
4105 DWORD dwFlags);
4106 WINCRYPT32API BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule,
4107 DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry,
4108 const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags);
4109 WINCRYPT32API BOOL WINAPI CryptInstallDefaultContext(HCRYPTPROV hCryptProv,
4110 DWORD dwDefaultType, const void *pvDefaultPara, DWORD dwFlags,
4111 void *pvReserved, HCRYPTDEFAULTCONTEXT *phDefaultContext);
4112 WINCRYPT32API BOOL WINAPI CryptUninstallDefaultContext(HCRYPTDEFAULTCONTEXT hDefaultContext,
4113 DWORD dwFlags, void *pvReserved);
4115 WINCRYPT32API BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg,
4116 PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo);
4117 WINCRYPT32API PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
4118 DWORD dwGroupId);
4119 WINCRYPT32API BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO pInfo, DWORD dwFlags);
4120 WINCRYPT32API BOOL WINAPI CryptUnregisterOIDInfo(PCCRYPT_OID_INFO pInfo);
4122 WINCRYPT32API LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName);
4124 WINCRYPT32API LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId);
4125 WINCRYPT32API DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId);
4127 /* cert store functions */
4128 WINCRYPT32API HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType,
4129 HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara);
4131 WINCRYPT32API HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv,
4132 LPCSTR szSubSystemProtocol);
4133 WINCRYPT32API HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv,
4134 LPCWSTR szSubSystemProtocol);
4135 #define CertOpenSystemStore WINELIB_NAME_AW(CertOpenSystemStore)
4137 WINCRYPT32API PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore,
4138 PCCERT_CONTEXT pPrev);
4140 WINCRYPT32API PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore,
4141 PCCRL_CONTEXT pPrev);
4143 WINCRYPT32API PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore,
4144 PCCTL_CONTEXT pPrev);
4146 WINCRYPT32API BOOL WINAPI CertEnumSystemStoreLocation(DWORD dwFlags, void *pvArg,
4147 PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum);
4149 WINCRYPT32API BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara,
4150 void *pvArg, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum);
4152 WINCRYPT32API BOOL WINAPI CertRegisterSystemStore(const void *store, DWORD flags,
4153 CERT_SYSTEM_STORE_INFO *info, void *reserved);
4155 WINCRYPT32API BOOL WINAPI CertUnregisterSystemStore(const void *store, DWORD flags);
4157 WINCRYPT32API BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
4158 void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum);
4160 WINCRYPT32API BOOL WINAPI CertRegisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
4161 LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, void *pvReserved);
4163 WINCRYPT32API BOOL WINAPI CertUnregisterPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
4164 LPCWSTR pwszStoreName);
4166 WINCRYPT32API BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
4167 DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags);
4169 WINCRYPT32API BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore,
4170 HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority);
4172 WINCRYPT32API void WINAPI CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore,
4173 HCERTSTORE hSiblingStore);
4175 WINCRYPT32API BOOL WINAPI CertCreateCertificateChainEngine(PCERT_CHAIN_ENGINE_CONFIG pConfig,
4176 HCERTCHAINENGINE *phChainEngine);
4178 WINCRYPT32API BOOL WINAPI CertResyncCertificateChainEngine(HCERTCHAINENGINE hChainEngine);
4180 WINCRYPT32API VOID WINAPI CertFreeCertificateChainEngine(HCERTCHAINENGINE hChainEngine);
4182 WINCRYPT32API BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
4183 PCCERT_CONTEXT pCertContext, LPFILETIME pTime, HCERTSTORE hAdditionalStore,
4184 PCERT_CHAIN_PARA pChainPara, DWORD dwFlags, LPVOID pvReserved,
4185 PCCERT_CHAIN_CONTEXT *ppChainContext);
4187 WINCRYPT32API PCCERT_CHAIN_CONTEXT WINAPI CertDuplicateCertificateChain(
4188 PCCERT_CHAIN_CONTEXT pChainContext);
4190 WINCRYPT32API VOID WINAPI CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT pChainContext);
4192 WINCRYPT32API PCCERT_CHAIN_CONTEXT WINAPI CertFindChainInStore(HCERTSTORE hCertStore,
4193 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
4194 const void *pvFindPara, PCCERT_CHAIN_CONTEXT pPrevChainContext);
4196 WINCRYPT32API BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID,
4197 PCCERT_CHAIN_CONTEXT pChainContext, PCERT_CHAIN_POLICY_PARA pPolicyPara,
4198 PCERT_CHAIN_POLICY_STATUS pPolicyStatus);
4200 WINCRYPT32API DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext,
4201 DWORD dwPropId);
4203 WINCRYPT32API BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
4204 DWORD dwPropId, void *pvData, DWORD *pcbData);
4206 WINCRYPT32API BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
4207 DWORD dwPropId, DWORD dwFlags, const void *pvData);
4209 WINCRYPT32API DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext,
4210 DWORD dwPropId);
4212 WINCRYPT32API BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
4213 DWORD dwPropId, void *pvData, DWORD *pcbData);
4215 WINCRYPT32API BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
4216 DWORD dwPropId, DWORD dwFlags, const void *pvData);
4218 WINCRYPT32API DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext,
4219 DWORD dwPropId);
4221 WINCRYPT32API BOOL WINAPI CertEnumSubjectInSortedCTL(PCCTL_CONTEXT pCTLContext,
4222 void **ppvNextSubject, PCRYPT_DER_BLOB pSubjectIdentifier,
4223 PCRYPT_DER_BLOB pEncodedAttributes);
4225 WINCRYPT32API BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
4226 DWORD dwPropId, void *pvData, DWORD *pcbData);
4228 WINCRYPT32API BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
4229 DWORD dwPropId, DWORD dwFlags, const void *pvData);
4231 WINCRYPT32API BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
4232 void *pvData, DWORD *pcbData);
4234 WINCRYPT32API BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
4235 DWORD dwFlags, const void *pvData);
4237 WINCRYPT32API BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
4238 DWORD dwCtrlType, void const *pvCtrlPara);
4240 WINCRYPT32API HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore);
4242 WINCRYPT32API BOOL WINAPI CertCloseStore( HCERTSTORE hCertStore, DWORD dwFlags );
4244 WINCRYPT32API BOOL WINAPI CertFreeCertificateContext( PCCERT_CONTEXT pCertContext );
4246 WINCRYPT32API BOOL WINAPI CertFreeCRLContext( PCCRL_CONTEXT pCrlContext );
4248 WINCRYPT32API BOOL WINAPI CertFreeCTLContext( PCCTL_CONTEXT pCtlContext );
4250 WINCRYPT32API BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
4251 PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
4252 PCCERT_CONTEXT *ppStoreContext);
4254 WINCRYPT32API BOOL WINAPI CertAddCRLContextToStore( HCERTSTORE hCertStore,
4255 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
4256 PCCRL_CONTEXT *ppStoreContext );
4258 WINCRYPT32API BOOL WINAPI CertAddCTLContextToStore( HCERTSTORE hCertStore,
4259 PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
4260 PCCTL_CONTEXT *ppStoreContext );
4262 WINCRYPT32API BOOL WINAPI CertAddCertificateLinkToStore(HCERTSTORE hCertStore,
4263 PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
4264 PCCERT_CONTEXT *ppStoreContext);
4266 WINCRYPT32API BOOL WINAPI CertAddCRLLinkToStore(HCERTSTORE hCertStore,
4267 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
4268 PCCRL_CONTEXT *ppStoreContext);
4270 WINCRYPT32API BOOL WINAPI CertAddCTLLinkToStore(HCERTSTORE hCertStore,
4271 PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
4272 PCCTL_CONTEXT *ppStoreContext);
4274 WINCRYPT32API BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore,
4275 DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded,
4276 DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext);
4278 WINCRYPT32API BOOL WINAPI CertAddEncodedCertificateToSystemStoreA(LPCSTR pszCertStoreName,
4279 const BYTE *pbCertEncoded, DWORD cbCertEncoded);
4280 WINCRYPT32API BOOL WINAPI CertAddEncodedCertificateToSystemStoreW(LPCWSTR pszCertStoreName,
4281 const BYTE *pbCertEncoded, DWORD cbCertEncoded);
4282 #define CertAddEncodedCertificateToSystemStore \
4283 WINELIB_NAME_AW(CertAddEncodedCertificateToSystemStore)
4285 WINCRYPT32API BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore,
4286 DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded,
4287 DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext);
4289 WINCRYPT32API BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore,
4290 DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded,
4291 DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext);
4293 WINCRYPT32API BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore,
4294 const BYTE *pbElement, DWORD cbElement, DWORD dwAddDisposition, DWORD dwFlags,
4295 DWORD dwContextTypeFlags, DWORD *pdwContentType, const void **ppvContext);
4297 WINCRYPT32API BOOL WINAPI CertCompareCertificate(DWORD dwCertEncodingType,
4298 PCERT_INFO pCertId1, PCERT_INFO pCertId2);
4299 WINCRYPT32API BOOL WINAPI CertCompareCertificateName(DWORD dwCertEncodingType,
4300 PCERT_NAME_BLOB pCertName1, PCERT_NAME_BLOB pCertName2);
4301 WINCRYPT32API BOOL WINAPI CertCompareIntegerBlob(PCRYPT_INTEGER_BLOB pInt1,
4302 PCRYPT_INTEGER_BLOB pInt2);
4303 WINCRYPT32API BOOL WINAPI CertComparePublicKeyInfo(DWORD dwCertEncodingType,
4304 PCERT_PUBLIC_KEY_INFO pPublicKey1, PCERT_PUBLIC_KEY_INFO pPublicKey2);
4305 WINCRYPT32API DWORD WINAPI CertGetPublicKeyLength(DWORD dwCertEncodingType,
4306 PCERT_PUBLIC_KEY_INFO pPublicKey);
4308 WINCRYPT32API const void * WINAPI CertCreateContext(DWORD dwContextType, DWORD dwEncodingType,
4309 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
4310 PCERT_CREATE_CONTEXT_PARA pCreatePara);
4312 WINCRYPT32API PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
4313 const BYTE *pbCertEncoded, DWORD cbCertEncoded);
4315 WINCRYPT32API PCCRL_CONTEXT WINAPI CertCreateCRLContext( DWORD dwCertEncodingType,
4316 const BYTE* pbCrlEncoded, DWORD cbCrlEncoded);
4318 WINCRYPT32API PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType,
4319 const BYTE *pbCtlEncoded, DWORD cbCtlEncoded);
4321 WINCRYPT32API PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hProv,
4322 PCERT_NAME_BLOB pSubjectIssuerBlob, DWORD dwFlags,
4323 PCRYPT_KEY_PROV_INFO pKeyProvInfo,
4324 PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, PSYSTEMTIME pStartTime,
4325 PSYSTEMTIME pEndTime, PCERT_EXTENSIONS pExtensions);
4327 WINCRYPT32API BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext);
4329 WINCRYPT32API BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext);
4331 WINCRYPT32API BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext);
4333 WINCRYPT32API PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(
4334 PCCERT_CONTEXT pCertContext);
4336 WINCRYPT32API PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext);
4338 WINCRYPT32API PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext);
4340 WINCRYPT32API PCCERT_CONTEXT WINAPI CertFindCertificateInStore( HCERTSTORE hCertStore,
4341 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
4342 const void *pvFindPara, PCCERT_CONTEXT pPrevCertContext );
4344 WINCRYPT32API PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore,
4345 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
4346 const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext);
4348 WINCRYPT32API PCCTL_CONTEXT WINAPI CertFindCTLInStore(HCERTSTORE hCertStore,
4349 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
4350 const void *pvFindPara, PCCTL_CONTEXT pPrevCtlContext);
4352 WINCRYPT32API PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE hCertStore,
4353 PCCERT_CONTEXT pSubjectContext, PCCERT_CONTEXT pPrevIssuerContext,
4354 DWORD *pdwFlags);
4356 WINCRYPT32API PCCERT_CONTEXT WINAPI CertGetSubjectCertificateFromStore(HCERTSTORE hCertStore,
4357 DWORD dwCertEncodingType, PCERT_INFO pCertId);
4359 WINCRYPT32API PCCRL_CONTEXT WINAPI CertGetCRLFromStore(HCERTSTORE hCertStore,
4360 PCCERT_CONTEXT pIssuerContext, PCCRL_CONTEXT pPrevCrlContext, DWORD *pdwFlags);
4362 WINCRYPT32API BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
4363 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
4365 WINCRYPT32API BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext,
4366 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
4368 WINCRYPT32API BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext,
4369 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
4371 WINCRYPT32API BOOL WINAPI CertGetIntendedKeyUsage(DWORD dwCertEncodingType,
4372 PCERT_INFO pCertInfo, BYTE *pbKeyUsage, DWORD cbKeyUsage);
4374 WINCRYPT32API BOOL WINAPI CertGetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext, DWORD dwFlags,
4375 PCERT_ENHKEY_USAGE pUsage, DWORD *pcbUsage);
4376 WINCRYPT32API BOOL WINAPI CertSetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext,
4377 PCERT_ENHKEY_USAGE pUsage);
4378 WINCRYPT32API BOOL WINAPI CertAddEnhancedKeyUsageIdentifier(PCCERT_CONTEXT pCertContext,
4379 LPCSTR pszUsageIdentifier);
4380 WINCRYPT32API BOOL WINAPI CertRemoveEnhancedKeyUsageIdentifier(PCCERT_CONTEXT pCertContext,
4381 LPCSTR pszUsageIdentifier);
4382 WINCRYPT32API BOOL WINAPI CertGetValidUsages(DWORD cCerts, PCCERT_CONTEXT *rghCerts,
4383 int *cNumOIDs, LPSTR *rghOIDs, DWORD *pcbOIDs);
4385 WINCRYPT32API BOOL WINAPI CryptEncodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
4386 const void *pvStructInfo, BYTE *pbEncoded, DWORD *pcbEncoded);
4387 WINCRYPT32API BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
4388 const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara,
4389 void *pvEncoded, DWORD *pcbEncoded);
4391 WINCRYPT32API BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
4392 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo,
4393 DWORD *pcbStructInfo);
4394 WINCRYPT32API BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
4395 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
4396 PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo);
4398 WINCRYPT32API BOOL WINAPI CryptFormatObject(DWORD dwCertEncodingType, DWORD dwFormatType,
4399 DWORD dwFormatStrType, void *pFormatStruct, LPCSTR lpszStructType,
4400 const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, DWORD *pcbFormat);
4402 WINCRYPT32API BOOL WINAPI CryptHashCertificate(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid,
4403 DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
4404 DWORD *pcbComputedHash);
4406 WINCRYPT32API BOOL WINAPI CryptHashCertificate2(LPCWSTR pwszCNGHashAlgid, DWORD dwFlags,
4407 void *pvReserved, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
4408 DWORD *pcbComputedHash);
4410 WINCRYPT32API BOOL WINAPI CryptHashPublicKeyInfo(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid,
4411 DWORD dwFlags, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo,
4412 BYTE *pbComputedHash, DWORD *pcbComputedHash);
4414 WINCRYPT32API BOOL WINAPI CryptHashToBeSigned(HCRYPTPROV_LEGACY hCryptProv, DWORD dwCertEncodingType,
4415 const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
4416 DWORD *pcbComputedHash);
4418 WINCRYPT32API BOOL WINAPI CryptQueryObject(DWORD dwObjectType, const void* pvObject,
4419 DWORD dwExpectedContentTypeFlags, DWORD dwExpectedFormatTypeFlags,
4420 DWORD dwFlags, DWORD* pdwMsgAndCertEncodingType, DWORD* pdwContentType,
4421 DWORD* pdwFormatType, HCERTSTORE* phCertStore, HCRYPTMSG* phMsg,
4422 const void** ppvContext);
4424 WINCRYPT32API BOOL WINAPI CryptSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
4425 DWORD dwCertEncodingType, const BYTE *pbEncodedToBeSigned,
4426 DWORD cbEncodedToBeSigned, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
4427 const void *pvHashAuxInfo, BYTE *pbSignature, DWORD *pcbSignature);
4429 WINCRYPT32API BOOL WINAPI CryptSignAndEncodeCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv,
4430 DWORD dwKeySpec, DWORD dwCertEncodingType, LPCSTR lpszStructType,
4431 const void *pvStructInfo, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
4432 const void *pvHashAuxInfo, BYTE *pbEncoded, DWORD *pcbEncoded);
4434 WINCRYPT32API BOOL WINAPI CryptVerifyCertificateSignature(HCRYPTPROV_LEGACY hCryptProv,
4435 DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded,
4436 PCERT_PUBLIC_KEY_INFO pPublicKey);
4438 WINCRYPT32API BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
4439 DWORD dwCertEncodingType, DWORD dwSubjectType, void *pvSubject,
4440 DWORD dwIssuerType, void *pvIssuer, DWORD dwFlags, void *pvReserved);
4442 WINCRYPT32API PCRYPT_ATTRIBUTE WINAPI CertFindAttribute(LPCSTR pszObjId, DWORD cAttr,
4443 CRYPT_ATTRIBUTE rgAttr[]);
4444 WINCRYPT32API PCERT_EXTENSION WINAPI CertFindExtension(LPCSTR pszObjId, DWORD cExtensions,
4445 CERT_EXTENSION rgExtensions[]);
4446 WINCRYPT32API PCERT_RDN_ATTR WINAPI CertFindRDNAttr(LPCSTR pszObjId, PCERT_NAME_INFO pName);
4448 WINCRYPT32API BOOL WINAPI CertFindSubjectInSortedCTL(PCRYPT_DATA_BLOB pSubjectIdentifier,
4449 PCCTL_CONTEXT pCtlContext, DWORD dwFlags, void *pvReserved,
4450 PCRYPT_DER_BLOB pEncodedAttributes);
4452 WINCRYPT32API BOOL WINAPI CertIsRDNAttrsInCertificateName(DWORD dwCertEncodingType,
4453 DWORD dwFlags, PCERT_NAME_BLOB pCertName, PCERT_RDN pRDN);
4455 WINCRYPT32API BOOL WINAPI CertIsValidCRLForCertificate(PCCERT_CONTEXT pCert,
4456 PCCRL_CONTEXT pCrl, DWORD dwFlags, void *pvReserved);
4457 WINCRYPT32API BOOL WINAPI CertFindCertificateInCRL(PCCERT_CONTEXT pCert,
4458 PCCRL_CONTEXT pCrlContext, DWORD dwFlags, void *pvReserved,
4459 PCRL_ENTRY *ppCrlEntry);
4460 WINCRYPT32API BOOL WINAPI CertVerifyCRLRevocation(DWORD dwCertEncodingType,
4461 PCERT_INFO pCertId, DWORD cCrlInfo, PCRL_INFO rgpCrlInfo[]);
4463 WINCRYPT32API BOOL WINAPI CertVerifySubjectCertificateContext(PCCERT_CONTEXT pSubject,
4464 PCCERT_CONTEXT pIssuer, DWORD *pdwFlags);
4466 WINCRYPT32API LONG WINAPI CertVerifyCRLTimeValidity(LPFILETIME pTimeToVerify,
4467 PCRL_INFO pCrlInfo);
4468 WINCRYPT32API LONG WINAPI CertVerifyTimeValidity(LPFILETIME pTimeToVerify,
4469 PCERT_INFO pCertInfo);
4470 WINCRYPT32API BOOL WINAPI CertVerifyValidityNesting(PCERT_INFO pSubjectInfo,
4471 PCERT_INFO pIssuerInfo);
4473 WINCRYPT32API BOOL WINAPI CertVerifyCTLUsage(DWORD dwEncodingType, DWORD dwSubjectType,
4474 void *pvSubject, PCTL_USAGE pSubjectUsage, DWORD dwFlags,
4475 PCTL_VERIFY_USAGE_PARA pVerifyUsagePara,
4476 PCTL_VERIFY_USAGE_STATUS pVerifyUsageStatus);
4478 WINCRYPT32API BOOL WINAPI CertVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType,
4479 DWORD cContext, PVOID rgpvContext[], DWORD dwFlags,
4480 PCERT_REVOCATION_PARA pRevPara, PCERT_REVOCATION_STATUS pRevStatus);
4482 WINCRYPT32API BOOL WINAPI CryptExportPublicKeyInfo(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
4483 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
4484 WINCRYPT32API BOOL WINAPI CryptExportPublicKeyInfoEx(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
4485 DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags,
4486 void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
4487 WINCRYPT32API BOOL WINAPI CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv,
4488 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, HCRYPTKEY *phKey);
4489 WINCRYPT32API BOOL WINAPI CryptImportPublicKeyInfoEx(HCRYPTPROV hCryptProv,
4490 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg,
4491 DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey);
4492 WINCRYPT32API BOOL WINAPI CryptImportPublicKeyInfoEx2(DWORD dwCertEncodingType,
4493 PCERT_PUBLIC_KEY_INFO pInfo, DWORD dwFlags, void *pvAuxInfo,
4494 BCRYPT_KEY_HANDLE *phKey);
4496 WINCRYPT32API BOOL WINAPI CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT pCert,
4497 DWORD dwFlags, void *pvReserved, HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProv, DWORD *pdwKeySpec,
4498 BOOL *pfCallerFreeProv);
4500 WINCRYPT32API BOOL WINAPI CryptFindCertificateKeyProvInfo(PCCERT_CONTEXT pCert,
4501 DWORD dwFlags, void *pvReserved);
4503 WINCRYPT32API BOOL WINAPI CryptProtectData( DATA_BLOB* pDataIn, LPCWSTR szDataDescr,
4504 DATA_BLOB* pOptionalEntropy, PVOID pvReserved,
4505 CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
4507 WINCRYPT32API BOOL WINAPI CryptUnprotectData( DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr,
4508 DATA_BLOB* pOptionalEntropy, PVOID pvReserved,
4509 CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
4511 WINCRYPT32API BOOL WINAPI CryptProtectMemory(void *pData, DWORD cbData, DWORD dwFlags);
4512 WINCRYPT32API BOOL WINAPI CryptUnprotectMemory(void *pData, DWORD cbData, DWORD dwFlags);
4514 WINCRYPT32API DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType,
4515 DWORD dwFlags, void *pvTypePara, LPSTR pszNameString, DWORD cchNameString);
4516 WINCRYPT32API DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
4517 DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString);
4518 #define CertGetNameString WINELIB_NAME_AW(CertGetNameString)
4520 WINCRYPT32API DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
4521 LPSTR psz, DWORD csz);
4522 WINCRYPT32API DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
4523 LPWSTR psz, DWORD csz);
4524 #define CertRDNValueToStr WINELIB_NAME_AW(CertRDNValueToStr)
4526 WINCRYPT32API DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName,
4527 DWORD dwStrType, LPSTR psz, DWORD csz);
4528 WINCRYPT32API DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName,
4529 DWORD dwStrType, LPWSTR psz, DWORD csz);
4530 #define CertNameToStr WINELIB_NAME_AW(CertNameToStr)
4532 WINCRYPT32API BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
4533 DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded,
4534 LPCSTR *ppszError);
4535 WINCRYPT32API BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
4536 DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded,
4537 LPCWSTR *ppszError);
4538 #define CertStrToName WINELIB_NAME_AW(CertStrToName)
4540 WINCRYPT32API DWORD WINAPI CryptMsgCalculateEncodedLength(DWORD dwMsgEncodingType,
4541 DWORD dwFlags, DWORD dwMsgType, const void *pvMsgEncodeInfo,
4542 LPSTR pszInnerContentObjID, DWORD cbData);
4544 WINCRYPT32API BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg);
4546 WINCRYPT32API BOOL WINAPI CryptMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags,
4547 DWORD dwCtrlType, const void *pvCtrlPara);
4549 WINCRYPT32API BOOL WINAPI CryptMsgCountersign(HCRYPTMSG hCryptMsg, DWORD dwIndex,
4550 DWORD dwCountersigners, PCMSG_SIGNER_ENCODE_INFO rgCountersigners);
4552 WINCRYPT32API BOOL WINAPI CryptMsgCountersignEncoded(DWORD dwEncodingType, PBYTE pbSignerInfo,
4553 DWORD cbSignerInfo, DWORD cCountersigners,
4554 PCMSG_SIGNER_ENCODE_INFO rgCountersigners, PBYTE pbCountersignature,
4555 PDWORD pcbCountersignature);
4557 WINCRYPT32API HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg);
4559 WINCRYPT32API BOOL WINAPI CryptMsgEncodeAndSignCTL(DWORD dwMsgEncodingType,
4560 PCTL_INFO pCtlInfo, PCMSG_SIGNED_ENCODE_INFO pSignInfo, DWORD dwFlags,
4561 BYTE *pbEncoded, DWORD *pcbEncoded);
4563 WINCRYPT32API BOOL WINAPI CryptMsgGetAndVerifySigner(HCRYPTMSG hCryptMsg, DWORD cSignerStore,
4564 HCERTSTORE *rghSignerStore, DWORD dwFlags, PCCERT_CONTEXT *ppSigner,
4565 DWORD *pdwSignerIndex);
4567 WINCRYPT32API BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
4568 DWORD dwIndex, void *pvData, DWORD *pcbData);
4570 WINCRYPT32API HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags,
4571 DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo,
4572 PCMSG_STREAM_INFO pStreamInfo);
4574 WINCRYPT32API HCRYPTMSG WINAPI CryptMsgOpenToEncode(DWORD dwMsgEncodingType, DWORD dwFlags,
4575 DWORD dwMsgType, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID,
4576 PCMSG_STREAM_INFO pStreamInfo);
4578 WINCRYPT32API BOOL WINAPI CryptMsgSignCTL(DWORD dwMsgEncodingType, BYTE *pbCtlContent,
4579 DWORD cbCtlContent, PCMSG_SIGNED_ENCODE_INFO pSignInfo, DWORD dwFlags,
4580 BYTE *pbEncoded, DWORD *pcbEncoded);
4582 WINCRYPT32API BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
4583 DWORD cbData, BOOL fFinal);
4585 WINCRYPT32API BOOL WINAPI CryptMsgVerifyCountersignatureEncoded(HCRYPTPROV_LEGACY hCryptProv,
4586 DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo,
4587 PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature,
4588 PCERT_INFO pciCountersigner);
4590 WINCRYPT32API BOOL WINAPI CryptMsgVerifyCountersignatureEncodedEx(HCRYPTPROV_LEGACY hCryptProv,
4591 DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo,
4592 PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature,
4593 DWORD dwSignerType, void *pvSigner, DWORD dwFlags, void *pvReserved);
4595 WINCRYPT32API BOOL WINAPI CryptSignMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara,
4596 BOOL fDetachedSignature, DWORD cToBeSigned, const BYTE *rgpbToBeSigned[],
4597 DWORD rgcbToBeSigned[], BYTE *pbSignedBlob, DWORD *pcbSignedBlob);
4598 WINCRYPT32API BOOL WINAPI CryptSignMessageWithKey(PCRYPT_KEY_SIGN_MESSAGE_PARA pSignPara,
4599 const BYTE *pbToBeSigned, DWORD cbToBeSigned, BYTE *pbSignedBlob,
4600 DWORD *pcbSignedBlob);
4602 WINCRYPT32API BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
4603 DWORD dwSignerIndex, const BYTE* pbSignedBlob, DWORD cbSignedBlob,
4604 BYTE* pbDecoded, DWORD* pcbDecoded, PCCERT_CONTEXT* ppSignerCert);
4605 WINCRYPT32API BOOL WINAPI CryptVerifyMessageSignatureWithKey(
4606 PCRYPT_KEY_VERIFY_MESSAGE_PARA pVerifyPara,
4607 PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, const BYTE *pbSignedBlob,
4608 DWORD cbSignedBlob, BYTE *pbDecoded, DWORD *pcbDecoded);
4610 WINCRYPT32API BOOL WINAPI CryptVerifyDetachedMessageSignature(
4611 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4612 const BYTE *pbDetachedSignBlob, DWORD cbDetachedSignBlob, DWORD cToBeSigned,
4613 const BYTE *rgpbToBeSigned[], DWORD rgcbToBeSigned[],
4614 PCCERT_CONTEXT *ppSignerCert);
4615 WINCRYPT32API LONG WINAPI CryptGetMessageSignerCount(DWORD dwMsgEncodingType,
4616 const BYTE *pbSignedBlob, DWORD cbSignedBlob);
4618 WINCRYPT32API BOOL WINAPI CryptEncryptMessage(PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara,
4619 DWORD cRecipientCert, PCCERT_CONTEXT rgpRecipientCert[],
4620 const BYTE *pbToBeEncrypted, DWORD cbToBeEncrypted, BYTE *pbEncryptedBlob,
4621 DWORD *pcbEncryptedBlob);
4622 WINCRYPT32API BOOL WINAPI CryptDecryptMessage(PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4623 const BYTE *pbEncryptedBlob, DWORD cbEncryptedBlob, BYTE *pbDecrypted,
4624 DWORD *pcbDecrypted, PCCERT_CONTEXT *ppXchgCert);
4626 WINCRYPT32API BOOL WINAPI CryptSignAndEncryptMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara,
4627 PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara, DWORD cRecipientCert,
4628 PCCERT_CONTEXT rgpRecipientCert[], const BYTE *pbToBeSignedAndEncrypted,
4629 DWORD cbToBeSignedAndEncrypted, BYTE *pbSignedAndEncryptedBlob,
4630 DWORD *pcbSignedAndEncryptedBlob);
4631 WINCRYPT32API BOOL WINAPI CryptDecryptAndVerifyMessageSignature(
4632 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4633 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4634 const BYTE *pbEncryptedBlob, DWORD cbEncryptedBlob, BYTE *pbDecrypted,
4635 DWORD *pcbDecrypted, PCCERT_CONTEXT *ppXchgCert, PCCERT_CONTEXT *ppSignerCert);
4637 WINCRYPT32API HCERTSTORE WINAPI CryptGetMessageCertificates(DWORD dwMsgAndCertEncodingType,
4638 HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const BYTE *pbSignedBlob,
4639 DWORD cbSignedBlob);
4641 WINCRYPT32API BOOL WINAPI CryptDecodeMessage(DWORD dwMsgTypeFlags,
4642 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4643 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4644 const BYTE *pbEncodedBlob, DWORD cbEncodedBlob, DWORD dwPrevInnerContentType,
4645 DWORD *pdwMsgType, DWORD *pdwInnerContentType, BYTE *pbDecoded,
4646 DWORD *pcbDecoded, PCCERT_CONTEXT *ppXchgCert, PCCERT_CONTEXT *ppSignerCert);
4648 WINCRYPT32API BOOL WINAPI CryptHashMessage(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4649 BOOL fDetachedHash, DWORD cToBeHashed, const BYTE *rgpbToBeHashed[],
4650 DWORD rgcbToBeHashed[], BYTE *pbHashedBlob, DWORD *pcbHashedBlob,
4651 BYTE *pbComputedHash, DWORD *pcbComputedHash);
4652 WINCRYPT32API BOOL WINAPI CryptVerifyMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4653 BYTE *pbHashedBlob, DWORD cbHashedBlob, BYTE *pbToBeHashed,
4654 DWORD *pcbToBeHashed, BYTE *pbComputedHash, DWORD *pcbComputedHash);
4655 WINCRYPT32API BOOL WINAPI CryptVerifyDetachedMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4656 BYTE *pbDetachedHashBlob, DWORD cbDetachedHashBlob, DWORD cToBeHashed,
4657 const BYTE *rgpbToBeHashed[], DWORD rgcbToBeHashed[], BYTE *pbComputedHash,
4658 DWORD *pcbComputedHash);
4660 /* PFX functions */
4661 WINCRYPT32API HCERTSTORE WINAPI PFXImportCertStore(CRYPT_DATA_BLOB *pPFX, LPCWSTR szPassword,
4662 DWORD dwFlags);
4663 WINCRYPT32API BOOL WINAPI PFXIsPFXBlob(CRYPT_DATA_BLOB *pPFX);
4664 WINCRYPT32API BOOL WINAPI PFXVerifyPassword(CRYPT_DATA_BLOB *pPFX, LPCWSTR szPassword,
4665 DWORD dwFlags);
4666 WINCRYPT32API BOOL WINAPI PFXExportCertStoreEx(HCERTSTORE hStore, CRYPT_DATA_BLOB *pPFX,
4667 LPCWSTR szPassword, void *pvReserved, DWORD dwFlags);
4668 WINCRYPT32API BOOL WINAPI PFXExportCertStore(HCERTSTORE hStore, CRYPT_DATA_BLOB *pPFX,
4669 LPCWSTR szPassword, DWORD dwFlags);
4671 /* cryptnet.dll functions */
4672 BOOL WINAPI CryptCancelAsyncRetrieval(HCRYPTASYNC hAsyncRetrieval);
4674 BOOL WINAPI CryptGetObjectUrl(LPCSTR pszUrlOid, LPVOID pvPara, DWORD dwFlags,
4675 PCRYPT_URL_ARRAY pUrlArray, DWORD *pcbUrlArray, PCRYPT_URL_INFO pUrlInfo,
4676 DWORD *pcbUrlInfo, LPVOID pvReserved);
4678 BOOL WINAPI CryptGetTimeValidObject(LPCSTR pszTimeValidOid, void *pvPara,
4679 PCCERT_CONTEXT pIssuer, LPFILETIME pftValidFor, DWORD dwFlags, DWORD dwTimeout,
4680 void **ppvObject, PCRYPT_CREDENTIALS pCredentials, void *pvReserved);
4682 BOOL WINAPI CryptFlushTimeValidObject(LPCSTR pszFlushTimeValidOid, void *pvPara,
4683 PCCERT_CONTEXT pIssuer, DWORD dwFlags, void *pvReserved);
4685 BOOL WINAPI CryptInstallCancelRetrieval(PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel,
4686 const void *pvArg, DWORD dwFlags, void *pvReserved);
4688 BOOL WINAPI CryptUninstallCancelRetrieval(DWORD dwFlags, void *pvReserved);
4690 BOOL WINAPI CryptRetrieveObjectByUrlA(LPCSTR pszURL, LPCSTR pszObjectOid,
4691 DWORD dwRetrievalFlags, DWORD dwTimeout, LPVOID *ppvObject,
4692 HCRYPTASYNC hAsyncRetrieve, PCRYPT_CREDENTIALS pCredentials, LPVOID pvVerify,
4693 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
4694 BOOL WINAPI CryptRetrieveObjectByUrlW(LPCWSTR pszURL, LPCSTR pszObjectOid,
4695 DWORD dwRetrievalFlags, DWORD dwTimeout, LPVOID *ppvObject,
4696 HCRYPTASYNC hAsyncRetrieve, PCRYPT_CREDENTIALS pCredentials, LPVOID pvVerify,
4697 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
4698 #define CryptRetrieveObjectByUrl WINELIB_NAME_AW(CryptRetrieveObjectByUrl)
4700 /* Not found in crypt32.dll but in softpub.dll */
4701 HRESULT WINAPI FindCertsByIssuer(PCERT_CHAIN pCertChains, DWORD *pcbCertChains,
4702 DWORD *pcCertChains, BYTE* pbEncodedIssuerName, DWORD cbEncodedIssuerName,
4703 LPCWSTR pwszPurpose, DWORD dwKeySpec);
4705 #ifdef __cplusplus
4707 #endif
4709 #endif