wordpad: Move printing functions to a separate file.
[wine.git] / include / wincrypt.h
blobaa6ae2e16781bc75da9e73663a2c37dae68b5727
1 /*
2 * Copyright (C) 2002 Travis Michielsen
3 * Copyright (C) 2004-2005 Juan Lang
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_WINCRYPT_H
21 #define __WINE_WINCRYPT_H
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
27 #include <bcrypt.h>
28 /* FIXME: #include <ncrypt.h> */
30 #ifdef _ADVAPI32_
31 # define WINADVAPI
32 #else
33 # define WINADVAPI DECLSPEC_IMPORT
34 #endif
36 /* some typedefs for function parameters */
37 typedef unsigned int ALG_ID;
38 typedef ULONG_PTR HCRYPTPROV;
39 typedef ULONG_PTR HCRYPTPROV_OR_NCRYPT_KEY_HANDLE;
40 typedef ULONG_PTR HCRYPTPROV_LEGACY;
41 typedef ULONG_PTR HCRYPTKEY;
42 typedef ULONG_PTR HCRYPTHASH;
43 typedef void *HCERTSTORE;
44 typedef void *HCRYPTMSG;
45 typedef void *HCERTSTOREPROV;
46 typedef void *HCRYPTOIDFUNCSET;
47 typedef void *HCRYPTOIDFUNCADDR;
48 typedef void *HCRYPTDEFAULTCONTEXT;
50 /* CSP Structs */
52 typedef struct _PROV_ENUMALGS {
53 ALG_ID aiAlgid;
54 DWORD dwBitLen;
55 DWORD dwNameLen;
56 CHAR szName[20];
57 } PROV_ENUMALGS;
59 typedef struct _PROV_ENUMALGS_EX {
60 ALG_ID aiAlgid;
61 DWORD dwDefaultLen;
62 DWORD dwMinLen;
63 DWORD dwMaxLen;
64 DWORD dwProtocols;
65 DWORD dwNameLen;
66 CHAR szName[20];
67 DWORD dwLongNameLen;
68 CHAR szLongName[40];
69 } PROV_ENUMALGS_EX;
71 #define SCHANNEL_MAC_KEY 0
72 #define SCHANNEL_ENC_KEY 1
74 typedef struct _SCHANNEL_ALG {
75 DWORD dwUse;
76 ALG_ID Algid;
77 DWORD cBits;
78 DWORD dwFlags;
79 DWORD dwReserved;
80 } SCHANNEL_ALG, *PSCHANNEL_ALG;
82 typedef struct _HMAC_INFO {
83 ALG_ID HashAlgid;
84 BYTE* pbInnerString;
85 DWORD cbInnerString;
86 BYTE* pbOuterString;
87 DWORD cbOuterString;
88 } HMAC_INFO, *PHMAC_INFO;
90 typedef struct _CRYPTOAPI_BLOB {
91 DWORD cbData;
92 BYTE* pbData;
93 } CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
94 CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB,
95 CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
96 CERT_NAME_BLOB, *PCERT_NAME_BLOB,
97 CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
98 CERT_BLOB, *PCERT_BLOB,
99 CRL_BLOB, *PCRL_BLOB,
100 DATA_BLOB, *PDATA_BLOB,
101 CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB,
102 CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB,
103 CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB,
104 CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
105 CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
107 typedef struct _CRYPTPROTECT_PROMPTSTRUCT{
108 DWORD cbSize;
109 DWORD dwPromptFlags;
110 HWND hwndApp;
111 LPCWSTR szPrompt;
112 } CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT;
114 typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
115 LPSTR pszObjId;
116 CRYPT_OBJID_BLOB Parameters;
117 } CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
119 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
120 LPSTR pszObjId;
121 CRYPT_OBJID_BLOB Value;
122 } CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
124 typedef struct _PUBLICKEYSTRUC {
125 BYTE bType;
126 BYTE bVersion;
127 WORD reserved;
128 ALG_ID aiKeyAlg;
129 } BLOBHEADER, PUBLICKEYSTRUC;
131 typedef struct _RSAPUBKEY {
132 DWORD magic;
133 DWORD bitlen;
134 DWORD pubexp;
135 } RSAPUBKEY;
137 typedef struct _CRYPT_BIT_BLOB {
138 DWORD cbData;
139 BYTE *pbData;
140 DWORD cUnusedBits;
141 } CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
143 typedef struct _CRYPT_KEY_PROV_PARAM {
144 DWORD dwParam;
145 BYTE *pbData;
146 DWORD cbData;
147 DWORD dwFlags;
148 } CRYPT_KEY_PROV_PARAM, *PCRYPT_KEY_PROV_PARAM;
150 typedef struct _CRYPT_KEY_PROV_INFO {
151 LPWSTR pwszContainerName;
152 LPWSTR pwszProvName;
153 DWORD dwProvType;
154 DWORD dwFlags;
155 DWORD cProvParam;
156 PCRYPT_KEY_PROV_PARAM rgProvParam;
157 DWORD dwKeySpec;
158 } CRYPT_KEY_PROV_INFO, *PCRYPT_KEY_PROV_INFO;
160 typedef struct _CERT_KEY_CONTEXT {
161 DWORD cbSize;
162 HCRYPTPROV hCryptProv;
163 DWORD dwKeySpec;
164 } CERT_KEY_CONTEXT, *PCERT_KEY_CONTEXT;
166 typedef struct _CERT_PUBLIC_KEY_INFO {
167 CRYPT_ALGORITHM_IDENTIFIER Algorithm;
168 CRYPT_BIT_BLOB PublicKey;
169 } CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
171 typedef struct _CERT_EXTENSION {
172 LPSTR pszObjId;
173 BOOL fCritical;
174 CRYPT_OBJID_BLOB Value;
175 } CERT_EXTENSION, *PCERT_EXTENSION;
177 typedef struct _CERT_EXTENSIONS {
178 DWORD cExtension;
179 PCERT_EXTENSION rgExtension;
180 } CERT_EXTENSIONS, *PCERT_EXTENSIONS;
182 typedef struct _CERT_INFO {
183 DWORD dwVersion;
184 CRYPT_INTEGER_BLOB SerialNumber;
185 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
186 CERT_NAME_BLOB Issuer;
187 FILETIME NotBefore;
188 FILETIME NotAfter;
189 CERT_NAME_BLOB Subject;
190 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
191 CRYPT_BIT_BLOB IssuerUniqueId;
192 CRYPT_BIT_BLOB SubjectUniqueId;
193 DWORD cExtension;
194 PCERT_EXTENSION rgExtension;
195 } CERT_INFO, *PCERT_INFO;
197 typedef struct _CERT_RDN_ATTR {
198 LPSTR pszObjId;
199 DWORD dwValueType;
200 CERT_RDN_VALUE_BLOB Value;
201 } CERT_RDN_ATTR, *PCERT_RDN_ATTR;
203 typedef struct _CERT_RDN {
204 DWORD cRDNAttr;
205 PCERT_RDN_ATTR rgRDNAttr;
206 } CERT_RDN, *PCERT_RDN;
208 typedef struct _CERT_NAME_INFO {
209 DWORD cRDN;
210 PCERT_RDN rgRDN;
211 } CERT_NAME_INFO, *PCERT_NAME_INFO;
213 typedef struct _CERT_NAME_VALUE {
214 DWORD dwValueType;
215 CERT_RDN_VALUE_BLOB Value;
216 } CERT_NAME_VALUE, *PCERT_NAME_VALUE;
218 typedef struct _CERT_ENCRYPTED_PRIVATE_KEY_INFO {
219 CRYPT_ALGORITHM_IDENTIFIER EncryptionAlgorithm;
220 CRYPT_DATA_BLOB EncryptedPrivateKey;
221 } CERT_ENCRYPTED_PRIVATE_KEY_INFO, *PCERT_ENCRYPTED_PRIVATE_KEY_INFO;
223 typedef struct _CERT_AUTHORITY_KEY_ID_INFO {
224 CRYPT_DATA_BLOB KeyId;
225 CERT_NAME_BLOB CertIssuer;
226 CRYPT_INTEGER_BLOB CertSerialNumber;
227 } CERT_AUTHORITY_KEY_ID_INFO, *PCERT_AUTHORITY_KEY_ID_INFO;
229 typedef struct _CERT_PRIVATE_KEY_VALIDITY {
230 FILETIME NotBefore;
231 FILETIME NotAfter;
232 } CERT_PRIVATE_KEY_VALIDITY, *PCERT_PRIVATE_KEY_VALIDITY;
234 typedef struct _CERT_KEY_ATTRIBUTES_INFO {
235 CRYPT_DATA_BLOB KeyId;
236 CRYPT_BIT_BLOB IntendedKeyUsage;
237 PCERT_PRIVATE_KEY_VALIDITY pPrivateKeyUsagePeriod;
238 } CERT_KEY_ATTRIBUTES_INFO, *PCERT_KEY_ATTRIBUTES_INFO;
240 /* byte 0 */
241 #define CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80
242 #define CERT_NON_REPUDIATION_KEY_USAGE 0x40
243 #define CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20
244 #define CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10
245 #define CERT_KEY_AGREEMENT_KEY_USAGE 0x80
246 #define CERT_KEY_CERT_SIGN_KEY_USAGE 0x40
247 #define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x20
248 #define CERT_CRL_SIGN_KEY_USAGE 0x10
249 #define CERT_ENCIPHER_ONLY_KEY_USAGE 0x01
250 /* byte 1 */
251 #define CERT_DECIPHER_ONLY_KEY_USAGE 0x80
253 typedef struct _CERT_POLICY_ID {
254 DWORD cCertPolicyElementId;
255 LPSTR *rgbszCertPolicyElementId;
256 } CERT_POLICY_ID, *PCERT_POLICY_ID;
258 typedef struct _CERT_KEY_USAGE_RESTRICTION_INFO {
259 DWORD cCertPolicyId;
260 PCERT_POLICY_ID rgCertPolicyId;
261 CRYPT_BIT_BLOB RestrictedKeyUsage;
262 } CERT_KEY_USAGE_RESTRICTION_INFO, *PCERT_KEY_USAGE_RESTRICTION_INFO;
264 typedef struct _CERT_OTHER_NAME {
265 LPSTR pszObjId;
266 CRYPT_OBJID_BLOB Value;
267 } CERT_OTHER_NAME, *PCERT_OTHER_NAME;
269 typedef struct _CERT_ALT_NAME_ENTRY {
270 DWORD dwAltNameChoice;
271 union {
272 PCERT_OTHER_NAME pOtherName;
273 LPWSTR pwszRfc822Name;
274 LPWSTR pwszDNSName;
275 CERT_NAME_BLOB DirectoryName;
276 LPWSTR pwszURL;
277 CRYPT_DATA_BLOB IPAddress;
278 LPSTR pszRegisteredID;
279 } DUMMYUNIONNAME;
280 } CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY;
282 #define CERT_ALT_NAME_OTHER_NAME 1
283 #define CERT_ALT_NAME_RFC822_NAME 2
284 #define CERT_ALT_NAME_DNS_NAME 3
285 #define CERT_ALT_NAME_X400_ADDRESS 4
286 #define CERT_ALT_NAME_DIRECTORY_NAME 5
287 #define CERT_ALT_NAME_EDI_PARTY_NAME 6
288 #define CERT_ALT_NAME_URL 7
289 #define CERT_ALT_NAME_IP_ADDRESS 8
290 #define CERT_ALT_NAME_REGISTERED_ID 9
292 typedef struct _CERT_ALT_NAME_INFO {
293 DWORD cAltEntry;
294 PCERT_ALT_NAME_ENTRY rgAltEntry;
295 } CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO;
297 #define CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK 0xff
298 #define CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT 16
299 #define CERT_ALT_NAME_VALUE_ERR_INDEX_MASK 0x0000ffff
300 #define CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT 0
301 #define GET_CERT_ALT_NAME_ENTRY_ERR_INDEX(x) \
302 (((x) >> CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT) & \
303 CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK)
304 #define GET_CERT_ALT_NAME_VALUE_ERR_INDEX(x) \
305 ((x) & CERT_ALT_NAME_VALUE_ERR_INDEX_MASK)
307 typedef struct _CERT_BASIC_CONSTRAINTS_INFO {
308 CRYPT_BIT_BLOB SubjectType;
309 BOOL fPathLenConstraint;
310 DWORD dwPathLenConstraint;
311 DWORD cSubtreesConstraint;
312 CERT_NAME_BLOB *rgSubtreesConstraint;
313 } CERT_BASIC_CONSTRAINTS_INFO, *PCERT_BASIC_CONSTRAINTS_INFO;
315 #define CERT_CA_SUBJECT_FLAG 0x80
316 #define CERT_END_ENTITY_SUBJECT_FLAG 0x40
318 typedef struct _CERT_BASIC_CONSTRAINTS2_INFO {
319 BOOL fCA;
320 BOOL fPathLenConstraint;
321 DWORD dwPathLenConstraint;
322 } CERT_BASIC_CONSTRAINTS2_INFO, *PCERT_BASIC_CONSTRAINTS2_INFO;
324 typedef struct _CERT_POLICY_QUALIFIER_INFO {
325 LPSTR pszPolicyQualifierId;
326 CRYPT_OBJID_BLOB Qualifier;
327 } CERT_POLICY_QUALIFIER_INFO, *PCERT_POLICY_QUALIFIER_INFO;
329 typedef struct _CERT_POLICY_INFO {
330 LPSTR pszPolicyIdentifier;
331 DWORD cPolicyQualifier;
332 CERT_POLICY_QUALIFIER_INFO *rgPolicyQualifier;
333 } CERT_POLICY_INFO, *PCERT_POLICY_INFO;
335 typedef struct _CERT_POLICIES_INFO {
336 DWORD cPolicyInfo;
337 CERT_POLICY_INFO *rgPolicyInfo;
338 } CERT_POLICIES_INFO, *PCERT_POLICIES_INFO;
340 typedef struct _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE {
341 LPSTR pszOrganization;
342 DWORD cNoticeNumbers;
343 int *rgNoticeNumbers;
344 } CERT_POLICY_QUALIFIER_NOTICE_REFERENCE,
345 *PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE;
347 typedef struct _CERT_POLICY_QUALIFIER_USER_NOTICE {
348 CERT_POLICY_QUALIFIER_NOTICE_REFERENCE *pNoticeReference;
349 LPWSTR pszDisplayText;
350 } CERT_POLICY_QUALIFIER_USER_NOTICE, *PCERT_POLICY_QUALIFIER_USER_NOTICE;
352 typedef struct _CPS_URLS {
353 LPWSTR pszURL;
354 CRYPT_ALGORITHM_IDENTIFIER *pAlgorithm;
355 CRYPT_DATA_BLOB *pDigest;
356 } CPS_URLS, *PCPS_URLS;
358 typedef struct _CERT_POLICY95_QUALIFIER1 {
359 LPWSTR pszPracticesReference;
360 LPSTR pszNoticeIdentifier;
361 LPSTR pszNSINoticeIdentifier;
362 DWORD cCPSURLs;
363 CPS_URLS *rgCPSURLs;
364 } CERT_POLICY95_QUALIFIER1, *PCERT_POLICY95_QUALIFIER1;
366 typedef struct _CERT_POLICY_MAPPING {
367 LPSTR pszIssuerDomainPolicy;
368 LPSTR pszSubjectDomainPolicy;
369 } CERT_POLICY_MAPPING, *PCERT_POLICY_MAPPING;
371 typedef struct _CERT_POLICY_MAPPINGS_INFO {
372 DWORD cPolicyMapping;
373 PCERT_POLICY_MAPPING rgPolicyMapping;
374 } CERT_POLICY_MAPPINGS_INFO, *PCERT_POLICY_MAPPINGS_INFO;
376 typedef struct _CERT_POLICY_CONSTRAINTS_INFO {
377 BOOL fRequireExplicitPolicy;
378 DWORD dwRequireExplicitPolicySkipCerts;
379 BOOL fInhibitPolicyMapping;
380 DWORD dwInhibitPolicyMappingSkipCerts;
381 } CERT_POLICY_CONSTRAINTS_INFO, *PCERT_POLICY_CONSTRAINTS_INFO;
383 typedef struct _CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY {
384 LPSTR pszObjId;
385 DWORD cValue;
386 PCRYPT_DER_BLOB rgValue;
387 } CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY, *PCRYPT_CONTENT_INFO_SEQUENCE_OF_ANY;
389 typedef struct _CRYPT_CONTENT_INFO {
390 LPSTR pszObjId;
391 CRYPT_DER_BLOB Content;
392 } CRYPT_CONTENT_INFO, *PCRYPT_CONTENT_INFO;
394 typedef struct _CRYPT_SEQUENCE_OF_ANY {
395 DWORD cValue;
396 PCRYPT_DER_BLOB rgValue;
397 } CRYPT_SEQUENCE_OF_ANY, *PCRYPT_SEQUENCE_OF_ANY;
399 typedef struct _CERT_AUTHORITY_KEY_ID2_INFO {
400 CRYPT_DATA_BLOB KeyId;
401 CERT_ALT_NAME_INFO AuthorityCertIssuer;
402 CRYPT_INTEGER_BLOB AuthorityCertSerialNumber;
403 } CERT_AUTHORITY_KEY_ID2_INFO, *PCERT_AUTHORITY_KEY_ID2_INFO;
405 typedef struct _CERT_ACCESS_DESCRIPTION {
406 LPSTR pszAccessMethod;
407 CERT_ALT_NAME_ENTRY AccessLocation;
408 } CERT_ACCESS_DESCRIPTION, *PCERT_ACCESS_DESCRIPTION;
410 typedef struct _CERT_AUTHORITY_INFO_ACCESS {
411 DWORD cAccDescr;
412 PCERT_ACCESS_DESCRIPTION rgAccDescr;
413 } CERT_AUTHORITY_INFO_ACCESS, *PCERT_AUTHORITY_INFO_ACCESS;
415 typedef struct _CERT_CONTEXT {
416 DWORD dwCertEncodingType;
417 BYTE *pbCertEncoded;
418 DWORD cbCertEncoded;
419 PCERT_INFO pCertInfo;
420 HCERTSTORE hCertStore;
421 } CERT_CONTEXT, *PCERT_CONTEXT;
422 typedef const CERT_CONTEXT *PCCERT_CONTEXT;
424 typedef struct _CRL_ENTRY {
425 CRYPT_INTEGER_BLOB SerialNumber;
426 FILETIME RevocationDate;
427 DWORD cExtension;
428 PCERT_EXTENSION rgExtension;
429 } CRL_ENTRY, *PCRL_ENTRY;
431 typedef struct _CRL_INFO {
432 DWORD dwVersion;
433 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
434 CERT_NAME_BLOB Issuer;
435 FILETIME ThisUpdate;
436 FILETIME NextUpdate;
437 DWORD cCRLEntry;
438 PCRL_ENTRY rgCRLEntry;
439 DWORD cExtension;
440 PCERT_EXTENSION rgExtension;
441 } CRL_INFO, *PCRL_INFO;
443 typedef struct _CRL_DIST_POINT_NAME {
444 DWORD dwDistPointNameChoice;
445 union {
446 CERT_ALT_NAME_INFO FullName;
447 } DUMMYUNIONNAME;
448 } CRL_DIST_POINT_NAME, *PCRL_DIST_POINT_NAME;
450 #define CRL_DIST_POINT_NO_NAME 0
451 #define CRL_DIST_POINT_FULL_NAME 1
452 #define CRL_DIST_POINT_ISSUER_RDN_NAME 2
454 typedef struct _CRL_DIST_POINT {
455 CRL_DIST_POINT_NAME DistPointName;
456 CRYPT_BIT_BLOB ReasonFlags;
457 CERT_ALT_NAME_INFO CRLIssuer;
458 } CRL_DIST_POINT, *PCRL_DIST_POINT;
460 #define CRL_REASON_UNUSED_FLAG 0x80
461 #define CRL_REASON_KEY_COMPROMISE_FLAG 0x40
462 #define CRL_REASON_CA_COMPROMISE_FLAG 0x20
463 #define CRL_REASON_AFFILIATION_CHANGED_FLAG 0x10
464 #define CRL_REASON_SUPERSEDED_FLAG 0x08
465 #define CRL_REASON_CESSATION_OF_OPERATION_FLAG 0x04
466 #define CRL_REASON_CERTIFICATE_HOLD_FLAG 0x02
468 typedef struct _CRL_DIST_POINTS_INFO {
469 DWORD cDistPoint;
470 PCRL_DIST_POINT rgDistPoint;
471 } CRL_DIST_POINTS_INFO, *PCRL_DIST_POINTS_INFO;
473 #define CRL_DIST_POINT_ERR_INDEX_MASK 0x7f
474 #define CRL_DIST_POINT_ERR_INDEX_SHIFT 24
475 #define GET_CRL_DIST_POINT_ERR_INDEX(x) \
476 (((x) >> CRL_DIST_POINT_ERR_INDEX_SHIFT) & CRL_DIST_POINT_ERR_INDEX_MASK)
478 #define CRL_DIST_POINT_ERR_CRL_ISSUER_BIT 0x80000000L
479 #define IS_CRL_DIST_POINT_ERR_CRL_ISSUER(x) \
480 ((x) & CRL_DIST_POINT_ERR_CRL_ISSUER_BIT)
482 typedef struct _CROSS_CERT_DIST_POINTS_INFO {
483 DWORD dwSyncDeltaTime;
484 DWORD cDistPoint;
485 PCERT_ALT_NAME_INFO rgDistPoint;
486 } CROSS_CERT_DIST_POINTS_INFO, *PCROSS_CERT_DIST_POINTS_INFO;
488 #define CROSS_CERT_DIST_POINT_ERR_INDEX_MASK 0xff
489 #define CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT 24
490 #define GET_CROSS_CERT_DIST_POINT_ERR_INDEX(x) \
491 (((x) >> CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT) & \
492 CROSS_CERT_DIST_POINT_ERR_INDEX_MASK)
494 typedef struct _CERT_PAIR {
495 CERT_BLOB Forward;
496 CERT_BLOB Reverse;
497 } CERT_PAIR, *PCERT_PAIR;
499 typedef struct _CRL_ISSUING_DIST_POINT {
500 CRL_DIST_POINT_NAME DistPointName;
501 BOOL fOnlyContainsUserCerts;
502 BOOL fOnlyContainsCACerts;
503 CRYPT_BIT_BLOB OnlySomeReasonFlags;
504 BOOL fIndirectCRL;
505 } CRL_ISSUING_DIST_POINT, *PCRL_ISSUING_DIST_POINT;
507 typedef struct _CERT_GENERAL_SUBTREE {
508 CERT_ALT_NAME_ENTRY Base;
509 DWORD dwMinimum;
510 BOOL fMaximum;
511 DWORD dwMaximum;
512 } CERT_GENERAL_SUBTREE, *PCERT_GENERAL_SUBTREE;
514 typedef struct _CERT_NAME_CONSTRAINTS_INFO {
515 DWORD cPermittedSubtree;
516 PCERT_GENERAL_SUBTREE rgPermittedSubtree;
517 DWORD cExcludedSubtree;
518 PCERT_GENERAL_SUBTREE rgExcludedSubtree;
519 } CERT_NAME_CONSTRAINTS_INFO, *PCERT_NAME_CONSTRAINTS_INFO;
521 #define CERT_EXCLUDED_SUBTREE_BIT 0x80000000L
522 #define IS_CERT_EXCLUDED_SUBTREE(x) ((x) & CERT_EXCLUDED_SUBTREE_BIT)
524 typedef struct _CRYPT_ATTRIBUTE {
525 LPSTR pszObjId;
526 DWORD cValue;
527 PCRYPT_DATA_BLOB rgValue;
528 } CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;
530 typedef struct _CRYPT_ATTRIBUTES {
531 DWORD cAttr;
532 PCRYPT_ATTRIBUTE rgAttr;
533 } CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES;
535 typedef struct _CERT_REQUEST_INFO {
536 DWORD dwVersion;
537 CERT_NAME_BLOB Subject;
538 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
539 DWORD cAttribute;
540 PCRYPT_ATTRIBUTE rgAttribute;
541 } CERT_REQUEST_INFO, *PCERT_REQUEST_INFO;
543 typedef struct _CERT_KEYGEN_REQUEST_INFO {
544 DWORD dwVersion;
545 CERT_PUBLIC_KEY_INFO SubjectPubliceKeyInfo;
546 LPWSTR pwszChallengeString;
547 } CERT_KEYGEN_REQUEST_INFO, *PCERT_KEYGEN_REQUEST_INFO;
549 typedef struct _CERT_SIGNED_CONTENT_INFO {
550 CRYPT_DER_BLOB ToBeSigned;
551 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
552 CRYPT_BIT_BLOB Signature;
553 } CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO;
555 typedef struct _CRL_CONTEXT {
556 DWORD dwCertEncodingType;
557 BYTE *pbCrlEncoded;
558 DWORD cbCrlEncoded;
559 PCRL_INFO pCrlInfo;
560 HCERTSTORE hCertStore;
561 } CRL_CONTEXT, *PCRL_CONTEXT;
562 typedef const CRL_CONTEXT *PCCRL_CONTEXT;
564 typedef struct _VTableProvStruc {
565 DWORD Version;
566 FARPROC pFuncVerifyImage;
567 FARPROC pFuncReturnhWnd;
568 DWORD dwProvType;
569 BYTE *pbContextInfo;
570 DWORD cbContextInfo;
571 LPSTR pszProvName;
572 } VTableProvStruc, *PVTableProvStruc;
574 typedef struct _CERT_PRIVATE_KEY_INFO {
575 DWORD Version;
576 CRYPT_ALGORITHM_IDENTIFIER Algorithm;
577 CRYPT_DER_BLOB PrivateKey;
578 PCRYPT_ATTRIBUTES pAttributes;
579 } CERT_PRIVATE_KEY_INFO, *PCERT_PRIVATE_KEY_INFO;
581 typedef struct _CTL_USAGE {
582 DWORD cUsageIdentifier;
583 LPSTR *rgpszUsageIdentifier;
584 } CTL_USAGE, *PCTL_USAGE, CERT_ENHKEY_USAGE, *PCERT_ENHKEY_USAGE;
586 typedef struct _CTL_ENTRY {
587 CRYPT_DATA_BLOB SubjectIdentifier;
588 DWORD cAttribute;
589 PCRYPT_ATTRIBUTE rgAttribute;
590 } CTL_ENTRY, *PCTL_ENTRY;
592 typedef struct _CTL_INFO {
593 DWORD dwVersion;
594 CTL_USAGE SubjectUsage;
595 CRYPT_DATA_BLOB ListIdentifier;
596 CRYPT_INTEGER_BLOB SequenceNumber;
597 FILETIME ThisUpdate;
598 FILETIME NextUpdate;
599 CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm;
600 DWORD cCTLEntry;
601 PCTL_ENTRY rgCTLEntry;
602 DWORD cExtension;
603 PCERT_EXTENSION rgExtension;
604 } CTL_INFO, *PCTL_INFO;
606 typedef struct _CTL_CONTEXT {
607 DWORD dwMsgAndCertEncodingType;
608 BYTE *pbCtlEncoded;
609 DWORD cbCtlEncoded;
610 PCTL_INFO pCtlInfo;
611 HCERTSTORE hCertStore;
612 HCRYPTMSG hCryptMsg;
613 BYTE *pbCtlContext;
614 DWORD cbCtlContext;
615 } CTL_CONTEXT, *PCTL_CONTEXT;
616 typedef const CTL_CONTEXT *PCCTL_CONTEXT;
618 typedef struct _CRYPT_TIME_STAMP_REQUEST_INFO {
619 LPSTR pszTimeStampAlgorithm;
620 LPSTR pszContentType;
621 CRYPT_OBJID_BLOB Content;
622 DWORD cAttribute;
623 PCRYPT_ATTRIBUTE rgAttribute;
624 } CRYPT_TIME_STAMP_REQUEST_INFO, *PCRYPT_TIME_STAMP_REQUEST_INFO;
626 typedef struct _CRYPT_ENROLLMENT_NAME_VALUE_PAIR {
627 LPWSTR pwszName;
628 LPWSTR pwszValue;
629 } CRYPT_ENROLLMENT_NAME_VALUE_PAIR, *PCRYPT_ENROLLMENT_NAME_VALUE_PAIR;
631 typedef struct _CMSG_SIGNER_INFO {
632 DWORD dwVersion;
633 CERT_NAME_BLOB Issuer;
634 CRYPT_INTEGER_BLOB SerialNumber;
635 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
636 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
637 CRYPT_DATA_BLOB EncryptedHash;
638 CRYPT_ATTRIBUTES AuthAttrs;
639 CRYPT_ATTRIBUTES UnauthAttrs;
640 } CMSG_SIGNER_INFO, *PCMSG_SIGNER_INFO;
642 #define CMSG_VERIFY_SIGNER_PUBKEY 1
643 #define CMSG_VERIFY_SIGNER_CERT 2
644 #define CMSG_VERIFY_SIGNER_CHAIN 3
645 #define CMSG_VERIFY_SIGNER_NULL 4
647 typedef struct _CERT_REVOCATION_CRL_INFO {
648 DWORD cbSize;
649 PCCRL_CONTEXT pBaseCrlContext;
650 PCCRL_CONTEXT pDeltaCrlContext;
651 PCRL_ENTRY pCrlEntry;
652 BOOL fDeltaCrlEntry;
653 } CERT_REVOCATION_CRL_INFO, *PCERT_REVOCATION_CRL_INFO;
655 typedef struct _CERT_REVOCATION_INFO {
656 DWORD cbSize;
657 DWORD dwRevocationResult;
658 LPCSTR pszRevocationOid;
659 LPVOID pvOidSpecificInfo;
660 BOOL fHasFreshnessTime;
661 DWORD dwFreshnessTime;
662 PCERT_REVOCATION_CRL_INFO pCrlInfo;
663 } CERT_REVOCATION_INFO, *PCERT_REVOCATION_INFO;
665 typedef struct _CERT_REVOCATION_PARA {
666 DWORD cbSize;
667 PCCERT_CONTEXT pIssuerCert;
668 DWORD cCertStore;
669 HCERTSTORE *rgCertStore;
670 HCERTSTORE hCrlStore;
671 LPFILETIME pftTimeToUse;
672 #ifdef CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
673 DWORD dwUrlRetrievalTimeout;
674 BOOL fCheckFreshnessTime;
675 DWORD dwFreshnessTime;
676 LPFILETIME pftCurrentTime;
677 PCERT_REVOCATION_CRL_INFO pCrlInfo;
678 #endif
679 } CERT_REVOCATION_PARA, *PCERT_REVOCATION_PARA;
681 #define CERT_CONTEXT_REVOCATION_TYPE 1
682 #define CERT_VERIFY_REV_CHAIN_FLAG 0x00000001
683 #define CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION 0x00000002
684 #define CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG 0x00000004
686 typedef struct _CTL_VERIFY_USAGE_PARA {
687 DWORD cbSize;
688 CRYPT_DATA_BLOB ListIdentifier;
689 DWORD cCtlStore;
690 HCERTSTORE *rghCtlStore;
691 DWORD cSignerStore;
692 HCERTSTORE *rghSignerStore;
693 } CTL_VERIFY_USAGE_PARA, *PCTL_VERIFY_USAGE_PARA;
695 typedef struct _CTL_VERIFY_USAGE_STATUS {
696 DWORD cbSize;
697 DWORD dwError;
698 DWORD dwFlags;
699 PCCTL_CONTEXT *ppCtl;
700 DWORD dwCtlEntryIndex;
701 PCCERT_CONTEXT *ppSigner;
702 DWORD dwSignerIndex;
703 } CTL_VERIFY_USAGE_STATUS, *PCTL_VERIFY_USAGE_STATUS;
705 #define CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG 0x1
706 #define CERT_VERIFY_TRUSTED_SIGNERS_FLAG 0x2
707 #define CERT_VERIFY_NO_TIME_CHECK_FLAG 0x4
708 #define CERT_VERIFY_ALLOW_MORE_USAGE_FLAG 0x8
709 #define CERT_VERIFY_UPDATED_CTL_FLAG 0x1
711 typedef struct _CERT_REVOCATION_STATUS {
712 DWORD cbSize;
713 DWORD dwIndex;
714 DWORD dwError;
715 DWORD dwReason;
716 BOOL fHasFreshnessTime;
717 DWORD dwFreshnessTime;
718 } CERT_REVOCATION_STATUS, *PCERT_REVOCATION_STATUS;
720 typedef struct _CERT_TRUST_LIST_INFO {
721 DWORD cbSize;
722 PCTL_ENTRY pCtlEntry;
723 PCCTL_CONTEXT pCtlContext;
724 } CERT_TRUST_LIST_INFO, *PCERT_TRUST_LIST_INFO;
726 #define CERT_TRUST_NO_ERROR 0x00000000
727 #define CERT_TRUST_IS_NOT_TIME_VALID 0x00000001
728 #define CERT_TRUST_IS_NOT_TIME_NESTED 0x00000002
729 #define CERT_TRUST_IS_REVOKED 0x00000004
730 #define CERT_TRUST_IS_NOT_SIGNATURE_VALID 0x00000008
731 #define CERT_TRUST_IS_NOT_VALID_FOR_USAGE 0x00000010
732 #define CERT_TRUST_IS_UNTRUSTED_ROOT 0x00000020
733 #define CERT_TRUST_REVOCATION_STATUS_UNKNOWN 0x00000040
734 #define CERT_TRUST_IS_CYCLIC 0x00000080
735 #define CERT_TRUST_INVALID_EXTENSION 0x00000100
736 #define CERT_TRUST_INVALID_POLICY_CONSTRAINTS 0x00000200
737 #define CERT_TRUST_INVALID_BASIC_CONSTRAINTS 0x00000400
738 #define CERT_TRUST_INVALID_NAME_CONSTRAINTS 0x00000800
739 #define CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT 0x00001000
740 #define CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT 0x00002000
741 #define CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT 0x00004000
742 #define CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT 0x00008000
743 #define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000
744 #define CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY 0x02000000
746 #define CERT_TRUST_IS_PARTIAL_CHAIN 0x00001000
747 #define CERT_TRUST_CTL_IS_NOT_TIME_VALID 0x00002000
748 #define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 0x00004000
749 #define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 0x00008000
751 #define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 0x00000001
752 #define CERT_TRUST_HAS_KEY_MATCH_ISSUER 0x00000002
753 #define CERT_TRUST_HAS_NAME_MATCH_ISSUER 0x00000004
754 #define CERT_TRUST_IS_SELF_SIGNED 0x00000008
756 #define CERT_TRUST_HAS_PREFERRED_ISSUER 0x00000100
757 #define CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY 0x00000200
758 #define CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS 0x00000400
760 #define CERT_TRUST_IS_COMPLEX_CHAIN 0x00010000
762 typedef struct _CERT_TRUST_STATUS {
763 DWORD dwErrorStatus;
764 DWORD dwInfoStatus;
765 } CERT_TRUST_STATUS, *PCERT_TRUST_STATUS;
767 typedef struct _CERT_CHAIN_ELEMENT {
768 DWORD cbSize;
769 PCCERT_CONTEXT pCertContext;
770 CERT_TRUST_STATUS TrustStatus;
771 PCERT_REVOCATION_INFO pRevocationInfo;
772 PCERT_ENHKEY_USAGE pIssuanceUsage;
773 PCERT_ENHKEY_USAGE pApplicationUsage;
774 LPCWSTR pwszExtendedErrorInfo;
775 } CERT_CHAIN_ELEMENT, *PCERT_CHAIN_ELEMENT;
777 typedef struct _CERT_SIMPLE_CHAIN {
778 DWORD cbSize;
779 CERT_TRUST_STATUS TrustStatus;
780 DWORD cElement;
781 PCERT_CHAIN_ELEMENT *rgpElement;
782 PCERT_TRUST_LIST_INFO pTrustListInfo;
783 BOOL fHasRevocationFreshnessTime;
784 DWORD dwRevocationFreshnessTime;
785 } CERT_SIMPLE_CHAIN, *PCERT_SIMPLE_CHAIN;
787 typedef struct _CERT_CHAIN_CONTEXT CERT_CHAIN_CONTEXT, *PCERT_CHAIN_CONTEXT;
788 typedef const CERT_CHAIN_CONTEXT *PCCERT_CHAIN_CONTEXT;
790 struct _CERT_CHAIN_CONTEXT {
791 DWORD cbSize;
792 CERT_TRUST_STATUS TrustStatus;
793 DWORD cChain;
794 PCERT_SIMPLE_CHAIN *rgpChain;
795 DWORD cLowerQualityChainContext;
796 PCCERT_CHAIN_CONTEXT *rgpLowerQualityChainContext;
797 BOOL fHasRevocationFreshnessTime;
798 DWORD dwRevocationFreshnessTime;
801 typedef struct _CERT_CHAIN_POLICY_PARA {
802 DWORD cbSize;
803 DWORD dwFlags;
804 void *pvExtraPolicyPara;
805 } CERT_CHAIN_POLICY_PARA, *PCERT_CHAIN_POLICY_PARA;
807 typedef struct _CERT_CHAIN_POLICY_STATUS {
808 DWORD cbSize;
809 DWORD dwError;
810 LONG lChainIndex;
811 LONG lElementIndex;
812 void *pvExtraPolicyStatus;
813 } CERT_CHAIN_POLICY_STATUS, *PCERT_CHAIN_POLICY_STATUS;
815 #define CERT_CHAIN_POLICY_BASE ((LPCSTR)1)
816 #define CERT_CHAIN_POLICY_AUTHENTICODE ((LPCSTR)2)
817 #define CERT_CHAIN_POLICY_AUTHENTICODE_TS ((LPCSTR)3)
818 #define CERT_CHAIN_POLICY_SSL ((LPCSTR)4)
819 #define CERT_CHAIN_POLICY_BASIC_CONSTRAINTS ((LPCSTR)5)
820 #define CERT_CHAIN_POLICY_NT_AUTH ((LPCSTR)6)
821 #define CERT_CHAIN_POLICY_MICROSOFT_ROOT ((LPCSTR)7)
823 #define CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG 0x00000001
824 #define CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG 0x00000002
825 #define CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG 0x00000004
826 #define CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG 0x00000008
828 #define CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS ( \
829 CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG \
830 CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG \
831 CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG )
833 #define CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG 0x00000010
834 #define CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG 0x00000020
835 #define CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG 0x00000040
836 #define CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG 0x00000080
838 #define CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG 0x00000100
839 #define CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG 0x00000200
840 #define CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG 0x00000400
841 #define CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG 0x00000800
843 #define CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS ( \
844 CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG \
845 CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG \
846 CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG \
847 CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG )
849 #define CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG 0x00004000
850 #define CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG 0x00008000
851 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000
853 typedef struct _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA {
854 DWORD cbSize;
855 DWORD dwRegPolicySettings;
856 PCMSG_SIGNER_INFO pSignerInfo;
857 } AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA,
858 *PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA;
860 typedef struct _AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS {
861 DWORD cbSize;
862 BOOL fCommercial;
863 } AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS,
864 *PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS;
866 typedef struct _AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA {
867 DWORD cbSize;
868 DWORD dwRegPolicySettings;
869 BOOL fCommercial;
870 } AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA,
871 *PAUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA;
873 typedef struct _HTTPSPolicyCallbackData {
874 union {
875 DWORD cbStruct;
876 DWORD cbSize;
877 } DUMMYUNIONNAME;
878 DWORD dwAuthType;
879 DWORD fdwChecks;
880 WCHAR *pwszServerName;
881 } HTTPSPolicyCallbackData, *PHTTPSPolicyCallbackData,
882 SSL_EXTRA_CERT_CHAIN_POLICY_PARA, *PSSL_EXTRA_CERT_CHAIN_POLICY_PARA;
884 /* Values for HTTPSPolicyCallbackData's dwAuthType */
885 #define AUTHTYPE_CLIENT 1
886 #define AUTHTYPE_SERVER 2
887 /* Values for HTTPSPolicyCallbackData's fdwChecks are defined in wininet.h */
889 #define BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG 0x80000000
890 #define BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG 0x40000000
892 #define MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG 0x00010000
894 #define USAGE_MATCH_TYPE_AND 0x00000000
895 #define USAGE_MATCH_TYPE_OR 0x00000001
897 typedef struct _CERT_USAGE_MATCH {
898 DWORD dwType;
899 CERT_ENHKEY_USAGE Usage;
900 } CERT_USAGE_MATCH, *PCERT_USAGE_MATCH;
902 typedef struct _CTL_USAGE_MATCH {
903 DWORD dwType;
904 CTL_USAGE Usage;
905 } CTL_USAGE_MATCH, *PCTL_USAGE_MATCH;
907 #define CERT_CHAIN_REVOCATION_CHECK_END_CERT 0x10000000
908 #define CERT_CHAIN_REVOCATION_CHECK_CHAIN 0x20000000
909 #define CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT 0x40000000
910 #define CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY 0x80000000
912 #define CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT 0x08000000
914 #define CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING 0x00000040
915 #define CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS 0x00000080
916 #define CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE 0x00000100
917 #define CERT_CHAIN_TIMESTAMP_TIME 0x00000200
919 typedef struct _CERT_CHAIN_PARA {
920 DWORD cbSize;
921 CERT_USAGE_MATCH RequestedUsage;
922 #ifdef CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
923 CERT_USAGE_MATCH RequestedIssuancePolicy;
924 DWORD dwUrlRetrievalTimeout;
925 BOOL fCheckRevocationFreshnessTime;
926 DWORD dwRevocationFreshnessTime;
927 #endif
928 } CERT_CHAIN_PARA, *PCERT_CHAIN_PARA;
930 typedef struct _CERT_SYSTEM_STORE_INFO {
931 DWORD cbSize;
932 } CERT_SYSTEM_STORE_INFO, *PCERT_SYSTEM_STORE_INFO;
934 typedef struct _CERT_PHYSICAL_STORE_INFO {
935 DWORD cbSize;
936 LPSTR pszOpenStoreProvider;
937 DWORD dwOpenEncodingType;
938 DWORD dwOpenFlags;
939 CRYPT_DATA_BLOB OpenParameters;
940 DWORD dwFlags;
941 DWORD dwPriority;
942 } CERT_PHYSICAL_STORE_INFO, *PCERT_PHYSICAL_STORE_INFO;
944 typedef struct _CERT_SYSTEM_STORE_RELOCATE_PARA {
945 union {
946 HKEY hKeyBase;
947 VOID *pvBase;
948 } DUMMYUNIONNAME;
949 union {
950 void *pvSystemStore;
951 LPCSTR pszSystemStore;
952 LPCWSTR pwszSystemStore;
953 } DUMMYUNIONNAME2;
954 } CERT_SYSTEM_STORE_RELOCATE_PARA, *PCERT_SYSTEM_STORE_RELOCATE_PARA;
956 typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)(
957 LPCWSTR pwszStoreLocation, DWORD dwFlags, void *pvReserved, void *pvArg);
959 typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE)(const void *pvSystemStore,
960 DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved,
961 void *pvArg);
963 typedef BOOL (WINAPI *PFN_CERT_ENUM_PHYSICAL_STORE)(const void *pvSystemStore,
964 DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo,
965 void *pvReserved, void *pvArg);
967 /* Encode/decode object */
968 typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)(size_t cbsize);
969 typedef VOID (WINAPI *PFN_CRYPT_FREE)(LPVOID pv);
971 typedef struct _CRYPT_ENCODE_PARA {
972 DWORD cbSize;
973 PFN_CRYPT_ALLOC pfnAlloc;
974 PFN_CRYPT_FREE pfnFree;
975 } CRYPT_ENCODE_PARA, *PCRYPT_ENCODE_PARA;
977 typedef struct _CRYPT_DECODE_PARA {
978 DWORD cbSize;
979 PFN_CRYPT_ALLOC pfnAlloc;
980 PFN_CRYPT_FREE pfnFree;
981 } CRYPT_DECODE_PARA, *PCRYPT_DECODE_PARA;
983 typedef struct _CERT_STORE_PROV_INFO {
984 DWORD cbSize;
985 DWORD cStoreProvFunc;
986 void **rgpvStoreProvFunc;
987 HCERTSTOREPROV hStoreProv;
988 DWORD dwStoreProvFlags;
989 HCRYPTOIDFUNCADDR hStoreProvFuncAddr2;
990 } CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO;
992 typedef BOOL (WINAPI *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(
993 LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV_LEGACY hCryptProv,
994 DWORD dwFlags, const void *pvPara, HCERTSTORE hCertStore,
995 PCERT_STORE_PROV_INFO pStoreProvInfo);
997 typedef void (WINAPI *PFN_CERT_STORE_PROV_CLOSE)(HCERTSTOREPROV hStoreProv,
998 DWORD dwFlags);
1000 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)(HCERTSTOREPROV hStoreProv,
1001 PCCERT_CONTEXT pStoreCertContext, DWORD dwFlags,
1002 PCCERT_CONTEXT *ppProvCertContext);
1004 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CERT)(HCERTSTOREPROV hStoreProv,
1005 PCCERT_CONTEXT pCertContext, DWORD dwFlags);
1007 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CERT)(
1008 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwFlags);
1010 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CERT_PROPERTY)(
1011 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwPropId,
1012 DWORD dwFlags, const void *pvData);
1014 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)(HCERTSTOREPROV hStoreProv,
1015 PCCRL_CONTEXT pStoreCrlContext, DWORD dwFlags,
1016 PCCRL_CONTEXT *ppProvCrlContext);
1018 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CRL)(HCERTSTOREPROV hStoreProv,
1019 PCCRL_CONTEXT pCrlContext, DWORD dwFlags);
1021 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CRL)(HCERTSTOREPROV hStoreProv,
1022 PCCRL_CONTEXT pCrlContext, DWORD dwFlags);
1024 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CRL_PROPERTY)(
1025 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext, DWORD dwPropId,
1026 DWORD dwFlags, const void *pvData);
1028 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)(HCERTSTOREPROV hStoreProv,
1029 PCCTL_CONTEXT pStoreCtlContext, DWORD dwFlags,
1030 PCCTL_CONTEXT *ppProvCtlContext);
1032 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CTL)(HCERTSTOREPROV hStoreProv,
1033 PCCTL_CONTEXT pCtlContext, DWORD dwFlags);
1035 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CTL)(
1036 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwFlags);
1038 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CTL_PROPERTY)(
1039 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwPropId,
1040 DWORD dwFlags, const void *pvData);
1042 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)(HCERTSTOREPROV hStoreProv,
1043 DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara);
1045 typedef struct _CERT_STORE_PROV_FIND_INFO {
1046 DWORD cbSize;
1047 DWORD dwMsgAndCertEncodingType;
1048 DWORD dwFindFlags;
1049 DWORD dwFindType;
1050 const void *pvFindPara;
1051 } CERT_STORE_PROV_FIND_INFO, *PCERT_STORE_PROV_FIND_INFO;
1052 typedef const CERT_STORE_PROV_FIND_INFO CCERT_STORE_PROV_FIND_INFO,
1053 *PCCERT_STORE_PROV_FIND_INFO;
1055 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CERT)(HCERTSTOREPROV hStoreProv,
1056 PCCERT_STORE_PROV_FIND_INFO pFindInfo, PCCERT_CONTEXT pPrevCertContext,
1057 DWORD dwFlags, void **ppvStoreProvFindInfo, PCCERT_CONTEXT *ppProvCertContext);
1059 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CERT)(
1060 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext,
1061 void *pvStoreProvFindInfo, DWORD dwFlags);
1063 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CERT_PROPERTY)(
1064 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwPropId,
1065 DWORD dwFlags, void *pvData, DWORD *pcbData);
1067 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CRL)(HCERTSTOREPROV hStoreProv,
1068 PCCERT_STORE_PROV_FIND_INFO pFindInfo, PCCRL_CONTEXT pPrevCrlContext,
1069 DWORD dwFlags, void **ppvStoreProvFindInfo, PCCRL_CONTEXT *ppProvCrlContext);
1071 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FREE_FIND_CRL)(
1072 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext,
1073 void *pvStoreProvFindInfo, DWORD dwFlags);
1075 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CRL_PROPERTY)(
1076 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext, DWORD dwPropId,
1077 DWORD dwFlags, void *pvData, DWORD *pcbData);
1079 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_FIND_CTL)(HCERTSTOREPROV hStoreProv,
1080 PCCTL_CONTEXT pCtlContext, void *pvStoreProvFindInfo, DWORD dwFlags);
1082 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_GET_CTL_PROPERTY)(
1083 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwPropId,
1084 DWORD dwFlags, void *pvData);
1086 typedef struct _CERT_CREATE_CONTEXT_PARA {
1087 DWORD cbSize;
1088 PFN_CRYPT_FREE pfnFree;
1089 void *pvFree;
1090 } CERT_CREATE_CONTEXT_PARA, *PCERT_CREATE_CONTEXT_PARA;
1092 typedef struct _CRYPT_OID_FUNC_ENTRY {
1093 LPCSTR pszOID;
1094 void *pvFuncAddr;
1095 } CRYPT_OID_FUNC_ENTRY, *PCRYPT_OID_FUNC_ENTRY;
1097 typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_FUNC)(DWORD dwEncodingType,
1098 LPCSTR pszFuncName, LPCSTR pszOID, DWORD cValue, const DWORD rgdwValueType[],
1099 LPCWSTR const rgpwszValueName[], const BYTE * const rgpbValueData[],
1100 const DWORD rgcbValueData[], void *pvArg);
1102 #define CRYPT_MATCH_ANY_ENCODING_TYPE 0xffffffff
1104 typedef struct _CRYPT_OID_INFO {
1105 DWORD cbSize;
1106 LPCSTR pszOID;
1107 LPCWSTR pwszName;
1108 DWORD dwGroupId;
1109 union {
1110 DWORD dwValue;
1111 ALG_ID Algid;
1112 DWORD dwLength;
1113 } DUMMYUNIONNAME;
1114 CRYPT_DATA_BLOB ExtraInfo;
1115 } CRYPT_OID_INFO, *PCRYPT_OID_INFO;
1116 typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO;
1118 typedef BOOL (WINAPI *PFN_CRYPT_ENUM_OID_INFO)(PCCRYPT_OID_INFO pInfo,
1119 void *pvArg);
1121 typedef struct _CRYPT_SIGN_MESSAGE_PARA {
1122 DWORD cbSize;
1123 DWORD dwMsgEncodingType;
1124 PCCERT_CONTEXT pSigningCert;
1125 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
1126 void * pvHashAuxInfo;
1127 DWORD cMsgCert;
1128 PCCERT_CONTEXT *rgpMsgCert;
1129 DWORD cMsgCrl;
1130 PCCRL_CONTEXT *rgpMsgCrl;
1131 DWORD cAuthAttr;
1132 PCRYPT_ATTRIBUTE rgAuthAttr;
1133 DWORD cUnauthAttr;
1134 PCRYPT_ATTRIBUTE rgUnauthAttr;
1135 DWORD dwFlags;
1136 DWORD dwInnerContentType;
1137 #ifdef CRYPT_SIGN_MESSAGE_PARA_HAS_CMS_FIELDS
1138 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
1139 void * pvHashEncryptionAuxInfo;
1140 #endif
1141 } CRYPT_SIGN_MESSAGE_PARA, *PCRYPT_SIGN_MESSAGE_PARA;
1143 #define CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG 0x00000001
1144 #define CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG 0x00000002
1145 #define CRYPT_MESSAGE_KEYID_SIGNER_FLAG 0x00000004
1146 #define CRYPT_MESSAGE_SILENT_KEYSET_FLAG 0x00000008
1148 typedef PCCERT_CONTEXT (WINAPI *PFN_CRYPT_GET_SIGNER_CERTIFICATE)(void *pvArg,
1149 DWORD dwCertEncodingType, PCERT_INFO pSignerId, HCERTSTORE hMsgCertStore);
1151 typedef struct _CRYPT_VERIFY_MESSAGE_PARA {
1152 DWORD cbSize;
1153 DWORD dwMsgAndCertEncodingType;
1154 HCRYPTPROV_LEGACY hCryptProv;
1155 PFN_CRYPT_GET_SIGNER_CERTIFICATE pfnGetSignerCertificate;
1156 void * pvGetArg;
1157 } CRYPT_VERIFY_MESSAGE_PARA, *PCRYPT_VERIFY_MESSAGE_PARA;
1159 typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA {
1160 DWORD cbSize;
1161 DWORD dwMsgEncodingType;
1162 HCRYPTPROV_LEGACY hCryptProv;
1163 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
1164 void * pvEncryptionAuxInfo;
1165 DWORD dwFlags;
1166 DWORD dwInnerContentType;
1167 } CRYPT_ENCRYPT_MESSAGE_PARA, *PCRYPT_ENCRYPT_MESSAGE_PARA;
1169 #define CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG 0x00000004
1171 typedef struct _CRYPT_DECRYPT_MESSAGE_PARA {
1172 DWORD cbSize;
1173 DWORD dwMsgAndCertEncodingType;
1174 DWORD cCertStore;
1175 HCERTSTORE *rghCertStore;
1176 #ifdef CRYPT_DECRYPT_MESSAGE_PARA_HAS_EXTRA_FIELDS
1177 DWORD dwFlags;
1178 #endif
1179 } CRYPT_DECRYPT_MESSAGE_PARA, *PCRYPT_DECRYPT_MESSAGE_PARA;
1181 typedef struct _CRYPT_HASH_MESSAGE_PARA {
1182 DWORD cbSize;
1183 DWORD dwMsgEncodingType;
1184 HCRYPTPROV_LEGACY hCryptProv;
1185 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
1186 void * pvHashAuxInfo;
1187 } CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA;
1189 typedef struct _CRYPT_KEY_SIGN_MESSAGE_PARA {
1190 DWORD cbSize;
1191 DWORD dwMsgAndCertEncodingType;
1192 HCRYPTPROV hCryptProv;
1193 DWORD dwKeySpec;
1194 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
1195 void * pvHashAuxInfo;
1196 } CRYPT_KEY_SIGN_MESSAGE_PARA, *PCRYPT_KEY_SIGN_MESSAGE_PARA;
1198 typedef struct _CRYPT_KEY_VERIFY_MESSAGE_PARA {
1199 DWORD cbSize;
1200 DWORD dwMsgEncodingType;
1201 HCRYPTPROV_LEGACY hCryptProv;
1202 } CRYPT_KEY_VERIFY_MESSAGE_PARA, *PCRYPT_KEY_VERIFY_MESSAGE_PARA;
1204 typedef struct _CRYPT_URL_ARRAY {
1205 DWORD cUrl;
1206 LPWSTR *rgwszUrl;
1207 } CRYPT_URL_ARRAY, *PCRYPT_URL_ARRAY;
1209 typedef struct _CRYPT_URL_INFO {
1210 DWORD cbSize;
1211 DWORD dwSyncDeltaTime;
1212 DWORD cGroup;
1213 DWORD *rgcGroupEntry;
1214 } CRYPT_URL_INFO, *PCRYPT_URL_INFO;
1216 #define URL_OID_CERTIFICATE_ISSUER ((LPCSTR)1)
1217 #define URL_OID_CERTIFICATE_CRL_DIST_POINT ((LPCSTR)2)
1218 #define URL_OID_CTL_ISSUER ((LPCSTR)3)
1219 #define URL_OID_CTL_NEXT_UPDATE ((LPCSTR)4)
1220 #define URL_OID_CRL_ISSUER ((LPCSTR)5)
1221 #define URL_OID_CERTIFICATE_FRESHEST_CRL ((LPCSTR)6)
1222 #define URL_OID_CRL_FRESHEST_CRL ((LPCSTR)7)
1223 #define URL_OID_CROSS_CERT_DIST_POINT ((LPCSTR)8)
1225 #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
1227 typedef HANDLE HCRYPTASYNC, *PHCRYPTASYNC;
1229 typedef void (WINAPI *PFN_CRYPT_ASYNC_PARAM_FREE_FUNC)(LPSTR pszParamOid,
1230 LPVOID pvParam);
1232 #define CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION ((LPCSTR)1)
1233 #define CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL ((LPCSTR)2)
1235 typedef void (WINAPI *PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC)(
1236 void *pvCompletion, DWORD dwCompletionCode, LPCSTR pszURL, LPSTR pszObjectOid,
1237 void *pvObject);
1239 typedef struct _CRYPT_ASYNC_RETRIEVAL_COMPLETION
1241 PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC pfnCompletion;
1242 void *pvCompletion;
1243 } CRYPT_ASYNC_RETRIEVAL_COMPLETION, *PCRYPT_ASYNC_RETRIEVAL_COMPLETION;
1245 typedef BOOL (WINAPI *PFN_CANCEL_ASYNC_RETRIEVAL_FUNC)(
1246 HCRYPTASYNC hAsyncRetrieve);
1248 typedef struct _CRYPT_BLOB_ARRAY
1250 DWORD cBlob;
1251 PCRYPT_DATA_BLOB rgBlob;
1252 } CRYPT_BLOB_ARRAY, *PCRYPT_BLOB_ARRAY;
1254 typedef struct _CRYPT_CREDENTIALS {
1255 DWORD cbSize;
1256 LPCSTR pszCredentialsOid;
1257 LPVOID pvCredentials;
1258 } CRYPT_CREDENTIALS, *PCRYPT_CREDENTIALS;
1260 #define CREDENTIAL_OID_PASSWORD_CREDENTIALS_A ((LPCSTR)1)
1261 #define CREDENTIAL_OID_PASSWORD_CREDENTIALS_W ((LPCSTR)2)
1262 #define CREDENTIAL_OID_PASSWORD_CREDENTIALS \
1263 WINELIB_NAME_AW(CREDENTIAL_OID_PASSWORD_CREDENTIALS_)
1265 typedef struct _CRYPT_PASSWORD_CREDENTIALSA {
1266 DWORD cbSize;
1267 LPSTR pszUsername;
1268 LPSTR pszPassword;
1269 } CRYPT_PASSWORD_CREDENTIALSA, *PCRYPT_PASSWORD_CREDENTIALSA;
1271 typedef struct _CRYPT_PASSWORD_CREDENTIALSW {
1272 DWORD cbSize;
1273 LPWSTR pszUsername;
1274 LPWSTR pszPassword;
1275 } CRYPT_PASSWORD_CREDENTIALSW, *PCRYPT_PASSWORD_CREDENTIALSW;
1276 #define CRYPT_PASSWORD_CREDENTIALS WINELIB_NAME_AW(CRYPT_PASSWORD_CREDENTIALS)
1277 #define PCRYPT_PASSWORD_CREDENTIALS WINELIB_NAME_AW(PCRYPT_PASSWORD_CREDENTIALS)
1279 typedef struct _CRYPT_RETRIEVE_AUX_INFO {
1280 DWORD cbSize;
1281 FILETIME *pLastSyncTime;
1282 DWORD dwMaxUrlRetrievalByteCount;
1283 } CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO;
1285 typedef void (WINAPI *PFN_FREE_ENCODED_OBJECT_FUNC)(LPCSTR pszObjectOid,
1286 PCRYPT_BLOB_ARRAY pObject, void *pvFreeContext);
1288 #define SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC \
1289 "SchemeDllRetrieveEncodedObject"
1290 #define SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC \
1291 "SchemeDllRetrieveEncodedObjectW"
1292 /* The signature of SchemeDllRetrieveEncodedObjectW is:
1293 BOOL WINAPI SchemeDllRetrieveEncodedObjectW(LPCWSTR pwszUrl,
1294 LPCSTR pszObjectOid, DWORD dwRetrievalFlags, DWORD dwTimeout,
1295 PCRYPT_BLOB_ARRAY pObject, PFN_FREE_ENCODED_OBJECT_FUNC *ppfnFreeObject,
1296 void **ppvFreeContext, HCRYPTASYNC hAsyncRetrieve,
1297 PCRYPT_CREDENTIALS pCredentials, PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
1300 #define CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC "ContextDllCreateObjectContext"
1301 /* The signature of ContextDllCreateObjectContext is:
1302 BOOL WINAPI ContextDllCreateObjectContext(LPCSTR pszObjectOid,
1303 DWORD dwRetrievalFlags, PCRYPT_BLOB_ARRAY pObject, void **ppvContxt);
1306 #define CONTEXT_OID_CERTIFICATE ((LPCSTR)1)
1307 #define CONTEXT_OID_CRL ((LPCSTR)2)
1308 #define CONTEXT_OID_CTL ((LPCSTR)3)
1309 #define CONTEXT_OID_PKCS7 ((LPCSTR)4)
1310 #define CONTEXT_OID_CAPI2_ANY ((LPCSTR)5)
1312 #define CRYPT_RETRIEVE_MULTIPLE_OBJECTS 0x00000001
1313 #define CRYPT_CACHE_ONLY_RETRIEVAL 0x00000002
1314 #define CRYPT_WIRE_ONLY_RETRIEVAL 0x00000004
1315 #define CRYPT_DONT_CACHE_RESULT 0x00000008
1316 #define CRYPT_ASYNC_RETRIEVAL 0x00000010
1317 #define CRYPT_STICKY_CACHE_RETRIEVAL 0x00001000
1318 #define CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL 0x00002000
1319 #define CRYPT_OFFLINE_CHECK_RETRIEVAL 0x00004000
1320 #define CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE 0x00008000
1321 #define CRYPT_LDAP_SIGN_RETRIEVAL 0x00010000
1322 #define CRYPT_NO_AUTH_RETRIEVAL 0x00020000
1323 #define CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL 0x00040000
1324 #define CRYPT_AIA_RETRIEVAL 0x00080000
1326 #define CRYPT_VERIFY_CONTEXT_SIGNATURE 0x00000020
1327 #define CRYPT_VERIFY_DATA_HASH 0x00000040
1328 #define CRYPT_KEEP_TIME_VALID 0x00000080
1329 #define CRYPT_DONT_VERIFY_SIGNATURE 0x00000100
1330 #define CRYPT_DONT_CHECK_TIME_VALIDITY 0x00000200
1331 #define CRYPT_CHECK_FRESHNESS_TIME_VALIDITY 0x00000400
1332 #define CRYPT_ACCUMULATIVE_TIMEOUT 0x00000800
1334 typedef BOOL (WINAPI *PFN_CRYPT_CANCEL_RETRIEVAL)(DWORD dwFlags, void *pvArg);
1336 typedef struct _CERT_CRL_CONTEXT_PAIR
1338 PCCERT_CONTEXT pCertContext;
1339 PCCRL_CONTEXT pCrlContext;
1340 } CERT_CRL_CONTEXT_PAIR, *PCERT_CRL_CONTEXT_PAIR;
1341 typedef const CERT_CRL_CONTEXT_PAIR *PCCERT_CRL_CONTEXT_PAIR;
1343 #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
1345 #define TIME_VALID_OID_GET_CTL ((LPCSTR)1)
1346 #define TIME_VALID_OID_GET_CRL ((LPCSTR)2)
1347 #define TIME_VALID_OID_GET_CRL_FROM_CERT ((LPCSTR)3)
1348 #define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT ((LPCSTR)4)
1349 #define TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL ((LPCSTR)5)
1351 #define TIME_VALID_OID_FLUSH_OBJECT_FUNC "TimeValidDllFlushObject"
1353 #define TIME_VALID_OID_FLUSH_CTL ((LPCSTR)1)
1354 #define TIME_VALID_OID_FLUSH_CRL ((LPCSTR)2)
1355 #define TIME_VALID_OID_FLUSH_CRL_FROM_CERT ((LPCSTR)3)
1356 #define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT ((LPCSTR)4)
1357 #define TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL ((LPCSTR)5)
1359 /* OID group IDs */
1360 #define CRYPT_HASH_ALG_OID_GROUP_ID 1
1361 #define CRYPT_ENCRYPT_ALG_OID_GROUP_ID 2
1362 #define CRYPT_PUBKEY_ALG_OID_GROUP_ID 3
1363 #define CRYPT_SIGN_ALG_OID_GROUP_ID 4
1364 #define CRYPT_RDN_ATTR_OID_GROUP_ID 5
1365 #define CRYPT_EXT_OR_ATTR_OID_GROUP_ID 6
1366 #define CRYPT_ENHKEY_USAGE_OID_GROUP_ID 7
1367 #define CRYPT_POLICY_OID_GROUP_ID 8
1368 #define CRYPT_TEMPLATE_OID_GROUP_ID 9
1369 #define CRYPT_LAST_OID_GROUP_ID 9
1371 #define CRYPT_FIRST_ALG_OID_GROUP_ID CRYPT_HASH_ALG_OID_GROUP_ID
1372 #define CRYPT_LAST_ALG_OID_GROUP_ID CRYPT_SIGN_ALG_OID_GROUP_ID
1374 #define CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG 0x1
1375 #define CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG 0x2
1376 #define CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG 0x4
1378 #define CRYPT_OID_INFO_OID_KEY 1
1379 #define CRYPT_OID_INFO_NAME_KEY 2
1380 #define CRYPT_OID_INFO_ALGID_KEY 3
1381 #define CRYPT_OID_INFO_SIGN_KEY 4
1383 /* Algorithm IDs */
1385 #define GET_ALG_CLASS(x) (x & (7 << 13))
1386 #define GET_ALG_TYPE(x) (x & (15 << 9))
1387 #define GET_ALG_SID(x) (x & (511))
1389 /* Algorithm Classes */
1390 #define ALG_CLASS_ANY (0)
1391 #define ALG_CLASS_SIGNATURE (1 << 13)
1392 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
1393 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
1394 #define ALG_CLASS_HASH (4 << 13)
1395 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
1396 #define ALG_CLASS_ALL (7 << 13)
1397 /* Algorithm types */
1398 #define ALG_TYPE_ANY (0)
1399 #define ALG_TYPE_DSS (1 << 9)
1400 #define ALG_TYPE_RSA (2 << 9)
1401 #define ALG_TYPE_BLOCK (3 << 9)
1402 #define ALG_TYPE_STREAM (4 << 9)
1403 #define ALG_TYPE_DH (5 << 9)
1404 #define ALG_TYPE_SECURECHANNEL (6 << 9)
1406 /* SIDs */
1407 #define ALG_SID_ANY (0)
1408 /* RSA SIDs */
1409 #define ALG_SID_RSA_ANY 0
1410 #define ALG_SID_RSA_PKCS 1
1411 #define ALG_SID_RSA_MSATWORK 2
1412 #define ALG_SID_RSA_ENTRUST 3
1413 #define ALG_SID_RSA_PGP 4
1414 /* DSS SIDs */
1415 #define ALG_SID_DSS_ANY 0
1416 #define ALG_SID_DSS_PKCS 1
1417 #define ALG_SID_DSS_DMS 2
1419 /* DES SIDs */
1420 #define ALG_SID_DES 1
1421 #define ALG_SID_3DES 3
1422 #define ALG_SID_DESX 4
1423 #define ALG_SID_IDEA 5
1424 #define ALG_SID_CAST 6
1425 #define ALG_SID_SAFERSK64 7
1426 #define ALG_SID_SAFERSK128 8
1427 #define ALG_SID_3DES_112 9
1428 #define ALG_SID_CYLINK_MEK 12
1429 #define ALG_SID_RC5 13
1430 #define ALG_SID_AES_128 14
1431 #define ALG_SID_AES_192 15
1432 #define ALG_SID_AES_256 16
1433 #define ALG_SID_AES 17
1434 /* Diffie-Hellmans SIDs */
1435 #define ALG_SID_DH_SANDF 1
1436 #define ALG_SID_DH_EPHEM 2
1437 #define ALG_SID_AGREED_KEY_ANY 3
1438 #define ALG_SID_KEA 4
1439 /* RC2 SIDs */
1440 #define ALG_SID_RC4 1
1441 #define ALG_SID_RC2 2
1442 #define ALG_SID_SEAL 2
1443 /* Hash SIDs */
1444 #define ALG_SID_MD2 1
1445 #define ALG_SID_MD4 2
1446 #define ALG_SID_MD5 3
1447 #define ALG_SID_SHA 4
1448 #define ALG_SID_SHA1 ALG_SID_SHA
1449 #define ALG_SID_MAC 5
1450 #define ALG_SID_RIPEMD 6
1451 #define ALG_SID_RIPEMD160 7
1452 #define ALG_SID_SSL3SHAMD5 8
1453 #define ALG_SID_HMAC 9
1454 #define ALG_SID_TLS1PRF 10
1455 #define ALG_SID_HASH_REPLACE_OWF 11
1456 #define ALG_SID_SHA_256 12
1457 #define ALG_SID_SHA_384 13
1458 #define ALG_SID_SHA_512 14
1459 /* SCHANNEL SIDs */
1460 #define ALG_SID_SSL3_MASTER 1
1461 #define ALG_SID_SCHANNEL_MASTER_HASH 2
1462 #define ALG_SID_SCHANNEL_MAC_KEY 3
1463 #define ALG_SID_PCT1_MASTER 4
1464 #define ALG_SID_SSL2_MASTER 5
1465 #define ALG_SID_TLS1_MASTER 6
1466 #define ALG_SID_SCHANNEL_ENC_KEY 7
1467 #define ALG_SID_EXAMPLE 80
1469 /* Algorithm Definitions */
1470 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
1471 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
1472 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
1473 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
1474 #define CALG_SHA1 CALG_SHA
1475 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
1476 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
1477 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
1478 #define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
1479 #define CALG_HASH_REPLACE_OWF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF)
1480 #define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256)
1481 #define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384)
1482 #define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512)
1483 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
1484 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
1485 #define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY)
1486 #define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF)
1487 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM)
1488 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
1489 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
1490 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
1491 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES)
1492 #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112)
1493 #define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_128)
1494 #define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_192)
1495 #define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256)
1496 #define CALG_AES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES)
1497 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
1498 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
1499 #define CALG_RC5 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC5)
1500 #define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER)
1501 #define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH)
1502 #define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY)
1503 #define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY)
1504 #define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER)
1505 #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER)
1506 #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER)
1509 /* Protocol Flags */
1510 #define CRYPT_FLAG_PCT1 0x0001
1511 #define CRYPT_FLAG_SSL2 0x0002
1512 #define CRYPT_FLAG_SSL3 0x0004
1513 #define CRYPT_FLAG_TLS1 0x0008
1514 #define CRYPT_FLAG_IPSEC 0x0010
1515 #define CRYPT_FLAG_SIGNING 0x0020
1517 /* Provider names */
1518 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
1519 #if defined(__GNUC__)
1520 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1521 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
1522 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
1523 #elif defined(_MSC_VER)
1524 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
1525 #else
1526 static const WCHAR MS_DEF_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1527 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1528 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
1529 #endif
1530 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
1532 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
1533 #if defined(__GNUC__)
1534 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1535 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
1536 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
1537 #elif defined(_MSC_VER)
1538 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
1539 #else
1540 static const WCHAR MS_ENHANCED_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1541 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1542 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
1543 #endif
1544 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
1546 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
1547 #if defined(__GNUC__)
1548 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1549 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
1550 'P','r','o','v','i','d','e','r',0 }
1551 #elif defined(_MSC_VER)
1552 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
1553 #else
1554 static const WCHAR MS_STRONG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1555 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1556 'P','r','o','v','i','d','e','r',0 };
1557 #endif
1558 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
1560 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
1561 #if defined(__GNUC__)
1562 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1563 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
1564 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1565 #elif defined(_MSC_VER)
1566 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
1567 #else
1568 static const WCHAR MS_DEF_RSA_SIG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1569 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
1570 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1571 #endif
1572 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
1574 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
1575 #if defined(__GNUC__)
1576 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1577 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
1578 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1579 #elif defined(_MSC_VER)
1580 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
1581 #else
1582 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1583 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
1584 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1585 #endif
1586 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
1588 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
1589 #if defined(__GNUC__)
1590 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1591 'B','a','s','e',' ','D','S','S',' ', \
1592 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1593 #elif defined(_MSC_VER)
1594 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
1595 #else
1596 static const WCHAR MS_DEF_DSS_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1597 'B','a','s','e',' ','D','S','S',' ',
1598 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1599 #endif
1600 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
1602 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
1603 #if defined(__GNUC__)
1604 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1605 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
1606 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
1607 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1608 #elif defined(_MSC_VER)
1609 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
1610 #else
1611 static const WCHAR MS_DEF_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1612 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
1613 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
1614 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1615 #endif
1616 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
1618 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
1619 #if defined(__GNUC__)
1620 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1621 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
1622 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
1623 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1624 #elif defined(_MSC_VER)
1625 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
1626 #else
1627 static const WCHAR MS_ENH_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1628 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
1629 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
1630 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1631 #endif
1632 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
1634 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
1635 #if defined(__GNUC__)
1636 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1637 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
1638 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1639 #elif defined(_MSC_VER)
1640 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
1641 #else
1642 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1643 'D','H',' ','S','C','h','a','n','n','e','l',' ',
1644 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1645 #endif
1646 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
1648 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
1649 #if defined(__GNUC__)
1650 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1651 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
1652 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1653 #elif defined(_MSC_VER)
1654 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
1655 #else
1656 static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1657 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
1658 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1659 #endif
1660 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
1662 #define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Provider"
1663 #if defined(__GNUC__)
1664 # define MS_ENH_RSA_AES_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1665 'E','n','h','a','n','c','e','d',' ','R','S','A',' ','a','n','d',' ','A','E','S',' ',\
1666 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1667 #elif defined(_MSC_VER)
1668 # define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic Provider"
1669 #else
1670 static const WCHAR MS_ENH_RSA_AES_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1671 'E','n','h','a','n','c','e','d',' ','R','S','A',' ','a','n','d',' ','A','E','S',' ',
1672 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1673 #endif
1674 #define MS_ENH_RSA_AES_PROV WINELIB_NAME_AW(MS_ENH_RSA_AES_PROV_)
1676 /* Key Specs*/
1677 #define AT_KEYEXCHANGE 1
1678 #define AT_SIGNATURE 2
1680 /* Provider Types */
1681 #define PROV_RSA_FULL 1
1682 #define PROV_RSA_SIG 2
1683 #define PROV_DSS 3
1684 #define PROV_FORTEZZA 4
1685 #define PROV_MS_EXCHANGE 5
1686 #define PROV_SSL 6
1687 #define PROV_RSA_SCHANNEL 12
1688 #define PROV_DSS_DH 13
1689 #define PROV_EC_ECDSA_SIG 14
1690 #define PROV_EC_ECNRA_SIG 15
1691 #define PROV_EC_ECDSA_FULL 16
1692 #define PROV_EC_ECNRA_FULL 17
1693 #define PROV_DH_SCHANNEL 18
1694 #define PROV_SPYRUS_LYNKS 20
1695 #define PROV_RNG 21
1696 #define PROV_INTEL_SEC 22
1697 #define PROV_REPLACE_OWF 23
1698 #define PROV_RSA_AES 24
1700 /* FLAGS Section */
1702 /* Provider Parameters */
1703 #define PP_ENUMALGS 1
1704 #define PP_ENUMCONTAINERS 2
1705 #define PP_IMPTYPE 3
1706 #define PP_NAME 4
1707 #define PP_VERSION 5
1708 #define PP_CONTAINER 6
1710 #define CRYPT_FIRST 1
1711 #define CRYPT_NEXT 2
1713 #define CRYPT_IMPL_HARDWARE 1
1714 #define CRYPT_IMPL_SOFTWARE 2
1715 #define CRYPT_IMPL_MIXED 3
1716 #define CRYPT_IMPL_UNKNOWN 4
1718 /* CryptAcquireContext */
1719 #define CRYPT_VERIFYCONTEXT 0xF0000000
1720 #define CRYPT_NEWKEYSET 0x00000008
1721 #define CRYPT_DELETEKEYSET 0x00000010
1722 #define CRYPT_MACHINE_KEYSET 0x00000020
1723 #define CRYPT_SILENT 0x00000040
1725 /* Crypt{Get|Set}Provider */
1726 #define CRYPT_MACHINE_DEFAULT 0x00000001
1727 #define CRYPT_USER_DEFAULT 0x00000002
1728 #define CRYPT_DELETE_DEFAULT 0x00000004
1730 /* Crypt{Get/Set}ProvParam */
1731 #define PP_CLIENT_HWND 1
1732 #define PP_ENUMALGS 1
1733 #define PP_ENUMCONTAINERS 2
1734 #define PP_IMPTYPE 3
1735 #define PP_NAME 4
1736 #define PP_VERSION 5
1737 #define PP_CONTAINER 6
1738 #define PP_CHANGE_PASSWORD 7
1739 #define PP_KEYSET_SEC_DESCR 8
1740 #define PP_KEY_TYPE_SUBTYPE 10
1741 #define PP_CONTEXT_INFO 11
1742 #define PP_KEYEXCHANGE_KEYSIZE 12
1743 #define PP_SIGNATURE_KEYSIZE 13
1744 #define PP_KEYEXCHANGE_ALG 14
1745 #define PP_SIGNATURE_ALG 15
1746 #define PP_PROVTYPE 16
1747 #define PP_KEYSTORAGE 17
1748 #define PP_SYM_KEYSIZE 19
1749 #define PP_SESSION_KEYSIZE 20
1750 #define PP_UI_PROMPT 21
1751 #define PP_ENUMALGS_EX 22
1752 #define PP_DELETEKEY 24
1753 #define PP_ENUMMANDROOTS 25
1754 #define PP_ENUMELECTROOTS 26
1755 #define PP_KEYSET_TYPE 27
1756 #define PP_ADMIN_PIN 31
1757 #define PP_KEYEXCHANGE_PIN 32
1758 #define PP_SIGNATURE_PIN 33
1759 #define PP_SIG_KEYSIZE_INC 34
1760 #define PP_KEYX_KEYSIZE_INC 35
1761 #define PP_UNIQUE_CONTAINER 36
1762 #define PP_SGC_INFO 37
1763 #define PP_USE_HARDWARE_RNG 38
1764 #define PP_KEYSPEC 39
1765 #define PP_ENUMEX_SIGNING_PROT 40
1767 /* Values returned by CryptGetProvParam of PP_KEYSTORAGE */
1768 #define CRYPT_SEC_DESCR 0x00000001
1769 #define CRYPT_PSTORE 0x00000002
1770 #define CRYPT_UI_PROMPT 0x00000004
1772 /* Crypt{Get/Set}KeyParam */
1773 #define KP_IV 1
1774 #define KP_SALT 2
1775 #define KP_PADDING 3
1776 #define KP_MODE 4
1777 #define KP_MODE_BITS 5
1778 #define KP_PERMISSIONS 6
1779 #define KP_ALGID 7
1780 #define KP_BLOCKLEN 8
1781 #define KP_KEYLEN 9
1782 #define KP_SALT_EX 10
1783 #define KP_P 11
1784 #define KP_G 12
1785 #define KP_Q 13
1786 #define KP_X 14
1787 #define KP_Y 15
1788 #define KP_RA 16
1789 #define KP_RB 17
1790 #define KP_INFO 18
1791 #define KP_EFFECTIVE_KEYLEN 19
1792 #define KP_SCHANNEL_ALG 20
1793 #define KP_CLIENT_RANDOM 21
1794 #define KP_SERVER_RANDOM 22
1795 #define KP_RP 23
1796 #define KP_PRECOMP_MD5 24
1797 #define KP_PRECOMP_SHA 25
1798 #define KP_CERTIFICATE 26
1799 #define KP_CLEAR_KEY 27
1800 #define KP_PUB_EX_LEN 28
1801 #define KP_PUB_EX_VAL 29
1802 #define KP_KEYVAL 30
1803 #define KP_ADMIN_PIN 31
1804 #define KP_KEYEXCHANGE_PIN 32
1805 #define KP_SIGNATURE_PIN 33
1806 #define KP_PREHASH 34
1808 /* CryptSignHash/CryptVerifySignature */
1809 #define CRYPT_NOHASHOID 0x00000001
1810 #define CRYPT_TYPE2_FORMAT 0x00000002
1811 #define CRYPT_X931_FORMAT 0x00000004
1813 /* Crypt{Get,Set}HashParam */
1814 #define HP_ALGID 0x0001
1815 #define HP_HASHVAL 0x0002
1816 #define HP_HASHSIZE 0x0004
1817 #define HP_HMAC_INFO 0x0005
1818 #define HP_TLS1PRF_LABEL 0x0006
1819 #define HP_TLS1PRF_SEED 0x0007
1821 /* Crypt{Get,Set}KeyParam */
1822 #define CRYPT_MODE_CBC 1
1823 #define CRYPT_MODE_ECB 2
1824 #define CRYPT_MODE_OFB 3
1825 #define CRYPT_MODE_CFB 4
1827 #define CRYPT_ENCRYPT 0x0001
1828 #define CRYPT_DECRYPT 0x0002
1829 #define CRYPT_EXPORT 0x0004
1830 #define CRYPT_READ 0x0008
1831 #define CRYPT_WRITE 0x0010
1832 #define CRYPT_MAC 0x0020
1834 /* Crypt*Key */
1835 #define CRYPT_EXPORTABLE 0x00000001
1836 #define CRYPT_USER_PROTECTED 0x00000002
1837 #define CRYPT_CREATE_SALT 0x00000004
1838 #define CRYPT_UPDATE_KEY 0x00000008
1839 #define CRYPT_NO_SALT 0x00000010
1840 #define CRYPT_PREGEN 0x00000040
1841 #define CRYPT_SERVER 0x00000400
1842 #define CRYPT_ARCHIVABLE 0x00004000
1844 /* CryptExportKey */
1845 #define CRYPT_SSL2_FALLBACK 0x00000002
1846 #define CRYPT_DESTROYKEY 0x00000004
1847 #define CRYPT_OAEP 0x00000040
1849 /* CryptHashSessionKey */
1850 #define CRYPT_LITTLE_ENDIAN 0x00000001
1852 /* Crypt{Protect,Unprotect}Data PROMPTSTRUCT flags */
1853 #define CRYPTPROTECT_PROMPT_ON_PROTECT 0x0001
1854 #define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x0002
1855 /* Crypt{Protect,Unprotect}Data flags */
1856 #define CRYPTPROTECT_UI_FORBIDDEN 0x0001
1857 #define CRYPTPROTECT_LOCAL_MACHINE 0x0004
1858 #define CRYPTPROTECT_AUDIT 0x0010
1859 #define CRYPTPROTECT_VERIFY_PROTECTION 0x0040
1861 /* Blob Types */
1862 #define SIMPLEBLOB 0x1
1863 #define PUBLICKEYBLOB 0x6
1864 #define PRIVATEKEYBLOB 0x7
1865 #define PLAINTEXTKEYBLOB 0x8
1866 #define OPAQUEKEYBLOB 0x9
1867 #define PUBLICKEYBLOBEX 0xA
1868 #define SYMMETRICWRAPKEYBLOB 0xB
1870 #define CUR_BLOB_VERSION 2
1872 /* cert store provider types */
1873 #define CERT_STORE_PROV_MSG ((LPCSTR)1)
1874 #define CERT_STORE_PROV_MEMORY ((LPCSTR)2)
1875 #define CERT_STORE_PROV_FILE ((LPCSTR)3)
1876 #define CERT_STORE_PROV_REG ((LPCSTR)4)
1877 #define CERT_STORE_PROV_PKCS7 ((LPCSTR)5)
1878 #define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6)
1879 #define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7)
1880 #define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8)
1881 #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9)
1882 #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10)
1883 #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
1884 #define CERT_STORE_PROV_COLLECTION ((LPCSTR)11)
1885 #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12)
1886 #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13)
1887 #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
1888 #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14)
1889 #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
1890 #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15)
1891 #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
1892 #define CERT_STORE_PROV_LDAP_W ((LPCSTR)16)
1893 #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
1895 #define sz_CERT_STORE_PROV_MEMORY "Memory"
1896 #define sz_CERT_STORE_PROV_FILENAME_W "File"
1897 #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
1898 #define sz_CERT_STORE_PROV_SYSTEM_W "System"
1899 #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
1900 #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
1901 #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
1902 #define sz_CERT_STORE_PROV_COLLECTION "Collection"
1903 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
1904 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
1905 #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
1906 #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
1907 #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
1908 #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
1909 #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
1910 #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
1912 /* types for CertOpenStore dwEncodingType */
1913 #define CERT_ENCODING_TYPE_MASK 0x0000ffff
1914 #define CMSG_ENCODING_TYPE_MASK 0xffff0000
1915 #define GET_CERT_ENCODING_TYPE(x) ((x) & CERT_ENCODING_TYPE_MASK)
1916 #define GET_CMSG_ENCODING_TYPE(x) ((x) & CMSG_ENCODING_TYPE_MASK)
1918 #define CRYPT_ASN_ENCODING 0x00000001
1919 #define CRYPT_NDR_ENCODING 0x00000002
1920 #define X509_ASN_ENCODING 0x00000001
1921 #define X509_NDR_ENCODING 0x00000002
1922 #define PKCS_7_ASN_ENCODING 0x00010000
1923 #define PKCS_7_NDR_ENCODING 0x00020000
1925 /* system store locations */
1926 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000
1927 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
1929 /* system store location ids */
1930 /* hkcu */
1931 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
1932 /* hklm */
1933 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
1934 /* hklm\Software\Microsoft\Cryptography\Services */
1935 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
1936 #define CERT_SYSTEM_STORE_SERVICES_ID 5
1937 /* HKEY_USERS */
1938 #define CERT_SYSTEM_STORE_USERS_ID 6
1939 /* hkcu\Software\Policies\Microsoft\SystemCertificates */
1940 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7
1941 /* hklm\Software\Policies\Microsoft\SystemCertificates */
1942 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8
1943 /* hklm\Software\Microsoft\EnterpriseCertificates */
1944 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9
1946 /* system store location values */
1947 #define CERT_SYSTEM_STORE_CURRENT_USER \
1948 (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1949 #define CERT_SYSTEM_STORE_LOCAL_MACHINE \
1950 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1951 #define CERT_SYSTEM_STORE_CURRENT_SERVICE \
1952 (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1953 #define CERT_SYSTEM_STORE_SERVICES \
1954 (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1955 #define CERT_SYSTEM_STORE_USERS \
1956 (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1957 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \
1958 (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1959 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \
1960 (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1961 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \
1962 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1964 #if defined(__GNUC__)
1965 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH (const WCHAR[])\
1966 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t',\
1967 '\\','S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',\
1969 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH (const WCHAR[])\
1970 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
1971 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
1972 't','i','f','i','c','a','t','e','s',0 }
1973 #elif defined(_MSC_VER)
1974 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \
1975 L"Software\\Microsoft\\SystemCertificates"
1976 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH \
1977 L"Software\\Policies\\Microsoft\\SystemCertificates"
1978 #else
1979 static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] =
1980 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
1981 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0 };
1982 static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] =
1983 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
1984 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
1985 't','i','f','i','c','a','t','e','s',0 };
1986 #endif
1988 #if defined(__GNUC__)
1989 #define CERT_EFSBLOB_REGPATH (const WCHAR[])\
1990 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
1991 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
1992 't','i','f','i','c','a','t','e','s','\\','E','F','S',0 }
1993 #define CERT_EFSBLOB_VALUE_NAME (const WCHAR[]) {'E','F','S','B','l','o','b',0 }
1994 #elif defined(_MSC_VER)
1995 #define CERT_EFSBLOB_REGPATH CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\EFS"
1996 #define CERT_EFSBLOB_VALUE_NAME L"EFSBlob"
1997 #else
1998 static const WCHAR CERT_EFSBLOB_REGPATH[] =
1999 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
2000 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
2001 't','i','f','i','c','a','t','e','s','\\','E','F','S',0 };
2002 static const CERT_EFSBLOB_VALUE_NAME[] = { 'E','F','S','B','l','o','b',0 };
2003 #endif
2005 #if defined(__GNUC__)
2006 #define CERT_PROT_ROOT_FLAGS_REGPATH (const WCHAR[])\
2007 {'\\','R','o','o','t','\\','P','r','o','t','e','c','t','e','d','R','o','o','t',\
2008 's',0 }
2009 #define CERT_PROT_ROOT_FLAGS_VALUE_NAME (const WCHAR[])\
2010 {'F','l','a','g','s',0 }
2011 #elif defined(_MSC_VER)
2012 #define CERT_PROT_ROOT_FLAGS_REGPATH L"\\Root\\ProtectedRoots"
2013 #define CERT_PROT_ROOT_FLAGS_VALUE_NAME L"Flags"
2014 #else
2015 static const WCHAR CERT_PROT_ROOT_FLAGS_REGPATH[] =
2016 { '\\','R','o','o','t','\\','P','r','o','t','e','c','t','e','d','R','o','o',
2017 't','s',0 };
2018 static const WCHAR CERT_PROT_ROOT_FLAGS_VALUE_NAME[] = {'F','l','a','g','s',0 };
2019 #endif
2021 #define CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG 0x01
2022 #define CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG 0x02
2023 #define CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG 0x04
2024 #define CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG 0x08
2025 #define CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG 0x10
2026 #define CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG 0x20
2028 #if defined(__GNUC__)
2029 #define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH (const WCHAR[])\
2030 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
2031 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
2032 't','i','f','i','c','a','t','e','s','\\','T','r','u','s','t','e','d',\
2033 'P','u','b','l','i','s','h','e','r','\\','S','a','f','e','r',0 }
2034 #elif defined(_MSC_VER)
2035 #define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH \
2036 CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
2037 #else
2038 static const WCHAR CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH[] =
2039 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
2040 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
2041 't','i','f','i','c','a','t','e','s','\\','T','r','u','s','t','e','d',
2042 'P','u','b','l','i','s','h','e','r','\\','S','a','f','e','r',0 };
2043 #endif
2045 #if defined(__GNUC__)
2046 #define CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH (const WCHAR[])\
2047 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',\
2048 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s','\\',\
2049 'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r','\\',\
2050 'S','a','f','e','r',0 }
2051 #define CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME (const WCHAR[])\
2052 {'A','u','t','h','e','n','t','i','c','o','d','e','F','l','a','g','s',0 };
2053 #elif defined(_MSC_VER)
2054 #define CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH \
2055 CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
2056 #define CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME L"AuthenticodeFlags"
2057 #else
2058 static const WCHAR CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH[] =
2059 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
2060 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s','\\',
2061 'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r','\\',
2062 'S','a','f','e','r',0 };
2063 static const WCHAR CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME[] =
2064 { 'A','u','t','h','e','n','t','i','c','o','d','e','F','l','a','g','s',0 };
2065 #endif
2067 #define CERT_TRUST_PUB_ALLOW_END_USER_TRUST 0x00000000
2068 #define CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST 0x00000001
2069 #define CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST 0x00000002
2070 #define CERT_TRUST_PUB_ALLOW_TRUST_MASK 0x00000003
2071 #define CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG 0x00000100
2072 #define CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG 0x00000200
2074 /* flags for CertOpenStore dwFlags */
2075 #define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001
2076 #define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002
2077 #define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004
2078 #define CERT_STORE_DELETE_FLAG 0x00000010
2079 #define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020
2080 #define CERT_STORE_SHARE_STORE_FLAG 0x00000040
2081 #define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080
2082 #define CERT_STORE_MANIFOLD_FLAG 0x00000100
2083 #define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200
2084 #define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400
2085 #define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800
2086 #define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000
2087 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000
2088 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
2089 #define CERT_STORE_READONLY_FLAG 0x00008000
2091 #define CERT_REGISTRY_STORE_REMOTE_FLAG 0x00010000
2092 #define CERT_REGISTRY_STORE_SERIALIZED_FLAG 0x00020000
2093 #define CERT_REGISTRY_STORE_ROAMING_FLAG 0x00040000
2094 #define CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG 0x00080000
2095 #define CERT_REGISTRY_STORE_LM_GPT_FLAG 0x01000000
2096 #define CERT_REGISTRY_STORE_CLIENT_GPT_FLAG 0x80000000
2098 #define CERT_FILE_STORE_COMMIT_ENABLE_FLAG 0x00010000
2100 /* CertCloseStore dwFlags */
2101 #define CERT_CLOSE_STORE_FORCE_FLAG 0x00000001
2102 #define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002
2104 /* dwAddDisposition */
2105 #define CERT_STORE_ADD_NEW 1
2106 #define CERT_STORE_ADD_USE_EXISTING 2
2107 #define CERT_STORE_ADD_REPLACE_EXISTING 3
2108 #define CERT_STORE_ADD_ALWAYS 4
2109 #define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5
2110 #define CERT_STORE_ADD_NEWER 6
2111 #define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES 7
2113 /* Installable OID function defs */
2114 #define CRYPT_OID_OPEN_STORE_PROV_FUNC "CertDllOpenStoreProv"
2115 #define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject"
2116 #define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject"
2117 #define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx"
2118 #define CRYPT_OID_DECODE_OBJECT_EX_FUNC "CryptDllDecodeObjectEx"
2119 #define CRYPT_OID_CREATE_COM_OBJECT_FUNC "CryptDllCreateComObject"
2120 #define CRYPT_OID_VERIFY_REVOCATION_FUNC "CertDllVerifyRevocation"
2121 #define CRYPT_OID_VERIFY_CTL_USAGE_FUNC "CertDllVerifyCTLUsage"
2122 #define CRYPT_OID_FORMAT_OBJECT_FUNC "CryptDllFormatObject"
2123 #define CRYPT_OID_FIND_OID_INFO_FUNC "CryptDllFindOIDInfo"
2124 #define CRYPT_OID_FIND_LOCALIZED_NAME_FUNC "CryptDllFindLocalizedName"
2125 #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
2126 #define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC "CryptDllImportPublicKeyInfoEx"
2127 #define CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC "CryptDllExportPrivateKeyInfoEx"
2128 #define CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC "CryptDllImportPrivateKeyInfoEx"
2129 #define CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC \
2130 "CertDllVerifyCertificateChainPolicy"
2131 #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
2132 #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
2134 #define CRYPT_OID_REGPATH "Software\\Microsoft\\Cryptography\\OID"
2135 #define CRYPT_OID_REG_ENCODING_TYPE_PREFIX "EncodingType "
2136 #if defined(__GNUC__)
2137 # define CRYPT_OID_REG_DLL_VALUE_NAME (const WCHAR []){ 'D','l','l',0 }
2138 # define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME \
2139 (const WCHAR []){ 'F','u','n','c','N','a','m','e',0 }
2140 # define CRYPT_OID_REG_FLAGS_VALUE_NAME \
2141 (const WCHAR []){ 'C','r','y','p','t','F','l','a','g','s',0 }
2142 #elif defined(_MSC_VER)
2143 # define CRYPT_OID_REG_DLL_VALUE_NAME L"Dll"
2144 # define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME L"FuncName"
2145 # define CRYPT_OID_REG_FLAGS_VALUE_NAME L"CryptFlags"
2146 #else
2147 static const WCHAR CRYPT_OID_REG_DLL_VALUE_NAME[] = { 'D','l','l',0 };
2148 static const WCHAR CRYPT_OID_REG_FUNC_NAME_VALUE_NAME[] =
2149 { 'F','u','n','c','N','a','m','e',0 };
2150 static const WCHAR CRYPT_OID_REG_FLAGS_VALUE_NAME[] =
2151 { 'C','r','y','p','t','F','l','a','g','s',0 };
2152 #endif
2153 #define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A "FuncName"
2154 #define CRYPT_DEFAULT_OID "DEFAULT"
2156 #define CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG 1
2158 #define CRYPT_GET_INSTALLED_OID_FUNC_FLAG 0x1
2160 #define CRYPT_REGISTER_FIRST_INDEX 0
2161 #define CRYPT_REGISTER_LAST_INDEX 0xffffffff
2163 /* values for CERT_STORE_PROV_INFO's dwStoreProvFlags */
2164 #define CERT_STORE_PROV_EXTERNAL_FLAG 0x1
2165 #define CERT_STORE_PROV_DELETED_FLAG 0x2
2166 #define CERT_STORE_PROV_NO_PERSIST_FLAG 0x4
2167 #define CERT_STORE_PROV_SYSTEM_STORE_FLAG 0x8
2168 #define CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG 0x10
2170 /* function indices */
2171 #define CERT_STORE_PROV_CLOSE_FUNC 0
2172 #define CERT_STORE_PROV_READ_CERT_FUNC 1
2173 #define CERT_STORE_PROV_WRITE_CERT_FUNC 2
2174 #define CERT_STORE_PROV_DELETE_CERT_FUNC 3
2175 #define CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC 4
2176 #define CERT_STORE_PROV_READ_CRL_FUNC 5
2177 #define CERT_STORE_PROV_WRITE_CRL_FUNC 6
2178 #define CERT_STORE_PROV_DELETE_CRL_FUNC 7
2179 #define CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC 8
2180 #define CERT_STORE_PROV_READ_CTL_FUNC 9
2181 #define CERT_STORE_PROV_WRITE_CTL_FUNC 10
2182 #define CERT_STORE_PROV_DELETE_CTL_FUNC 11
2183 #define CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC 12
2184 #define CERT_STORE_PROV_CONTROL_FUNC 13
2185 #define CERT_STORE_PROV_FIND_CERT_FUNC 14
2186 #define CERT_STORE_PROV_FREE_FIND_CERT_FUNC 15
2187 #define CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC 16
2188 #define CERT_STORE_PROV_FIND_CRL_FUNC 17
2189 #define CERT_STORE_PROV_FREE_FIND_CRL_FUNC 18
2190 #define CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC 19
2191 #define CERT_STORE_PROV_FIND_CTL_FUNC 20
2192 #define CERT_STORE_PROV_FREE_FIND_CTL_FUNC 21
2193 #define CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC 22
2195 /* physical store dwFlags, also used by CertAddStoreToCollection as
2196 * dwUpdateFlags
2198 #define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1
2199 #define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2
2200 #define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4
2201 #define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8
2203 /* dwFlag values for CertEnumPhysicalStore callback */
2204 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
2206 /* predefined store names */
2207 #if defined(__GNUC__)
2208 # define CERT_PHYSICAL_STORE_DEFAULT_NAME (const WCHAR[])\
2209 {'.','D','e','f','a','u','l','t','0'}
2210 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME (const WCHAR[])\
2211 {'.','G','r','o','u','p','P','o','l','i','c','y',0}
2212 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME (const WCHAR[])\
2213 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0}
2214 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME (const WCHAR[])\
2215 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0}
2216 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME (const WCHAR[])\
2217 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',\
2218 'P','o','l','i','c','y',0}
2219 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME (const WCHAR[])\
2220 {'.','E','n','t','e','r','p','r','i','s','e',0}
2221 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME (const WCHAR[])\
2222 {'.','A','u','t','h','R','o','o','t',0}
2223 #elif defined(_MSC_VER)
2224 # define CERT_PHYSICAL_STORE_DEFAULT_NAME \
2225 L".Default"
2226 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \
2227 L".GroupPolicy"
2228 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \
2229 L".LocalMachine"
2230 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \
2231 L".UserCertificate"
2232 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
2233 L".LocalMachineGroupPolicy"
2234 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \
2235 L".Enterprise"
2236 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \
2237 L".AuthRoot"
2238 #else
2239 static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] =
2240 {'.','D','e','f','a','u','l','t','0'};
2241 static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME[] =
2242 {'.','G','r','o','u','p','P','o','l','i','c','y',0};
2243 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME[] =
2244 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0};
2245 static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME[] =
2246 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0};
2247 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME[] =
2248 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',
2249 'P','o','l','i','c','y',0};
2250 static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME[] =
2251 {'.','E','n','t','e','r','p','r','i','s','e',0};
2252 static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME[] =
2253 {'.','A','u','t','h','R','o','o','t',0};
2254 #endif
2256 /* cert system store flags */
2257 #define CERT_SYSTEM_STORE_MASK 0xffff0000
2258 #define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000
2260 /* CertFindChainInStore dwFindType types */
2261 #define CERT_CHAIN_FIND_BY_ISSUER 1
2263 /* CertSaveStore dwSaveAs values */
2264 #define CERT_STORE_SAVE_AS_STORE 1
2265 #define CERT_STORE_SAVE_AS_PKCS7 2
2266 /* CertSaveStore dwSaveTo values */
2267 #define CERT_STORE_SAVE_TO_FILE 1
2268 #define CERT_STORE_SAVE_TO_MEMORY 2
2269 #define CERT_STORE_SAVE_TO_FILENAME_A 3
2270 #define CERT_STORE_SAVE_TO_FILENAME_W 4
2271 #define CERT_STORE_SAVE_TO_FILENAME CERT_STORE_SAVE_TO_FILENAME_W
2273 /* CERT_INFO versions/flags */
2274 #define CERT_V1 0
2275 #define CERT_V2 1
2276 #define CERT_V3 2
2277 #define CERT_INFO_VERSION_FLAG 1
2278 #define CERT_INFO_SERIAL_NUMBER_FLAG 2
2279 #define CERT_INFO_SIGNATURE_ALGORITHM_FLAG 3
2280 #define CERT_INFO_ISSUER_FLAG 4
2281 #define CERT_INFO_NOT_BEFORE_FLAG 5
2282 #define CERT_INFO_NOT_AFTER_FLAG 6
2283 #define CERT_INFO_SUBJECT_FLAG 7
2284 #define CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG 8
2285 #define CERT_INFO_ISSUER_UNIQUE_ID_FLAG 9
2286 #define CERT_INFO_SUBJECT_UNIQUE_ID_FLAG 10
2287 #define CERT_INFO_EXTENSION_FLAG 11
2289 /* CERT_REQUEST_INFO versions */
2290 #define CERT_REQUEST_V1 0
2292 /* CERT_KEYGEN_REQUEST_INFO versions */
2293 #define CERT_KEYGEN_REQUEST_V1 0
2295 /* CRL versions */
2296 #define CRL_V1 0
2297 #define CRL_V2 1
2299 /* CTL versions */
2300 #define CTL_V1 0
2302 /* Certificate, CRL, CTL property IDs */
2303 #define CERT_KEY_PROV_HANDLE_PROP_ID 1
2304 #define CERT_KEY_PROV_INFO_PROP_ID 2
2305 #define CERT_SHA1_HASH_PROP_ID 3
2306 #define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID
2307 #define CERT_MD5_HASH_PROP_ID 4
2308 #define CERT_KEY_CONTEXT_PROP_ID 5
2309 #define CERT_KEY_SPEC_PROP_ID 6
2310 #define CERT_IE30_RESERVED_PROP_ID 7
2311 #define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8
2312 #define CERT_ENHKEY_USAGE_PROP_ID 9
2313 #define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID
2314 #define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10
2315 #define CERT_FRIENDLY_NAME_PROP_ID 11
2316 #define CERT_PVK_FILE_PROP_ID 12
2317 #define CERT_DESCRIPTION_PROP_ID 13
2318 #define CERT_ACCESS_STATE_PROP_ID 14
2319 #define CERT_SIGNATURE_HASH_PROP_ID 15
2320 #define CERT_SMART_CARD_DATA_PROP_ID 16
2321 #define CERT_EFS_PROP_ID 17
2322 #define CERT_FORTEZZA_DATA_PROP 18
2323 #define CERT_ARCHIVED_PROP_ID 19
2324 #define CERT_KEY_IDENTIFIER_PROP_ID 20
2325 #define CERT_AUTO_ENROLL_PROP_ID 21
2326 #define CERT_PUBKEY_ALG_PARA_PROP_ID 22
2327 #define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23
2328 #define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24
2329 #define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25
2330 #define CERT_ENROLLMENT_PROP_ID 26
2331 #define CERT_DATE_STAMP_PROP_ID 27
2332 #define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28
2333 #define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29
2334 #define CERT_EXTENDED_ERROR_INFO_PROP_ID 30
2335 /* 31 -- unused?
2336 32 -- cert prop id
2337 33 -- CRL prop id
2338 34 -- CTL prop id
2339 35 -- KeyId prop id
2340 36-63 -- reserved
2342 #define CERT_RENEWAL_PROP_ID 64
2343 #define CERT_ARCHIVED_KEY_HASH_PROP_ID 65
2344 #define CERT_AUTO_ENROLL_RETRY_PROP_ID 66
2345 #define CERT_AIA_URL_RETRIEVED_PROP_ID 67
2346 #define CERT_AUTHORITY_INFO_ACCESS_PROP_ID 68
2347 #define CERT_BACKED_UP_PROP_ID 69
2348 #define CERT_OCSP_RESPONSE_PROP_ID 70
2349 #define CERT_REQUEST_ORIGINATOR_PROP_ID 71
2350 #define CERT_SOURCE_LOCATION_PROP_ID 72
2351 #define CERT_SOURCE_URL_PROP_ID 73
2352 #define CERT_NEW_KEY_PROP_ID 74
2353 #define CERT_OCSP_CACHE_PREFIX_PROP_ID 75
2354 #define CERT_SMART_CARD_ROOT_INFO_PROP_ID 76
2355 #define CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID 77
2356 #define CERT_NCRYPT_KEY_HANDLE_PROP_ID 78
2357 #define CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID 79
2358 #define CERT_SUBJECT_INFO_ACCESS_PROP_ID 80
2359 #define CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 81
2360 #define CERT_CA_DISABLE_CRL_PROP_ID 82
2361 #define CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID 83
2362 #define CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID 84
2364 #define CERT_FIRST_RESERVED_PROP_ID 85
2365 #define CERT_LAST_RESERVED_PROP_ID 0x00007fff
2366 #define CERT_FIRST_USER_PROP_ID 0x00008000
2367 #define CERT_LAST_USER_PROP_ID 0x0000ffff
2369 #define IS_CERT_HASH_PROP_ID(x) \
2370 ((x) == CERT_SHA1_HASH_PROP_ID || (x) == CERT_MD5_HASH_PROP_ID || \
2371 (x) == CERT_SIGNATURE_HASH_PROP_ID)
2373 #define IS_PUBKEY_HASH_PROP_ID(x) \
2374 ((x) == CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2375 (x) == CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID)
2377 #define IS_CHAIN_HASH_PROP_ID(x) \
2378 ((x) == CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2379 (x) == CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2380 (x) == CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID || \
2381 (x) == CERT_SUBJECT_NAME_MD5_HASH_PROP_ID)
2383 /* access state flags */
2384 #define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1
2385 #define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2
2386 #define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4
2388 /* CertSetCertificateContextProperty flags */
2389 #define CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG 0x40000000
2390 #define CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG 0x80000000
2392 /* CERT_RDN attribute dwValueType types */
2393 #define CERT_RDN_TYPE_MASK 0x000000ff
2394 #define CERT_RDN_ANY_TYPE 0
2395 #define CERT_RDN_ENCODED_BLOB 1
2396 #define CERT_RDN_OCTET_STRING 2
2397 #define CERT_RDN_NUMERIC_STRING 3
2398 #define CERT_RDN_PRINTABLE_STRING 4
2399 #define CERT_RDN_TELETEX_STRING 5
2400 #define CERT_RDN_T61_STRING 5
2401 #define CERT_RDN_VIDEOTEX_STRING 6
2402 #define CERT_RDN_IA5_STRING 7
2403 #define CERT_RDN_GRAPHIC_STRING 8
2404 #define CERT_RDN_VISIBLE_STRING 9
2405 #define CERT_RDN_ISO646_STRING 9
2406 #define CERT_RDN_GENERAL_STRING 10
2407 #define CERT_RDN_UNIVERSAL_STRING 11
2408 #define CERT_RDN_INT4_STRING 11
2409 #define CERT_RDN_BMP_STRING 12
2410 #define CERT_RDN_UNICODE_STRING 12
2411 #define CERT_RDN_UTF8_STRING 13
2413 /* CERT_RDN attribute dwValueType flags */
2414 #define CERT_RDN_FLAGS_MASK 0xff000000
2415 #define CERT_RDN_ENABLE_T61_UNICODE_FLAG 0x80000000
2416 #define CERT_RDN_DISABLE_CHECK_TYPE_FLAG 0x4000000
2417 #define CERT_RDN_ENABLE_UTF8_UNICODE_FLAG 0x2000000
2418 #define CERT_RDN_DISABLE_IE4_UTF8_FLAG 0x0100000
2420 #define IS_CERT_RDN_CHAR_STRING(x) \
2421 (((x) & CERT_RDN_TYPE_MASK) >= CERT_RDN_NUMERIC_STRING)
2423 /* CertIsRDNAttrsInCertificateName flags */
2424 #define CERT_UNICODE_IS_RDN_ATTRS_FLAG 0x1
2425 #define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 0x2
2427 /* CRL reason codes */
2428 #define CRL_REASON_UNSPECIFIED 0
2429 #define CRL_REASON_KEY_COMPROMISE 1
2430 #define CRL_REASON_CA_COMPROMISE 2
2431 #define CRL_REASON_AFFILIATION_CHANGED 3
2432 #define CRL_REASON_SUPERSEDED 4
2433 #define CRL_REASON_CESSATION_OF_OPERATION 5
2434 #define CRL_REASON_CERTIFICATE_HOLD 6
2435 #define CRL_REASON_REMOVE_FROM_CRL 8
2437 /* CertControlStore control types */
2438 #define CERT_STORE_CTRL_RESYNC 1
2439 #define CERT_STORE_CTRL_NOTIFY_CHANGE 2
2440 #define CERT_STORE_CTRL_COMMIT 3
2441 #define CERT_STORE_CTRL_AUTO_RESYNC 4
2442 #define CERT_STORE_CTRL_CANCEL_NOTIFY 5
2444 #define CERT_STORE_CTRL_COMMIT_FORCE_FLAG 0x1
2445 #define CERT_STORE_CTRL_COMMIT_CLEAR_FLAG 0x2
2447 /* cert store properties */
2448 #define CERT_STORE_LOCALIZED_NAME_PROP_ID 0x1000
2450 /* CertCreateContext flags */
2451 #define CERT_CREATE_CONTEXT_NOCOPY_FLAG 0x1
2452 #define CERT_CREATE_CONTEXT_SORTED_FLAG 0x2
2453 #define CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG 0x4
2454 #define CERT_CREATE_CONTEXT_NO_ENTRY_FLAG 0x8
2456 #define CERT_COMPARE_MASK 0xffff
2457 #define CERT_COMPARE_SHIFT 16
2458 #define CERT_COMPARE_ANY 0
2459 #define CERT_COMPARE_SHA1_HASH 1
2460 #define CERT_COMPARE_HASH CERT_COMPARE_SHA1_HASH
2461 #define CERT_COMPARE_NAME 2
2462 #define CERT_COMPARE_ATTR 3
2463 #define CERT_COMPARE_MD5_HASH 4
2464 #define CERT_COMPARE_PROPERTY 5
2465 #define CERT_COMPARE_PUBLIC_KEY 6
2466 #define CERT_COMPARE_NAME_STR_A 7
2467 #define CERT_COMPARE_NAME_STR_W 8
2468 #define CERT_COMPARE_KEY_SPEC 9
2469 #define CERT_COMPARE_ENHKEY_USAGE 10
2470 #define CERT_COMPARE_CTL_USAGE CERT_COMPARE_ENHKEY_USAGE
2471 #define CERT_COMPARE_SUBJECT_CERT 11
2472 #define CERT_COMPARE_ISSUER_OF 12
2473 #define CERT_COMPARE_EXISTING 13
2474 #define CERT_COMPARE_SIGNATURE_HASH 14
2475 #define CERT_COMPARE_KEY_IDENTIFIER 15
2476 #define CERT_COMPARE_CERT_ID 16
2477 #define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17
2478 #define CERT_COMPARE_PUBKEY_MD5_HASH 18
2480 /* values of dwFindType for CertFind*InStore */
2481 #define CERT_FIND_ANY \
2482 (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT)
2483 #define CERT_FIND_SHA1_HASH \
2484 (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT)
2485 #define CERT_FIND_MD5_HASH \
2486 (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT)
2487 #define CERT_FIND_SIGNATURE_HASH \
2488 (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT)
2489 #define CERT_FIND_KEY_IDENTIFIER \
2490 (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT)
2491 #define CERT_FIND_HASH CERT_FIND_SHA1_HASH
2492 #define CERT_FIND_PROPERTY \
2493 (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT)
2494 #define CERT_FIND_PUBLIC_KEY \
2495 (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT)
2496 #define CERT_FIND_SUBJECT_NAME \
2497 (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2498 #define CERT_FIND_SUBJECT_ATTR \
2499 (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2500 #define CERT_FIND_ISSUER_NAME \
2501 (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2502 #define CERT_FIND_ISSUER_ATTR \
2503 (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2504 #define CERT_FIND_SUBJECT_STR_A \
2505 (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2506 #define CERT_FIND_SUBJECT_STR_W \
2507 (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2508 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W
2509 #define CERT_FIND_ISSUER_STR_A \
2510 (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2511 #define CERT_FIND_ISSUER_STR_W \
2512 (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2513 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W
2514 #define CERT_FIND_KEY_SPEC \
2515 (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT)
2516 #define CERT_FIND_ENHKEY_USAGE \
2517 (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT)
2518 #define CERT_FIND_CTL_USAGE CERT_FIND_ENHKEY_USAGE
2519 #define CERT_FIND_SUBJECT_CERT \
2520 (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT)
2521 #define CERT_FIND_ISSUER_OF \
2522 (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT)
2523 #define CERT_FIND_EXISTING \
2524 (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT)
2525 #define CERT_FIND_CERT_ID \
2526 (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT)
2527 #define CERT_FIND_CROSS_CERT_DIST_POINTS \
2528 (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT)
2529 #define CERT_FIND_PUBKEY_MD5_HASH \
2530 (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT)
2532 #define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 0x1
2533 #define CERT_FIND_OPTIONAL_CTL_USAGE_FLAG 0x1
2534 #define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 0x2
2535 #define CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG 0x2
2536 #define CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG 0x4
2537 #define CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG 0x4
2538 #define CERT_FIND_NO_ENHKEY_USAGE_FLAG 0x8
2539 #define CERT_FIND_NO_CTL_USAGE_FLAG 0x8
2540 #define CERT_FIND_OR_ENHKEY_USAGE_FLAG 0x10
2541 #define CERT_FIND_OR_CTL_USAGE_FLAG 0x10
2542 #define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 0x20
2543 #define CERT_FIND_VALID_CTL_USAGE_FLAG 0x20
2545 #define CRL_FIND_ANY 0
2546 #define CRL_FIND_ISSUED_BY 1
2547 #define CRL_FIND_EXISTING 2
2548 #define CRL_FIND_ISSUED_FOR 3
2550 #define CRL_FIND_ISSUED_BY_AKI_FLAG 0x1
2551 #define CRL_FIND_ISSUED_BY_SIGNATURE_FLAG 0x2
2552 #define CRL_FIND_ISSUED_BY_DELTA_FLAG 0x4
2553 #define CRL_FIND_ISSUED_BY_BASE_FLAG 0x8
2555 typedef struct _CRL_FIND_ISSUED_FOR_PARA
2557 PCCERT_CONTEXT pSubjectCert;
2558 PCCERT_CONTEXT pIssuerCert;
2559 } CRL_FIND_ISSUED_FOR_PARA, *PCRL_FIND_ISSUED_FOR_PARA;
2561 /* PFN_CERT_STORE_PROV_WRITE_CERT dwFlags values */
2562 #define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1
2564 /* CertAddSerializedElementToStore context types */
2565 #define CERT_STORE_CERTIFICATE_CONTEXT 1
2566 #define CERT_STORE_CRL_CONTEXT 2
2567 #define CERT_STORE_CTL_CONTEXT 3
2568 #define CERT_STORE_ALL_CONTEXT_FLAG ~0U
2569 #define CERT_STORE_CERTIFICATE_CONTEXT_FLAG \
2570 (1 << CERT_STORE_CERTIFICATE_CONTEXT)
2571 #define CERT_STORE_CRL_CONTEXT_FLAG (1 << CERT_STORE_CRL_CONTEXT)
2572 #define CERT_STORE_CTL_CONTEXT_FLAG (1 << CERT_STORE_CTL_CONTEXT)
2574 /* CryptBinaryToString/CryptStringToBinary flags */
2575 #define CRYPT_STRING_BASE64HEADER 0x00000000
2576 #define CRYPT_STRING_BASE64 0x00000001
2577 #define CRYPT_STRING_BINARY 0x00000002
2578 #define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003
2579 #define CRYPT_STRING_HEX 0x00000004
2580 #define CRYPT_STRING_HEXASCII 0x00000005
2581 #define CRYPT_STRING_BASE64_ANY 0x00000006
2582 #define CRYPT_STRING_ANY 0x00000007
2583 #define CRYPT_STRING_HEX_ANY 0x00000008
2584 #define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009
2585 #define CRYPT_STRING_HEXADDR 0x0000000a
2586 #define CRYPT_STRING_HEXASCIIADDR 0x0000000b
2587 #define CRYPT_STRING_NOCR 0x80000000
2589 /* OIDs */
2590 #define szOID_RSA "1.2.840.113549"
2591 #define szOID_PKCS "1.2.840.113549.1"
2592 #define szOID_RSA_HASH "1.2.840.113549.2"
2593 #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
2594 #define szOID_PKCS_1 "1.2.840.113549.1.1"
2595 #define szOID_PKCS_2 "1.2.840.113549.1.2"
2596 #define szOID_PKCS_3 "1.2.840.113549.1.3"
2597 #define szOID_PKCS_4 "1.2.840.113549.1.4"
2598 #define szOID_PKCS_5 "1.2.840.113549.1.5"
2599 #define szOID_PKCS_6 "1.2.840.113549.1.6"
2600 #define szOID_PKCS_7 "1.2.840.113549.1.7"
2601 #define szOID_PKCS_8 "1.2.840.113549.1.8"
2602 #define szOID_PKCS_9 "1.2.840.113549.1.9"
2603 #define szOID_PKCS_10 "1.2.840.113549.1.10"
2604 #define szOID_PKCS_11 "1.2.840.113549.1.12"
2605 #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
2606 #define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA
2607 #define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA
2608 #define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA
2609 #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
2610 #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
2611 #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
2612 #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
2613 #define szOID_RSA_SET0AEP_RSA "1.2.840.113549.1.1.6"
2614 #define szOID_RSA_DH "1.2.840.113549.1.3.1"
2615 #define szOID_RSA_data "1.2.840.113549.1.7.1"
2616 #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
2617 #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
2618 #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
2619 #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
2620 #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
2621 #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
2622 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
2623 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
2624 #define szOID_RSA_contentType "1.2.840.113549.1.9.3"
2625 #define szOID_RSA_messageDigest "1.2.840.113549.1.9.4"
2626 #define szOID_RSA_signingTime "1.2.840.113549.1.9.5"
2627 #define szOID_RSA_counterSign "1.2.840.113549.1.9.6"
2628 #define szOID_RSA_challengePwd "1.2.840.113549.1.9.7"
2629 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.9"
2630 #define szOID_RSA_extCertAttrs "1.2.840.113549.1.9.9"
2631 #define szOID_RSA_certExtensions "1.2.840.113549.1.9.14"
2632 #define szOID_RSA_SMIMECapabilities "1.2.840.113549.1.9.15"
2633 #define szOID_RSA_preferSignedData "1.2.840.113549.1.9.15.1"
2634 #define szOID_RSA_SMIMEalg "1.2.840.113549.1.9.16.3"
2635 #define szOID_RSA_SMIMEalgESDH "1.2.840.113549.1.9.16.3.5"
2636 #define szOID_RSA_SMIMEalgCMS3DESwrap "1.2.840.113549.1.9.16.3.6"
2637 #define szOID_RSA_SMIMEalgCMSRC2wrap "1.2.840.113549.1.9.16.3.7"
2638 #define szOID_RSA_MD2 "1.2.840.113549.2.2"
2639 #define szOID_RSA_MD4 "1.2.840.113549.2.4"
2640 #define szOID_RSA_MD5 "1.2.840.113549.2.5"
2641 #define szOID_RSA_RC2CBC "1.2.840.113549.3.2"
2642 #define szOID_RSA_RC4 "1.2.840.113549.3.4"
2643 #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
2644 #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
2645 #define szOID_ANSI_X942 "1.2.840.10046"
2646 #define szOID_ANSI_X942_DH "1.2.840.10046.2.1"
2647 #define szOID_X957 "1.2.840.10040"
2648 #define szOID_X957_DSA "1.2.840.10040.4.1"
2649 #define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
2650 #define szOID_DS "2.5"
2651 #define szOID_DSALG "2.5.8"
2652 #define szOID_DSALG_CRPT "2.5.8.1"
2653 #define szOID_DSALG_HASH "2.5.8.2"
2654 #define szOID_DSALG_SIGN "2.5.8.3"
2655 #define szOID_DSALG_RSA "2.5.8.1.1"
2656 #define szOID_OIW "1.3.14"
2657 #define szOID_OIWSEC "1.3.14.3.2"
2658 #define szOID_OIWSEC_md4RSA "1.3.14.3.2.2"
2659 #define szOID_OIWSEC_md5RSA "1.3.14.3.2.3"
2660 #define szOID_OIWSEC_md4RSA2 "1.3.14.3.2.4"
2661 #define szOID_OIWSEC_desECB "1.3.14.3.2.6"
2662 #define szOID_OIWSEC_desCBC "1.3.14.3.2.7"
2663 #define szOID_OIWSEC_desOFB "1.3.14.3.2.8"
2664 #define szOID_OIWSEC_desCFB "1.3.14.3.2.9"
2665 #define szOID_OIWSEC_desMAC "1.3.14.3.2.10"
2666 #define szOID_OIWSEC_rsaSign "1.3.14.3.2.11"
2667 #define szOID_OIWSEC_dsa "1.3.14.3.2.12"
2668 #define szOID_OIWSEC_shaDSA "1.3.14.3.2.13"
2669 #define szOID_OIWSEC_mdc2RSA "1.3.14.3.2.14"
2670 #define szOID_OIWSEC_shaRSA "1.3.14.3.2.15"
2671 #define szOID_OIWSEC_dhCommMod "1.3.14.3.2.16"
2672 #define szOID_OIWSEC_desEDE "1.3.14.3.2.17"
2673 #define szOID_OIWSEC_sha "1.3.14.3.2.18"
2674 #define szOID_OIWSEC_mdc2 "1.3.14.3.2.19"
2675 #define szOID_OIWSEC_dsaComm "1.3.14.3.2.20"
2676 #define szOID_OIWSEC_dsaCommSHA "1.3.14.3.2.21"
2677 #define szOID_OIWSEC_rsaXchg "1.3.14.3.2.22"
2678 #define szOID_OIWSEC_keyHashSeal "1.3.14.3.2.23"
2679 #define szOID_OIWSEC_md2RSASign "1.3.14.3.2.24"
2680 #define szOID_OIWSEC_md5RSASign "1.3.14.3.2.25"
2681 #define szOID_OIWSEC_sha1 "1.3.14.3.2.26"
2682 #define szOID_OIWSEC_dsaSHA1 "1.3.14.3.2.27"
2683 #define szOID_OIWSEC_dsaCommSHA1 "1.3.14.3.2.28"
2684 #define szOID_OIWSEC_sha1RSASign "1.3.14.3.2.29"
2685 #define szOID_OIWDIR "1.3.14.7.2"
2686 #define szOID_OIWDIR_CRPT "1.3.14.7.2.1"
2687 #define szOID_OIWDIR_HASH "1.3.14.7.2.2"
2688 #define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
2689 #define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
2690 #define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
2691 #define szOID_INFOSEC "2.16.840.1.101.2.1"
2692 #define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
2693 #define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
2694 #define szOID_INFOSEC_sdnsConfidentiality "2.16.840.1.101.2.1.1.3"
2695 #define szOID_INFOSEC_mosaicConfidentiality "2.16.840.1.101.2.1.1.4"
2696 #define szOID_INFOSEC_sdnsIntegrity "2.16.840.1.101.2.1.1.5"
2697 #define szOID_INFOSEC_mosaicIntegrity "2.16.840.1.101.2.1.1.6"
2698 #define szOID_INFOSEC_sdnsTokenProtection "2.16.840.1.101.2.1.1.7"
2699 #define szOID_INFOSEC_mosaicTokenProtection "2.16.840.1.101.2.1.1.8"
2700 #define szOID_INFOSEC_sdnsKeyManagement "2.16.840.1.101.2.1.1.9"
2701 #define szOID_INFOSEC_mosaicKeyManagement "2.16.840.1.101.2.1.1.10"
2702 #define szOID_INFOSEC_sdnsKMandSig "2.16.840.1.101.2.1.1.11"
2703 #define szOID_INFOSEC_mosaicKMandSig "2.16.840.1.101.2.1.1.12"
2704 #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
2705 #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
2706 #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
2707 #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
2708 #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
2709 #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
2710 #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
2711 #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
2712 #define szOID_INFOSEC_mosaicUpdateInteg "2.16.840.1.101.2.1.1.21"
2713 #define szOID_COMMON_NAME "2.5.4.3"
2714 #define szOID_SUR_NAME "2.5.4.4"
2715 #define szOID_DEVICE_SERIAL_NUMBER "2.5.4.5"
2716 #define szOID_COUNTRY_NAME "2.5.4.6"
2717 #define szOID_LOCALITY_NAME "2.5.4.7"
2718 #define szOID_STATE_OR_PROVINCE_NAME "2.5.4.8"
2719 #define szOID_STREET_ADDRESS "2.5.4.9"
2720 #define szOID_ORGANIZATION_NAME "2.5.4.10"
2721 #define szOID_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
2722 #define szOID_TITLE "2.5.4.12"
2723 #define szOID_DESCRIPTION "2.5.4.13"
2724 #define szOID_SEARCH_GUIDE "2.5.4.14"
2725 #define szOID_BUSINESS_CATEGORY "2.5.4.15"
2726 #define szOID_POSTAL_ADDRESS "2.5.4.16"
2727 #define szOID_POSTAL_CODE "2.5.4.17"
2728 #define szOID_POST_OFFICE_BOX "2.5.4.18"
2729 #define szOID_PHYSICAL_DELIVERY_OFFICE_NAME "2.5.4.19"
2730 #define szOID_TELEPHONE_NUMBER "2.5.4.20"
2731 #define szOID_TELEX_NUMBER "2.5.4.21"
2732 #define szOID_TELETEXT_TERMINAL_IDENTIFIER "2.5.4.22"
2733 #define szOID_FACSIMILE_TELEPHONE_NUMBER "2.5.4.23"
2734 #define szOID_X21_ADDRESS "2.5.4.24"
2735 #define szOID_INTERNATIONAL_ISDN_NUMBER "2.5.4.25"
2736 #define szOID_REGISTERED_ADDRESS "2.5.4.26"
2737 #define szOID_DESTINATION_INDICATOR "2.5.4.27"
2738 #define szOID_PREFERRED_DELIVERY_METHOD "2.5.4.28"
2739 #define szOID_PRESENTATION_ADDRESS "2.5.4.29"
2740 #define szOID_SUPPORTED_APPLICATION_CONTEXT "2.5.4.30"
2741 #define szOID_MEMBER "2.5.4.31"
2742 #define szOID_OWNER "2.5.4.32"
2743 #define szOID_ROLE_OCCUPANT "2.5.4.33"
2744 #define szOID_SEE_ALSO "2.5.4.34"
2745 #define szOID_USER_PASSWORD "2.5.4.35"
2746 #define szOID_USER_CERTIFICATE "2.5.4.36"
2747 #define szOID_CA_CERTIFICATE "2.5.4.37"
2748 #define szOID_AUTHORITY_REVOCATION_LIST "2.5.4.38"
2749 #define szOID_CERTIFICATE_REVOCATION_LIST "2.5.4.39"
2750 #define szOID_CROSS_CERTIFICATE_PAIR "2.5.4.40"
2751 #define szOID_GIVEN_NAME "2.5.4.42"
2752 #define szOID_INITIALS "2.5.4.43"
2753 #define szOID_DN_QUALIFIER "2.5.4.46"
2754 #define szOID_AUTHORITY_KEY_IDENTIFIER "2.5.29.1"
2755 #define szOID_KEY_ATTRIBUTES "2.5.29.2"
2756 #define szOID_CERT_POLICIES_95 "2.5.29.3"
2757 #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
2758 #define szOID_LEGACY_POLICY_MAPPINGS "2.5.29.5"
2759 #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
2760 #define szOID_ISSUER_ALT_NAME "2.5.29.8"
2761 #define szOID_SUBJECT_DIR_ATTRS "2.5.29.9"
2762 #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
2763 #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
2764 #define szOID_KEY_USAGE "2.5.29.15"
2765 #define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16"
2766 #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
2767 #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
2768 #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
2769 #define szOID_CRL_NUMBER "2.5.29.20"
2770 #define szOID_CRL_REASON_CODE "2.5.29.21"
2771 #define szOID_REASON_CODE_HOLD "2.5.29.23"
2772 #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
2773 #define szOID_ISSUING_DIST_POINT "2.5.29.28"
2774 #define szOID_NAME_CONSTRAINTS "2.5.29.30"
2775 #define szOID_CRL_DIST_POINTS "2.5.29.31"
2776 #define szOID_CERT_POLICIES "2.5.29.32"
2777 #define szOID_ANY_CERT_POLICY "2.5.29.32.0"
2778 #define szOID_POLICY_MAPPINGS "2.5.29.33"
2779 #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
2780 #define szOID_POLICY_CONSTRAINTS "2.5.29.36"
2781 #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
2782 #define szOID_FRESHEST_CRL "2.5.29.46"
2783 #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25"
2784 #define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20"
2785 #define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21"
2786 #define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14"
2787 #define szOID_NEXT_UPDATE_LOCATION "1.3.6.1.4.1.311.10.2"
2788 #define szOID_KP_CTL_USAGE_SIGNING "1.3.6.1.4.1.311.10.3.1"
2789 #define szOID_KP_TIME_STAMP_SIGNING "1.3.6.1.4.1.311.10.3.2"
2790 #ifndef szOID_SERVER_GATED_CRYPTO
2791 #define szOID_SERVER_GATED_CRYPTO "1.3.6.1.4.1.311.10.3.3"
2792 #endif
2793 #ifndef szOID_SGC_NETSCAPE
2794 #define szOID_SGC_NETSCAPE "2.16.840.1.113730.4.1"
2795 #endif
2796 #define szOID_KP_EFS "1.3.6.1.4.1.311.10.3.4"
2797 #define szOID_EFS_RECOVERY "1.3.6.1.4.1.311.10.3.4.1"
2798 #define szOID_WHQL_CRYPTO "1.3.6.1.4.1.311.10.3.5"
2799 #define szOID_NT5_CRYPTO "1.3.6.1.4.1.311.10.3.6"
2800 #define szOID_OEM_WHQL_CRYPTO "1.3.6.1.4.1.311.10.3.7"
2801 #define szOID_EMBEDDED_NT_CRYPTO "1.3.6.1.4.1.311.10.3.8"
2802 #define szOID_ROOT_LIST_SIGNER "1.3.6.1.4.1.311.10.3.9"
2803 #define szOID_KP_QUALIFIED_SUBORDINATION "1.3.6.1.4.1.311.10.3.10"
2804 #define szOID_KP_KEY_RECOVERY "1.3.6.1.4.1.311.10.3.11"
2805 #define szOID_KP_DOCUMENT_SIGNING "1.3.6.1.4.1.311.10.3.12"
2806 #define szOID_KP_LIFETIME_SIGNING "1.3.6.1.4.1.311.10.3.13"
2807 #define szOID_KP_MOBILE_DEVICE_SOFTWARE "1.3.6.1.4.1.311.10.3.14"
2808 #define szOID_YESNO_TRUST_ATTR "1.3.6.1.4.1.311.10.4.1"
2809 #ifndef szOID_DRM
2810 #define szOID_DRM "1.3.6.1.4.1.311.10.5.1"
2811 #endif
2812 #ifndef szOID_DRM_INDIVIDUALIZATION
2813 #define szOID_DRM_INDIVIDUALIZATION "1.3.6.1.4.1.311.10.5.2"
2814 #endif
2815 #ifndef szOID_LICENSES
2816 #define szOID_LICENSES "1.3.6.1.4.1.311.10.6.1"
2817 #endif
2818 #ifndef szOID_LICENSE_SERVER
2819 #define szOID_LICENSE_SERVER "1.3.6.1.4.1.311.10.6.2"
2820 #endif
2821 #define szOID_REMOVE_CERTIFICATE "1.3.6.1.4.1.311.10.8.1"
2822 #define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1"
2823 #define szOID_CTL "1.3.6.1.4.1.311.10.10.1"
2824 #define szOID_SORTED_CTL "1.3.6.1.4.1.311.10.10.1.1"
2825 #define szOID_ANY_APPLICATION_POLICY "1.3.6.1.4.1.311.10.12.1"
2826 #define szOID_RENEWAL_CERTIFICATE "1.3.6.1.4.1.311.13.1"
2827 #define szOID_ENROLLMENT_NAME_VALUE_PAIR "1.3.6.1.4.1.311.13.2.1"
2828 #define szOID_ENROLLMENT_CSP_PROVIDER "1.3.6.1.4.1.311.13.2.2"
2829 #define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3"
2830 #define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1"
2831 #define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2"
2832 #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
2833 #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
2834 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
2835 #define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2"
2836 #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
2837 #ifndef szOID_CERTSRV_CA_VERSION
2838 #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
2839 #endif
2840 #define szOID_CERTSRV_PREVIOUS_CERT_HASH "1.3.6.1.4.1.311.21.2"
2841 #define szOID_CRL_VIRTUAL_BASE "1.3.6.1.4.1.311.21.3"
2842 #define szOID_CRL_NEXT_PUBLISH "1.3.6.1.4.1.311.21.4"
2843 #define szOID_KP_CA_EXCHANGE "1.3.6.1.4.1.311.21.5"
2844 #define szOID_KP_KEY_RECOVERY_AGENT "1.3.6.1.4.1.311.21.6"
2845 #define szOID_CERTIFICATE_TEMPLATE "1.3.6.1.4.1.311.21.7"
2846 #define szOID_ENTERPRISE_OID_ROOT "1.3.6.1.4.1.311.21.8"
2847 #define szOID_RDN_DUMMY_SIGNER "1.3.6.1.4.1.311.21.9"
2848 #define szOID_APPLICATION_CERT_POLICIES "1.3.6.1.4.1.311.21.10"
2849 #define szOID_APPLICATION_POLICY_MAPPINGS "1.3.6.1.4.1.311.21.11"
2850 #define szOID_APPLICATION_POLICY_CONSTRAINTS "1.3.6.1.4.1.311.21.12"
2851 #define szOID_ARCHIVED_KEY_ATTR "1.3.6.1.4.1.311.21.13"
2852 #define szOID_CRL_SELF_CDP "1.3.6.1.4.1.311.21.14"
2853 #define szOID_REQUIRE_CERT_CHAIN_POLICY "1.3.6.1.4.1.311.21.15"
2854 #define szOID_ARCHIVED_KEY_CERT_HASH "1.3.6.1.4.1.311.21.16"
2855 #define szOID_ISSUED_CERT_HASH "1.3.6.1.4.1.311.21.17"
2856 #define szOID_DS_EMAIL_REPLICATION "1.3.6.1.4.1.311.21.19"
2857 #define szOID_REQUEST_CLIENT_INFO "1.3.6.1.4.1.311.21.20"
2858 #define szOID_ENCRYPTED_KEY_HASH "1.3.6.1.4.1.311.21.21"
2859 #define szOID_CERTSRV_CROSSCA_VERSION "1.3.6.1.4.1.311.21.22"
2860 #define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1"
2861 #define szOID_PKIX "1.3.6.1.5.5.7"
2862 #define szOID_PKIX_PE "1.3.6.1.5.5.7.1"
2863 #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
2864 #define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1"
2865 #define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2"
2866 #define szOID_PKIX_KP "1.3.6.1.5.5.7.3"
2867 #define szOID_PKIX_KP_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
2868 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
2869 #define szOID_PKIX_KP_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
2870 #define szOID_PKIX_KP_EMAIL_PROTECTION "1.3.6.1.5.5.7.3.4"
2871 #define szOID_PKIX_KP_IPSEC_END_SYSTEM "1.3.6.1.5.5.7.3.5"
2872 #define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6"
2873 #define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7"
2874 #define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8"
2875 #define szOID_PKIX_NO_SIGNATURE "1.3.6.1.5.5.7.6.2"
2876 #define szOID_CMC "1.3.6.1.5.5.7.7"
2877 #define szOID_CMC_STATUS_INFO "1.3.6.1.5.5.7.7.1"
2878 #define szOID_CMC_IDENTIFICATION "1.3.6.1.5.5.7.7.2"
2879 #define szOID_CMC_IDENTITY_PROOF "1.3.6.1.5.5.7.7.3"
2880 #define szOID_CMC_DATA_RETURN "1.3.6.1.5.5.7.7.4"
2881 #define szOID_CMC_TRANSACTION_ID "1.3.6.1.5.5.7.7.5"
2882 #define szOID_CMC_SENDER_NONCE "1.3.6.1.5.5.7.7.6"
2883 #define szOID_CMC_RECIPIENT_NONCE "1.3.6.1.5.5.7.7.7"
2884 #define szOID_CMC_ADD_EXTENSIONS "1.3.6.1.5.5.7.7.8"
2885 #define szOID_CMC_ENCRYPTED_POP "1.3.6.1.5.5.7.7.9"
2886 #define szOID_CMC_DECRYPTED_POP "1.3.6.1.5.5.7.7.10"
2887 #define szOID_CMC_LRA_POP_WITNESS "1.3.6.1.5.5.7.7.11"
2888 #define szOID_CMC_GET_CERT "1.3.6.1.5.5.7.7.15"
2889 #define szOID_CMC_GET_CRL "1.3.6.1.5.5.7.7.16"
2890 #define szOID_CMC_REVOKE_REQUEST "1.3.6.1.5.5.7.7.17"
2891 #define szOID_CMC_REG_INFO "1.3.6.1.5.5.7.7.18"
2892 #define szOID_CMC_RESPONSE_INFO "1.3.6.1.5.5.7.7.19"
2893 #define szOID_CMC_QUERY_PENDING "1.3.6.1.5.5.7.7.21"
2894 #define szOID_CMC_ID_POP_LINK_RANDOM "1.3.6.1.5.5.7.7.22"
2895 #define szOID_CMC_ID_POP_LINK_WITNESS "1.3.6.1.5.5.7.7.23"
2896 #define szOID_CT_PKI_DATA "1.3.6.1.5.5.7.12.2"
2897 #define szOID_CT_PKI_RESPONSE "1.3.6.1.5.5.7.12.3"
2898 #define szOID_PKIX_ACC_DESCR "1.3.6.1.5.5.7.48"
2899 #define szOID_PKIX_OCSP "1.3.6.1.5.5.7.48.1"
2900 #define szOID_PKIX_CA_ISSUERS "1.3.6.1.5.5.7.48.2"
2901 #define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2"
2903 #ifndef szOID_SERIALIZED
2904 #define szOID_SERIALIZED "1.3.6.1.4.1.311.10.3.3.1"
2905 #endif
2907 #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
2908 #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
2909 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
2910 #ifndef szOID_KP_SMARTCARD_LOGON
2911 #define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2"
2912 #endif
2913 #ifndef szOID_NT_PRINCIPAL_NAME
2914 #define szOID_NT_PRINCIPAL_NAME "1.3.6.1.4.1.311.20.2.3"
2915 #endif
2916 #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
2918 #ifndef szOID_CERTSRV_CA_VERSION
2919 #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
2920 #endif
2922 #ifndef szOID_PRODUCT_UPDATE
2923 #define szOID_PRODUCT_UPDATE "1.3.6.1.4.1.311.31.1"
2924 #endif
2926 #define szOID_NETSCAPE "2.16.840.1.113730"
2927 #define szOID_NETSCAPE_CERT_EXTENSION "2.16.840.1.113730.1"
2928 #define szOID_NETSCAPE_CERT_TYPE "2.16.840.1.113730.1.1"
2929 #define szOID_NETSCAPE_BASE_URL "2.16.840.1.113730.1.2"
2930 #define szOID_NETSCAPE_REVOCATION_URL "2.16.840.1.113730.1.3"
2931 #define szOID_NETSCAPE_CA_REVOCATION_URL "2.16.840.1.113730.1.4"
2932 #define szOID_NETSCAPE_CERT_RENEWAL_URL "2.16.840.1.113730.1.7"
2933 #define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8"
2934 #define szOID_NETSCAPE_SSL_SERVER_NAME "2.16.840.1.113730.1.12"
2935 #define szOID_NETSCAPE_COMMENT "2.16.840.1.113730.1.13"
2937 #define CRYPT_ENCODE_DECODE_NONE 0
2938 #define X509_CERT ((LPCSTR)1)
2939 #define X509_CERT_TO_BE_SIGNED ((LPCSTR)2)
2940 #define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR)3)
2941 #define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR)4)
2942 #define X509_EXTENSIONS ((LPCSTR)5)
2943 #define X509_NAME_VALUE ((LPCSTR)6)
2944 #define X509_ANY_STRING X509_NAME_VALUE
2945 #define X509_NAME ((LPCSTR)7)
2946 #define X509_PUBLIC_KEY_INFO ((LPCSTR)8)
2947 #define X509_AUTHORITY_KEY_ID ((LPCSTR)9)
2948 #define X509_KEY_ATTRIBUTES ((LPCSTR)10)
2949 #define X509_KEY_USAGE_RESTRICTION ((LPCSTR)11)
2950 #define X509_ALTERNATE_NAME ((LPCSTR)12)
2951 #define X509_BASIC_CONSTRAINTS ((LPCSTR)13)
2952 #define X509_KEY_USAGE ((LPCSTR)14)
2953 #define X509_BASIC_CONSTRAINTS2 ((LPCSTR)15)
2954 #define X509_CERT_POLICIES ((LPCSTR)16)
2955 #define PKCS_UTC_TIME ((LPCSTR)17)
2956 #define PKCS_TIME_REQUEST ((LPCSTR)18)
2957 #define RSA_CSP_PUBLICKEYBLOB ((LPCSTR)19)
2958 #define X509_UNICODE_NAME ((LPCSTR)20)
2959 #define X509_KEYGEN_REQUEST_TO_BE_SIGNED ((LPCSTR)21)
2960 #define PKCS_ATTRIBUTE ((LPCSTR)22)
2961 #define PKCS_CONTENT_INFO_SEQUENCE_OF_ANY ((LPCSTR)23)
2962 #define X509_UNICODE_NAME_VALUE ((LPCSTR)24)
2963 #define X509_UNICODE_ANY_STRING X509_UNICODE_NAME_VALUE
2964 #define X509_OCTET_STRING ((LPCSTR)25)
2965 #define X509_BITS ((LPCSTR)26)
2966 #define X509_INTEGER ((LPCSTR)27)
2967 #define X509_MULTI_BYTE_INTEGER ((LPCSTR)28)
2968 #define X509_ENUMERATED ((LPCSTR)29)
2969 #define X509_CRL_REASON_CODE X509_ENUMERATED
2970 #define X509_CHOICE_OF_TIME ((LPCSTR)30)
2971 #define X509_AUTHORITY_KEY_ID2 ((LPCSTR)31)
2972 #define X509_AUTHORITY_INFO_ACCESS ((LPCSTR)32)
2973 #define PKCS_CONTENT_INFO ((LPCSTR)33)
2974 #define X509_SEQUENCE_OF_ANY ((LPCSTR)34)
2975 #define X509_CRL_DIST_POINTS ((LPCSTR)35)
2976 #define X509_ENHANCED_KEY_USAGE ((LPCSTR)36)
2977 #define PKCS_CTL ((LPCSTR)37)
2978 #define X509_MULTI_BYTE_UINT ((LPCSTR)38)
2979 #define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT
2980 #define X509_DSS_PARAMETERS ((LPCSTR)39)
2981 #define X509_DSS_SIGNATURE ((LPCSTR)40)
2982 #define PKCS_RC2_CBC_PARAMETERS ((LPCSTR)41)
2983 #define PKCS_SMIME_CAPABILITIES ((LPCSTR)42)
2984 #define PKCS_RSA_PRIVATE_KEY ((LPCSTR)43)
2985 #define PKCS_PRIVATE_KEY_INFO ((LPCSTR)44)
2986 #define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR)45)
2987 #define X509_PKIX_POLICY_QUALIFIER_USERNOTICE ((LPCSTR)46)
2988 #define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
2989 #define X509_DH_PARAMETERS ((LPCSTR)47)
2990 #define PKCS_ATTRIBUTES ((LPCSTR)48)
2991 #define PKCS_SORTED_CTL ((LPCSTR)49)
2992 #define X942_DH_PARAMETERS ((LPCSTR)50)
2993 #define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR)51)
2994 #define X942_OTHER_INFO ((LPCSTR)52)
2995 #define X509_CERT_PAIR ((LPCSTR)53)
2996 #define X509_ISSUING_DIST_POINT ((LPCSTR)54)
2997 #define X509_NAME_CONSTRAINTS ((LPCSTR)55)
2998 #define X509_POLICY_MAPPINGS ((LPCSTR)56)
2999 #define X509_POLICY_CONSTRAINTS ((LPCSTR)57)
3000 #define X509_CROSS_CERT_DIST_POINTS ((LPCSTR)58)
3001 #define CMC_DATA ((LPCSTR)59)
3002 #define CMC_RESPONSE ((LPCSTR)60)
3003 #define CMC_STATUS ((LPCSTR)61)
3004 #define CMC_ADD_EXTENSIONS ((LPCSTR)62)
3005 #define CMC_ADD_ATTRIBUTES ((LPCSTR)63)
3006 #define X509_CERTIFICATE_TEMPLATE ((LPCSTR)64)
3007 #define PKCS7_SIGNER_INFO ((LPCSTR)500)
3008 #define CMS_SIGNER_INFO ((LPCSTR)501)
3010 /* encode/decode flags */
3011 #define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
3012 #define CRYPT_ENCODE_ALLOC_FLAG 0x08000
3013 #define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000
3014 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG \
3015 CERT_RDN_ENABLE_T61_UNICODE_FLAG
3016 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG \
3017 CERT_RDN_ENABLE_UTF8_UNICODE_FLAG
3018 #define CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG \
3019 CERT_RDN_DISABLE_CHECK_TYPE_FLAG
3021 #define CRYPT_DECODE_NOCOPY_FLAG 0x00001
3022 #define CRYPT_DECODE_TO_BE_SIGNED_FLAG 0x00002
3023 #define CRYPT_DECODE_SHARE_OID_STRING_FLAG 0x00004
3024 #define CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
3025 #define CRYPT_DECODE_ALLOC_FLAG 0x08000
3026 #define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \
3027 CERT_RDN_DISABLE_IE4_UTF8_FLAG
3029 #define CERT_STORE_SIGNATURE_FLAG 0x00000001
3030 #define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002
3031 #define CERT_STORE_REVOCATION_FLAG 0x00000004
3032 #define CERT_STORE_NO_CRL_FLAG 0x00010000
3033 #define CERT_STORE_NO_ISSUER_FLAG 0x00020000
3035 #define CERT_STORE_BASE_CRL_FLAG 0x00000100
3036 #define CERT_STORE_DELTA_CRL_FLAG 0x00000200
3038 /* subject types for CryptVerifyCertificateSignatureEx */
3039 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1
3040 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2
3041 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3
3043 /* issuer types for CryptVerifyCertificateSignatureEx */
3044 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1
3045 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2
3046 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3
3047 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4
3049 #define CRYPT_GET_URL_FROM_PROPERTY 0x00000001
3050 #define CRYPT_GET_URL_FROM_EXTENSION 0x00000002
3051 #define CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE 0x00000004
3052 #define CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE 0x00000008
3054 /* Certificate name string types and flags */
3055 #define CERT_SIMPLE_NAME_STR 1
3056 #define CERT_OID_NAME_STR 2
3057 #define CERT_X500_NAME_STR 3
3058 #define CERT_NAME_STR_SEMICOLON_FLAG 0x40000000
3059 #define CERT_NAME_STR_NO_PLUS_FLAG 0x20000000
3060 #define CERT_NAME_STR_NO_QUOTING_FLAG 0x10000000
3061 #define CERT_NAME_STR_CRLF_FLAG 0x08000000
3062 #define CERT_NAME_STR_COMMA_FLAG 0x04000000
3063 #define CERT_NAME_STR_REVERSE_FLAG 0x02000000
3064 #define CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG 0x00040000
3065 #define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 0x00020000
3066 #define CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG 0x00010000
3068 #define CERT_NAME_EMAIL_TYPE 1
3069 #define CERT_NAME_RDN_TYPE 2
3070 #define CERT_NAME_ATTR_TYPE 3
3071 #define CERT_NAME_SIMPLE_DISPLAY_TYPE 4
3072 #define CERT_NAME_FRIENDLY_DISPLAY_TYPE 5
3073 #define CERT_NAME_DNS_TYPE 6
3074 #define CERT_NAME_URL_TYPE 7
3075 #define CERT_NAME_UPN_TYPE 8
3077 #define CERT_NAME_ISSUER_FLAG 0x00000001
3078 #define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000
3080 /* CryptFormatObject flags */
3081 #define CRYPT_FORMAT_STR_MULTI_LINE 0x0001
3082 #define CRYPT_FORMAT_STR_NO_HEX 0x0010
3084 #define CRYPT_FORMAT_SIMPLE 0x0001
3085 #define CRYPT_FORMAT_X509 0x0002
3086 #define CRYPT_FORMAT_OID 0x0004
3087 #define CRYPT_FORMAT_RDN_SEMICOLON 0x0100
3088 #define CRYPT_FORMAT_RDN_CRLF 0x0200
3089 #define CRYPT_FORMAT_RDN_UNQUOTE 0x0400
3090 #define CRYPT_FORMAT_RDN_REVERSE 0x0800
3092 #define CRYPT_FORMAT_COMMA 0x1000
3093 #define CRYPT_FORMAT_SEMICOLON CRYPT_FORMAT_RDN_SEMICOLON
3094 #define CRYPT_FORMAT_CRLF CRYPT_FORMAT_RDN_CRLF
3096 /* CryptQueryObject types and flags */
3097 #define CERT_QUERY_OBJECT_FILE 1
3098 #define CERT_QUERY_OBJECT_BLOB 2
3100 #define CERT_QUERY_CONTENT_CERT 1
3101 #define CERT_QUERY_CONTENT_CTL 2
3102 #define CERT_QUERY_CONTENT_CRL 3
3103 #define CERT_QUERY_CONTENT_SERIALIZED_STORE 4
3104 #define CERT_QUERY_CONTENT_SERIALIZED_CERT 5
3105 #define CERT_QUERY_CONTENT_SERIALIZED_CTL 6
3106 #define CERT_QUERY_CONTENT_SERIALIZED_CRL 7
3107 #define CERT_QUERY_CONTENT_PKCS7_SIGNED 8
3108 #define CERT_QUERY_CONTENT_PKCS7_UNSIGNED 9
3109 #define CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED 10
3110 #define CERT_QUERY_CONTENT_PKCS10 11
3111 #define CERT_QUERY_CONTENT_PFX 12
3112 #define CERT_QUERY_CONTENT_CERT_PAIR 13
3114 #define CERT_QUERY_CONTENT_FLAG_CERT (1 << CERT_QUERY_CONTENT_CERT)
3115 #define CERT_QUERY_CONTENT_FLAG_CTL (1 << CERT_QUERY_CONTENT_CTL)
3116 #define CERT_QUERY_CONTENT_FLAG_CRL (1 << CERT_QUERY_CONTENT_CRL)
3117 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE \
3118 (1 << CERT_QUERY_CONTENT_SERIALIZED_STORE)
3119 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT \
3120 (1 << CERT_QUERY_CONTENT_SERIALIZED_CERT)
3121 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL \
3122 (1 << CERT_QUERY_CONTENT_SERIALIZED_CTL)
3123 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL \
3124 (1 << CERT_QUERY_CONTENT_SERIALIZED_CRL)
3125 #define CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED \
3126 (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED)
3127 #define CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED \
3128 (1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED)
3129 #define CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED \
3130 (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED)
3131 #define CERT_QUERY_CONTENT_FLAG_PKCS10 (1 << CERT_QUERY_CONTENT_PKCS10)
3132 #define CERT_QUERY_CONTENT_FLAG_PFX (1 << CERT_QUERY_CONTENT_PFX)
3133 #define CERT_QUERY_CONTENT_FLAG_CERT_PAIR (1 << CERT_QUERY_CONTENT_CERT_PAIR)
3135 #define CERT_QUERY_CONTENT_FLAG_ALL \
3136 CERT_QUERY_CONTENT_FLAG_CERT | \
3137 CERT_QUERY_CONTENT_FLAG_CTL | \
3138 CERT_QUERY_CONTENT_FLAG_CRL | \
3139 CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \
3140 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \
3141 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | \
3142 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | \
3143 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \
3144 CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | \
3145 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | \
3146 CERT_QUERY_CONTENT_FLAG_PKCS10 | \
3147 CERT_QUERY_CONTENT_FLAG_PFX | \
3148 CERT_QUERY_CONTENT_FLAG_CERT_PAIR
3150 #define CERT_QUERY_FORMAT_BINARY 1
3151 #define CERT_QUERY_FORMAT_BASE64_ENCODED 2
3152 #define CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED 3
3154 #define CERT_QUERY_FORMAT_FLAG_BINARY (1 << CERT_QUERY_FORMAT_BINARY)
3155 #define CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED \
3156 (1 << CERT_QUERY_FORMAT_BASE64_ENCODED)
3157 #define CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
3158 (1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
3160 #define CERT_QUERY_FORMAT_FLAG_ALL \
3161 CERT_QUERY_FORMAT_FLAG_BINARY | \
3162 CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | \
3163 CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
3165 #define CERT_SET_KEY_PROV_HANDLE_PROP_ID 0x00000001
3166 #define CERT_SET_KEY_CONTEXT_PROP_ID 0x00000001
3168 #define CERT_CREATE_SELFSIGN_NO_SIGN 1
3169 #define CERT_CREATE_SELFSIGN_NO_KEY_INFO 2
3171 /* flags for CryptAcquireCertificatePrivateKey */
3172 #define CRYPT_ACQUIRE_CACHE_FLAG 0x00000001
3173 #define CRYPT_ACQUIRE_USE_PROV_INFO_FLAG 0x00000002
3174 #define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
3175 #define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040
3177 /* Chain engines and chains */
3178 typedef HANDLE HCERTCHAINENGINE;
3179 #define HCCE_CURRENT_USER ((HCERTCHAINENGINE)NULL)
3180 #define HCCE_LOCAL_MACHINE ((HCERTCHAINENGINE)1)
3182 #define CERT_CHAIN_CACHE_END_CERT 0x00000001
3183 #define CERT_CHAIN_THREAD_STORE_SYNC 0x00000002
3184 #define CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL 0x00000004
3185 #define CERT_CHAIN_USE_LOCAL_MACHINE_STORE 0x00000008
3186 #define CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE 0x00000010
3187 #define CERT_CHAIN_ENABLE_SHARE_STORE 0x00000020
3189 typedef struct _CERT_CHAIN_ENGINE_CONFIG
3191 DWORD cbSize;
3192 HCERTSTORE hRestrictedRoot;
3193 HCERTSTORE hRestrictedTrust;
3194 HCERTSTORE hRestrictedOther;
3195 DWORD cAdditionalStore;
3196 HCERTSTORE *rghAdditionalStore;
3197 DWORD dwFlags;
3198 DWORD dwUrlRetrievalTimeout;
3199 DWORD MaximumCachedCertificates;
3200 DWORD CycleDetectionModulus;
3201 } CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
3203 /* message-related definitions */
3205 typedef BOOL (WINAPI *PFN_CMSG_STREAM_OUTPUT)(const void *pvArg, BYTE *pbData,
3206 DWORD cbData, BOOL fFinal);
3208 #define CMSG_INDEFINITE_LENGTH 0xffffffff
3210 typedef struct _CMSG_STREAM_INFO
3212 DWORD cbContent;
3213 PFN_CMSG_STREAM_OUTPUT pfnStreamOutput;
3214 void *pvArg;
3215 } CMSG_STREAM_INFO, *PCMSG_STREAM_INFO;
3217 typedef struct _CERT_ISSUER_SERIAL_NUMBER
3219 CERT_NAME_BLOB Issuer;
3220 CRYPT_INTEGER_BLOB SerialNumber;
3221 } CERT_ISSUER_SERIAL_NUMBER, *PCERT_ISSUER_SERIAL_NUMBER;
3223 typedef struct _CERT_ID
3225 DWORD dwIdChoice;
3226 union {
3227 CERT_ISSUER_SERIAL_NUMBER IssuerSerialNumber;
3228 CRYPT_HASH_BLOB KeyId;
3229 CRYPT_HASH_BLOB HashId;
3230 } DUMMYUNIONNAME;
3231 } CERT_ID, *PCERT_ID;
3233 #define CERT_ID_ISSUER_SERIAL_NUMBER 1
3234 #define CERT_ID_KEY_IDENTIFIER 2
3235 #define CERT_ID_SHA1_HASH 3
3237 #undef CMSG_DATA /* may be defined by sys/socket.h */
3238 #define CMSG_DATA 1
3239 #define CMSG_SIGNED 2
3240 #define CMSG_ENVELOPED 3
3241 #define CMSG_SIGNED_AND_ENVELOPED 4
3242 #define CMSG_HASHED 5
3243 #define CMSG_ENCRYPTED 6
3245 #define CMSG_ALL_FLAGS ~0U
3246 #define CMSG_DATA_FLAG (1 << CMSG_DATA)
3247 #define CMSG_SIGNED_FLAG (1 << CMSG_SIGNED)
3248 #define CMSG_ENVELOPED_FLAG (1 << CMSG_ENVELOPED)
3249 #define CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << CMSG_SIGNED_AND_ENVELOPED)
3250 #define CMSG_ENCRYPTED_FLAG (1 << CMSG_ENCRYPTED)
3252 typedef struct _CMSG_SIGNER_ENCODE_INFO
3254 DWORD cbSize;
3255 PCERT_INFO pCertInfo;
3256 HCRYPTPROV hCryptProv;
3257 DWORD dwKeySpec;
3258 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3259 void *pvHashAuxInfo;
3260 DWORD cAuthAttr;
3261 PCRYPT_ATTRIBUTE rgAuthAttr;
3262 DWORD cUnauthAttr;
3263 PCRYPT_ATTRIBUTE rgUnauthAttr;
3264 #ifdef CMSG_SIGNER_ENCODE_INFO_HAS_CMS_FIELDS
3265 CERT_ID SignerId;
3266 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
3267 void *pvHashEncryptionAuxInfo;
3268 #endif
3269 } CMSG_SIGNER_ENCODE_INFO, *PCMSG_SIGNER_ENCODE_INFO;
3271 typedef struct _CMSG_SIGNED_ENCODE_INFO
3273 DWORD cbSize;
3274 DWORD cSigners;
3275 PCMSG_SIGNER_ENCODE_INFO rgSigners;
3276 DWORD cCertEncoded;
3277 PCERT_BLOB rgCertEncoded;
3278 DWORD cCrlEncoded;
3279 PCRL_BLOB rgCrlEncoded;
3280 #ifdef CMSG_SIGNED_ENCODE_INFO_HAS_CMS_FIELDS
3281 DWORD cAttrCertEncoded;
3282 PCERT_BLOB rgAttrCertEncoded;
3283 #endif
3284 } CMSG_SIGNED_ENCODE_INFO, *PCMSG_SIGNED_ENCODE_INFO;
3286 typedef struct _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO
3288 DWORD cbSize;
3289 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3290 void *pvKeyEncryptionAuxInfo;
3291 HCRYPTPROV_LEGACY hCryptProv;
3292 CRYPT_BIT_BLOB RecipientPublicKey;
3293 CERT_ID RecipientId;
3294 } CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO;
3296 typedef struct _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO
3298 DWORD cbSize;
3299 CRYPT_BIT_BLOB RecipientPublicKey;
3300 CERT_ID RecipientId;
3301 FILETIME Date;
3302 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3303 } CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO,
3304 *PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO;
3306 typedef struct _CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO
3308 DWORD cbSize;
3309 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3310 void *pvKeyEncryptionAuxInfo;
3311 CRYPT_ALGORITHM_IDENTIFIER KeyWrapAlgorithm;
3312 void *pvKeyWrapAuxInfo;
3313 HCRYPTPROV_LEGACY hCryptProv;
3314 DWORD dwKeySpec;
3315 DWORD dwKeyChoice;
3316 union {
3317 PCRYPT_ALGORITHM_IDENTIFIER pEphemeralAlgorithm;
3318 PCERT_ID pSenderId;
3319 } DUMMYUNIONNAME;
3320 CRYPT_DATA_BLOB UserKeyingMaterial;
3321 DWORD cRecipientEncryptedKeys;
3322 PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO *rgpRecipientEncryptedKeys;
3323 } CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO;
3325 #define CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE 1
3326 #define CMSG_KEY_AGREE_STATIC_KEY_CHOICE 2
3328 typedef struct _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO
3330 DWORD cbSize;
3331 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3332 void *pvKeyEncryptionAuxInfo;
3333 HCRYPTPROV hCryptProv;
3334 DWORD dwKeyChoice;
3335 union {
3336 HCRYPTKEY hKeyEncryptionKey;
3337 void *pvKeyEncryptionKey;
3338 } DUMMYUNIONNAME;
3339 CRYPT_DATA_BLOB KeyId;
3340 FILETIME Date;
3341 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3342 } CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, *PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO;
3344 #define CMSG_MAIL_LIST_HANDLE_KEY_CHOICE 1
3346 typedef struct _CMSG_RECIPIENT_ENCODE_INFO
3348 DWORD dwRecipientChoice;
3349 union {
3350 PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTrans;
3351 PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO pKeyAgree;
3352 PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO pMailList;
3353 } DUMMYUNIONNAME;
3354 } CMSG_RECIPIENT_ENCODE_INFO, *PCMSG_RECIPIENT_ENCODE_INFO;
3356 #define CMSG_KEY_TRANS_RECIPIENT 1
3357 #define CMSG_KEY_AGREE_RECIPIENT 2
3358 #define CMSG_MAIL_LIST_RECIPIENT 3
3360 typedef struct _CMSG_ENVELOPED_ENCODE_INFO
3362 DWORD cbSize;
3363 HCRYPTPROV_LEGACY hCryptProv;
3364 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3365 void *pvEncryptionAuxInfo;
3366 DWORD cRecipients;
3367 PCERT_INFO *rgpRecipientCert;
3368 #ifdef CMSG_ENVELOPED_ENCODE_INFO_HAS_CMS_FIELDS
3369 PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients;
3370 DWORD cCertEncoded;
3371 PCERT_BLOB rgCertEncoded;
3372 DWORD cCrlEncoded;
3373 PCRL_BLOB rgCrlEncoded;
3374 DWORD cAttrCertEncoded;
3375 PCERT_BLOB rgAttrCertEncoded;
3376 DWORD cUnprotectedAttr;
3377 PCRYPT_ATTRIBUTE rgUnprotectedAttr;
3378 #endif
3379 } CMSG_ENVELOPED_ENCODE_INFO, *PCMSG_ENVELOPED_ENCODE_INFO;
3381 typedef struct _CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO
3383 DWORD cbSize;
3384 CMSG_SIGNED_ENCODE_INFO SignedInfo;
3385 CMSG_ENVELOPED_ENCODE_INFO EnvelopedInfo;
3386 } CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO,
3387 *PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO;
3389 typedef struct _CMSG_HASHED_ENCODE_INFO
3391 DWORD cbSize;
3392 HCRYPTPROV_LEGACY hCryptProv;
3393 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3394 void *pvHashAuxInfo;
3395 } CMSG_HASHED_ENCODE_INFO, *PCMSG_HASHED_ENCODE_INFO;
3397 typedef struct _CMSG_ENCRYPTED_ENCODE_INFO
3399 DWORD cbSize;
3400 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3401 void *pvEncryptionAuxInfo;
3402 } CMSG_ENCRYPTED_ENCODE_INFO, *PCMSG_ENCRYPTED_ENCODE_INFO;
3404 #define CMSG_BARE_CONTENT_FLAG 0x00000001
3405 #define CMSG_LENGTH_ONLY_FLAG 0x00000002
3406 #define CMSG_DETACHED_FLAG 0x00000004
3407 #define CMSG_AUTHENTICATED_ATTRIBUTES_FLAG 0x00000008
3408 #define CMSG_CONTENTS_OCTETS_FLAG 0x00000010
3409 #define CMSG_MAX_LENGTH_FLAG 0x00000020
3410 #define CMSG_CMS_ENCAPSULATED_CONTENT_FLAG 0x00000040
3411 #define CMSG_CRYPT_RELEASE_CONTEXT_FLAG 0x00008000
3413 #define CMSG_CTRL_VERIFY_SIGNATURE 1
3414 #define CMSG_CTRL_DECRYPT 2
3415 #define CMSG_CTRL_VERIFY_HASH 5
3416 #define CMSG_CTRL_ADD_SIGNER 6
3417 #define CMSG_CTRL_DEL_SIGNER 7
3418 #define CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR 8
3419 #define CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR 9
3420 #define CMSG_CTRL_ADD_CERT 10
3421 #define CMSG_CTRL_DEL_CERT 11
3422 #define CMSG_CTRL_ADD_CRL 12
3423 #define CMSG_CTRL_DEL_CRL 13
3424 #define CMSG_CTRL_ADD_ATTR_CERT 14
3425 #define CMSG_CTRL_DEL_ATTR_CERT 15
3426 #define CMSG_CTRL_KEY_TRANS_DECRYPT 16
3427 #define CMSG_CTRL_KEY_AGREE_DECRYPT 17
3428 #define CMSG_CTRL_MAIL_LIST_DECRYPT 18
3429 #define CMSG_CTRL_VERIFY_SIGNATURE_EX 19
3430 #define CMSG_CTRL_ADD_CMS_SIGNER_INFO 20
3432 typedef struct _CMSG_CTRL_DECRYPT_PARA
3434 DWORD cbSize;
3435 HCRYPTPROV hCryptProv;
3436 DWORD dwKeySpec;
3437 DWORD dwRecipientIndex;
3438 } CMSG_CTRL_DECRYPT_PARA, *PCMSG_CTRL_DECRYPT_PARA;
3440 typedef struct _CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA
3442 DWORD cbSize;
3443 DWORD dwSignerIndex;
3444 CRYPT_DATA_BLOB blob;
3445 } CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA,
3446 *PCMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA;
3448 typedef struct _CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA
3450 DWORD cbSize;
3451 DWORD dwSignerIndex;
3452 DWORD dwUnauthAttrIndex;
3453 } CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA,
3454 *PCMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA;
3456 typedef struct _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA {
3457 DWORD cbSize;
3458 HCRYPTPROV hCryptProv;
3459 DWORD dwSignerIndex;
3460 DWORD dwSignerType;
3461 void *pvSigner;
3462 } CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA, *PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA;
3464 #define CMSG_VERIFY_SIGNER_PUBKEY 1
3465 #define CMSG_VERIFY_SIGNER_CERT 2
3466 #define CMSG_VERIFY_SIGNER_CHAIN 3
3467 #define CMSG_VERIFY_SIGNER_NULL 4
3469 #define CMSG_TYPE_PARAM 1
3470 #define CMSG_CONTENT_PARAM 2
3471 #define CMSG_BARE_CONTENT_PARAM 3
3472 #define CMSG_INNER_CONTENT_TYPE_PARAM 4
3473 #define CMSG_SIGNER_COUNT_PARAM 5
3474 #define CMSG_SIGNER_INFO_PARAM 6
3475 #define CMSG_SIGNER_CERT_INFO_PARAM 7
3476 #define CMSG_SIGNER_HASH_ALGORITHM_PARAM 8
3477 #define CMSG_SIGNER_AUTH_ATTR_PARAM 9
3478 #define CMSG_SIGNER_UNAUTH_ATTR_PARAM 10
3479 #define CMSG_CERT_COUNT_PARAM 11
3480 #define CMSG_CERT_PARAM 12
3481 #define CMSG_CRL_COUNT_PARAM 13
3482 #define CMSG_CRL_PARAM 14
3483 #define CMSG_ENVELOPE_ALGORITHM_PARAM 15
3484 #define CMSG_RECIPIENT_COUNT_PARAM 17
3485 #define CMSG_RECIPIENT_INDEX_PARAM 18
3486 #define CMSG_RECIPIENT_INFO_PARAM 19
3487 #define CMSG_HASH_ALGORITHM_PARAM 20
3488 #define CMSG_HASH_DATA_PARAM 21
3489 #define CMSG_COMPUTED_HASH_PARAM 22
3490 #define CMSG_ENCRYPT_PARAM 26
3491 #define CMSG_ENCRYPTED_DIGEST 27
3492 #define CMSG_ENCODED_SIGNER 28
3493 #define CMSG_ENCODED_MESSAGE 29
3494 #define CMSG_VERSION_PARAM 30
3495 #define CMSG_ATTR_CERT_COUNT_PARAM 31
3496 #define CMSG_ATTR_CERT_PARAM 32
3497 #define CMSG_CMS_RECIPIENT_COUNT_PARAM 33
3498 #define CMSG_CMS_RECIPIENT_INDEX_PARAM 34
3499 #define CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM 35
3500 #define CMSG_CMS_RECIPIENT_INFO_PARAM 36
3501 #define CMSG_UNPROTECTED_ATTR_PARAM 37
3502 #define CMSG_SIGNER_CERT_ID_PARAM 38
3503 #define CMSG_CMS_SIGNER_INFO_PARAM 39
3505 #define CMSG_SIGNED_DATA_V1 1
3506 #define CMSG_SIGNED_DATA_V3 3
3507 #define CMSG_SIGNED_DATA_PKCS_1_5_VERSION CMSG_SIGNED_DATA_V1
3508 #define CMSG_SIGNED_DATA_CMS_VERSION CMSG_SIGNED_DATA_V3
3510 #define CMSG_SIGNER_INFO_V1 1
3511 #define CMSG_SIGNER_INFO_V3 3
3512 #define CMSG_SIGNER_INFO_PKCS_1_5_VERSION CMSG_SIGNER_INFO_V1
3513 #define CMSG_SIGNER_INFO_CMS_VERSION CMSG_SIGNER_INFO_V3
3515 #define CMSG_HASHED_DATA_V0 0
3516 #define CMSG_HASHED_DATA_V2 2
3517 #define CMSG_HASHED_DATA_PKCS_1_5_VERSION CMSG_HASHED_DATA_V0
3518 #define CMSG_HASHED_DATA_CMS_VERSION CMSG_HASHED_DATA_V2
3520 #define CMSG_ENVELOPED_DATA_V0 0
3521 #define CMSG_ENVELOPED_DATA_V2 2
3522 #define CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION CMSG_ENVELOPED_DATA_V0
3523 #define CMSG_ENVELOPED_DATA_CMS_VERSION CMSG_ENVELOPED_DATA_V2
3525 /* CryptMsgGetAndVerifySigner flags */
3526 #define CMSG_TRUSTED_SIGNER_FLAG 0x1
3527 #define CMSG_SIGNER_ONLY_FLAG 0x2
3528 #define CMSG_USE_SIGNER_INDEX_FLAG 0x4
3530 /* CryptMsgSignCTL flags */
3531 #define CMSG_CMS_ENCAPSULATED_CTL_FLAG 0x00008000
3533 /* CryptMsgEncodeAndSignCTL flags */
3534 #define CMSG_ENCODED_SORTED_CTL_FLAG 0x1
3535 #define CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x2
3537 /* function declarations */
3538 /* advapi32.dll */
3539 WINADVAPI BOOL WINAPI CryptAcquireContextA(HCRYPTPROV *, LPCSTR, LPCSTR, DWORD, DWORD);
3540 WINADVAPI BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *, LPCWSTR, LPCWSTR, DWORD, DWORD);
3541 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
3542 WINADVAPI BOOL WINAPI CryptGenRandom (HCRYPTPROV, DWORD, BYTE *);
3543 WINADVAPI BOOL WINAPI CryptContextAddRef (HCRYPTPROV, DWORD *, DWORD);
3544 WINADVAPI BOOL WINAPI CryptCreateHash (HCRYPTPROV, ALG_ID, HCRYPTKEY, DWORD, HCRYPTHASH *);
3545 WINADVAPI BOOL WINAPI CryptDecrypt (HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *);
3546 WINADVAPI BOOL WINAPI CryptDeriveKey (HCRYPTPROV, ALG_ID, HCRYPTHASH, DWORD, HCRYPTKEY *);
3547 WINADVAPI BOOL WINAPI CryptDestroyHash (HCRYPTHASH);
3548 WINADVAPI BOOL WINAPI CryptDestroyKey (HCRYPTKEY);
3549 WINADVAPI BOOL WINAPI CryptDuplicateKey (HCRYPTKEY, DWORD *, DWORD, HCRYPTKEY *);
3550 WINADVAPI BOOL WINAPI CryptDuplicateHash (HCRYPTHASH, DWORD *, DWORD, HCRYPTHASH *);
3551 WINADVAPI BOOL WINAPI CryptEncrypt (HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *, DWORD);
3552 WINADVAPI BOOL WINAPI CryptEnumProvidersA (DWORD, DWORD *, DWORD, DWORD *, LPSTR, DWORD *);
3553 WINADVAPI BOOL WINAPI CryptEnumProvidersW (DWORD, DWORD *, DWORD, DWORD *, LPWSTR, DWORD *);
3554 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
3555 WINADVAPI BOOL WINAPI CryptEnumProviderTypesA (DWORD, DWORD *, DWORD, DWORD *, LPSTR, DWORD *);
3556 WINADVAPI BOOL WINAPI CryptEnumProviderTypesW (DWORD, DWORD *, DWORD, DWORD *, LPWSTR, DWORD *);
3557 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
3558 WINADVAPI BOOL WINAPI CryptExportKey (HCRYPTKEY, HCRYPTKEY, DWORD, DWORD, BYTE *, DWORD *);
3559 WINADVAPI BOOL WINAPI CryptGenKey (HCRYPTPROV, ALG_ID, DWORD, HCRYPTKEY *);
3560 WINADVAPI BOOL WINAPI CryptGetKeyParam (HCRYPTKEY, DWORD, BYTE *, DWORD *, DWORD);
3561 WINADVAPI BOOL WINAPI CryptGetHashParam (HCRYPTHASH, DWORD, BYTE *, DWORD *, DWORD);
3562 WINADVAPI BOOL WINAPI CryptGetProvParam (HCRYPTPROV, DWORD, BYTE *, DWORD *, DWORD);
3563 WINADVAPI BOOL WINAPI CryptGetDefaultProviderA (DWORD, DWORD *, DWORD, LPSTR, DWORD *);
3564 WINADVAPI BOOL WINAPI CryptGetDefaultProviderW (DWORD, DWORD *, DWORD, LPWSTR, DWORD *);
3565 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
3566 WINADVAPI BOOL WINAPI CryptGetUserKey (HCRYPTPROV, DWORD, HCRYPTKEY *);
3567 WINADVAPI BOOL WINAPI CryptHashData (HCRYPTHASH, CONST BYTE *, DWORD, DWORD);
3568 WINADVAPI BOOL WINAPI CryptHashSessionKey (HCRYPTHASH, HCRYPTKEY, DWORD);
3569 WINADVAPI BOOL WINAPI CryptImportKey (HCRYPTPROV, CONST BYTE *, DWORD, HCRYPTKEY, DWORD, HCRYPTKEY *);
3570 WINADVAPI BOOL WINAPI CryptReleaseContext (HCRYPTPROV, ULONG_PTR);
3571 WINADVAPI BOOL WINAPI CryptSetHashParam (HCRYPTHASH, DWORD, CONST BYTE *, DWORD);
3572 WINADVAPI BOOL WINAPI CryptSetKeyParam (HCRYPTKEY, DWORD, CONST BYTE *, DWORD);
3573 WINADVAPI BOOL WINAPI CryptSetProviderA (LPCSTR, DWORD);
3574 WINADVAPI BOOL WINAPI CryptSetProviderW (LPCWSTR, DWORD);
3575 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
3576 WINADVAPI BOOL WINAPI CryptSetProviderExA (LPCSTR, DWORD, DWORD *, DWORD);
3577 WINADVAPI BOOL WINAPI CryptSetProviderExW (LPCWSTR, DWORD, DWORD *, DWORD);
3578 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
3579 WINADVAPI BOOL WINAPI CryptSetProvParam (HCRYPTPROV, DWORD, CONST BYTE *, DWORD);
3580 WINADVAPI BOOL WINAPI CryptSignHashA (HCRYPTHASH, DWORD, LPCSTR, DWORD, BYTE *, DWORD *);
3581 WINADVAPI BOOL WINAPI CryptSignHashW (HCRYPTHASH, DWORD, LPCWSTR, DWORD, BYTE *, DWORD *);
3582 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
3583 WINADVAPI BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH, CONST BYTE *, DWORD, HCRYPTKEY, LPCSTR, DWORD);
3584 WINADVAPI BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH, CONST BYTE *, DWORD, HCRYPTKEY, LPCWSTR, DWORD);
3585 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
3587 /* crypt32.dll functions */
3588 LPVOID WINAPI CryptMemAlloc(ULONG cbSize);
3589 LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize);
3590 VOID WINAPI CryptMemFree(LPVOID pv);
3592 BOOL WINAPI CryptBinaryToStringA(const BYTE *pbBinary,
3593 DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD *pcchString);
3594 BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary,
3595 DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD *pcchString);
3596 #define CryptBinaryToString WINELIB_NAME_AW(CryptBinaryToString)
3598 BOOL WINAPI CryptStringToBinaryA(LPCSTR pszString,
3599 DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
3600 DWORD *pdwSkip, DWORD *pdwFlags);
3601 BOOL WINAPI CryptStringToBinaryW(LPCWSTR pszString,
3602 DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
3603 DWORD *pdwSkip, DWORD *pdwFlags);
3604 #define CryptStringToBinary WINELIB_NAME_AW(CryptStringToBinary)
3606 BOOL WINAPI CryptCreateAsyncHandle(DWORD dwFlags, PHCRYPTASYNC phAsync);
3607 BOOL WINAPI CryptSetAsyncParam(HCRYPTASYNC hAsync, LPSTR pszParamOid,
3608 LPVOID pvParam, PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree);
3609 BOOL WINAPI CryptGetAsyncParam(HCRYPTASYNC hAsync, LPSTR pszParamOid,
3610 LPVOID *ppvParam, PFN_CRYPT_ASYNC_PARAM_FREE_FUNC *ppfnFree);
3611 BOOL WINAPI CryptCloseAsyncHandle(HCRYPTASYNC hAsync);
3613 BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD,LPCSTR,DWORD,LPCWSTR);
3614 BOOL WINAPI CryptRegisterOIDFunction(DWORD,LPCSTR,LPCSTR,LPCWSTR,LPCSTR);
3615 BOOL WINAPI CryptGetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
3616 LPCSTR pszOID, LPCWSTR szValueName, DWORD *pdwValueType,
3617 BYTE *pbValueData, DWORD *pcbValueData);
3618 BOOL WINAPI CryptSetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
3619 LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType,
3620 const BYTE *pbValueData, DWORD cbValueData);
3621 BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD,LPCSTR,LPCWSTR);
3622 BOOL WINAPI CryptUnregisterOIDFunction(DWORD,LPCSTR,LPCSTR);
3623 BOOL WINAPI CryptEnumOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName,
3624 LPCSTR pszOID, DWORD dwFlags, void *pvArg,
3625 PFN_CRYPT_ENUM_OID_FUNC pfnEnumOIDFunc);
3626 HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR,DWORD);
3627 BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet,
3628 DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList);
3629 BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
3630 DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr,
3631 HCRYPTOIDFUNCADDR *phFuncAddr);
3632 BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
3633 DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr,
3634 HCRYPTOIDFUNCADDR *phFuncAddr);
3635 BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr,
3636 DWORD dwFlags);
3637 BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule,
3638 DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry,
3639 const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags);
3640 BOOL WINAPI CryptInstallDefaultContext(HCRYPTPROV hCryptProv,
3641 DWORD dwDefaultType, const void *pvDefaultPara, DWORD dwFlags,
3642 void *pvReserved, HCRYPTDEFAULTCONTEXT *phDefaultContext);
3643 BOOL WINAPI CryptUninstallDefaultContext(HCRYPTDEFAULTCONTEXT hDefaultContext,
3644 DWORD dwFlags, void *pvReserved);
3646 BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg,
3647 PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo);
3648 PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
3649 DWORD dwGroupId);
3650 BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO pInfo, DWORD dwFlags);
3651 BOOL WINAPI CryptUnregisterOIDInfo(PCCRYPT_OID_INFO pInfo);
3653 LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId);
3654 DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId);
3656 /* cert store functions */
3657 HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType,
3658 HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara);
3660 HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv,
3661 LPCSTR szSubSystemProtocol);
3662 HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv,
3663 LPCWSTR szSubSystemProtocol);
3664 #define CertOpenSystemStore WINELIB_NAME_AW(CertOpenSystemStore)
3666 PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore,
3667 PCCERT_CONTEXT pPrev);
3669 PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore,
3670 PCCRL_CONTEXT pPrev);
3672 PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore,
3673 PCCTL_CONTEXT pPrev);
3675 BOOL WINAPI CertEnumSystemStoreLocation(DWORD dwFlags, void *pvArg,
3676 PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum);
3678 BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara,
3679 void *pvArg, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum);
3681 BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
3682 void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum);
3684 BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
3685 DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags);
3687 BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore,
3688 HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority);
3690 void WINAPI CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore,
3691 HCERTSTORE hSiblingStore);
3693 BOOL WINAPI CertCreateCertificateChainEngine(PCERT_CHAIN_ENGINE_CONFIG pConfig,
3694 HCERTCHAINENGINE *phChainEngine);
3696 BOOL WINAPI CertResyncCertificateChainEngine(HCERTCHAINENGINE hChainEngine);
3698 VOID WINAPI CertFreeCertificateChainEngine(HCERTCHAINENGINE hChainEngine);
3700 BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
3701 PCCERT_CONTEXT pCertContext, LPFILETIME pTime, HCERTSTORE hAdditionalStore,
3702 PCERT_CHAIN_PARA pChainPara, DWORD dwFlags, LPVOID pvReserved,
3703 PCCERT_CHAIN_CONTEXT *ppChainContext);
3705 PCCERT_CHAIN_CONTEXT WINAPI CertDuplicateCertificateChain(
3706 PCCERT_CHAIN_CONTEXT pChainContext);
3708 VOID WINAPI CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT pChainContext);
3710 PCCERT_CHAIN_CONTEXT WINAPI CertFindChainInStore(HCERTSTORE hCertStore,
3711 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3712 const void *pvFindPara, PCCERT_CHAIN_CONTEXT pPrevChainContext);
3714 BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID,
3715 PCCERT_CHAIN_CONTEXT pChainContext, PCERT_CHAIN_POLICY_PARA pPolicyPara,
3716 PCERT_CHAIN_POLICY_STATUS pPolicyStatus);
3718 DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext,
3719 DWORD dwPropId);
3721 BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
3722 DWORD dwPropId, void *pvData, DWORD *pcbData);
3724 BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
3725 DWORD dwPropId, DWORD dwFlags, const void *pvData);
3727 DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext,
3728 DWORD dwPropId);
3730 BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
3731 DWORD dwPropId, void *pvData, DWORD *pcbData);
3733 BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
3734 DWORD dwPropId, DWORD dwFlags, const void *pvData);
3736 DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext,
3737 DWORD dwPropId);
3739 BOOL WINAPI CertEnumSubjectInSortedCTL(PCCTL_CONTEXT pCTLContext,
3740 void **ppvNextSubject, PCRYPT_DER_BLOB pSubjectIdentifier,
3741 PCRYPT_DER_BLOB pEncodedAttributes);
3743 BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
3744 DWORD dwPropId, void *pvData, DWORD *pcbData);
3746 BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
3747 DWORD dwPropId, DWORD dwFlags, const void *pvData);
3749 BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
3750 void *pvData, DWORD *pcbData);
3752 BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
3753 DWORD dwFlags, const void *pvData);
3755 BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
3756 DWORD dwCtrlType, void const *pvCtrlPara);
3758 HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore);
3760 BOOL WINAPI CertCloseStore( HCERTSTORE hCertStore, DWORD dwFlags );
3762 BOOL WINAPI CertFreeCertificateContext( PCCERT_CONTEXT pCertContext );
3764 BOOL WINAPI CertFreeCRLContext( PCCRL_CONTEXT pCrlContext );
3766 BOOL WINAPI CertFreeCTLContext( PCCTL_CONTEXT pCtlContext );
3768 BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
3769 PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
3770 PCCERT_CONTEXT *ppStoreContext);
3772 BOOL WINAPI CertAddCRLContextToStore( HCERTSTORE hCertStore,
3773 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
3774 PCCRL_CONTEXT *ppStoreContext );
3776 BOOL WINAPI CertAddCTLContextToStore( HCERTSTORE hCertStore,
3777 PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
3778 PCCTL_CONTEXT *ppStoreContext );
3780 BOOL WINAPI CertAddCertificateLinkToStore(HCERTSTORE hCertStore,
3781 PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
3782 PCCERT_CONTEXT *ppStoreContext);
3784 BOOL WINAPI CertAddCRLLinkToStore(HCERTSTORE hCertStore,
3785 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
3786 PCCRL_CONTEXT *ppStoreContext);
3788 BOOL WINAPI CertAddCTLLinkToStore(HCERTSTORE hCertStore,
3789 PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
3790 PCCTL_CONTEXT *ppStoreContext);
3792 BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore,
3793 DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded,
3794 DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext);
3796 BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore,
3797 DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded,
3798 DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext);
3800 BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore,
3801 DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded,
3802 DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext);
3804 BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore,
3805 const BYTE *pbElement, DWORD cbElement, DWORD dwAddDisposition, DWORD dwFlags,
3806 DWORD dwContextTypeFlags, DWORD *pdwContentType, const void **ppvContext);
3808 BOOL WINAPI CertCompareCertificate(DWORD dwCertEncodingType,
3809 PCERT_INFO pCertId1, PCERT_INFO pCertId2);
3810 BOOL WINAPI CertCompareCertificateName(DWORD dwCertEncodingType,
3811 PCERT_NAME_BLOB pCertName1, PCERT_NAME_BLOB pCertName2);
3812 BOOL WINAPI CertCompareIntegerBlob(PCRYPT_INTEGER_BLOB pInt1,
3813 PCRYPT_INTEGER_BLOB pInt2);
3814 BOOL WINAPI CertComparePublicKeyInfo(DWORD dwCertEncodingType,
3815 PCERT_PUBLIC_KEY_INFO pPublicKey1, PCERT_PUBLIC_KEY_INFO pPublicKey2);
3816 DWORD WINAPI CertGetPublicKeyLength(DWORD dwCertEncodingType,
3817 PCERT_PUBLIC_KEY_INFO pPublicKey);
3819 const void *CertCreateContext(DWORD dwContextType, DWORD dwEncodingType,
3820 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
3821 PCERT_CREATE_CONTEXT_PARA pCreatePara);
3823 PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
3824 const BYTE *pbCertEncoded, DWORD cbCertEncoded);
3826 PCCRL_CONTEXT WINAPI CertCreateCRLContext( DWORD dwCertEncodingType,
3827 const BYTE* pbCrlEncoded, DWORD cbCrlEncoded);
3829 PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType,
3830 const BYTE *pbCtlEncoded, DWORD cbCtlEncoded);
3832 PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hProv,
3833 PCERT_NAME_BLOB pSubjectIssuerBlob, DWORD dwFlags,
3834 PCRYPT_KEY_PROV_INFO pKeyProvInfo,
3835 PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, PSYSTEMTIME pStartTime,
3836 PSYSTEMTIME pEndTime, PCERT_EXTENSIONS pExtensions);
3838 BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext);
3840 BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext);
3842 BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext);
3844 PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(
3845 PCCERT_CONTEXT pCertContext);
3847 PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext);
3849 PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext);
3851 PCCERT_CONTEXT WINAPI CertFindCertificateInStore( HCERTSTORE hCertStore,
3852 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3853 const void *pvFindPara, PCCERT_CONTEXT pPrevCertContext );
3855 PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore,
3856 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3857 const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext);
3859 PCCTL_CONTEXT WINAPI CertFindCTLInStore(HCERTSTORE hCertStore,
3860 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3861 const void *pvFindPara, PCCTL_CONTEXT pPrevCtlContext);
3863 PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE hCertStore,
3864 PCCERT_CONTEXT pSubjectContext, PCCERT_CONTEXT pPrevIssuerContext,
3865 DWORD *pdwFlags);
3867 PCCERT_CONTEXT WINAPI CertGetSubjectCertificateFromStore(HCERTSTORE hCertStore,
3868 DWORD dwCertEncodingType, PCERT_INFO pCertId);
3870 PCCRL_CONTEXT WINAPI CertGetCRLFromStore(HCERTSTORE hCertStore,
3871 PCCERT_CONTEXT pIssuerContext, PCCRL_CONTEXT pPrevCrlContext, DWORD *pdwFlags);
3873 BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
3874 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
3876 BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext,
3877 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
3879 BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext,
3880 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
3882 BOOL WINAPI CertGetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext, DWORD dwFlags,
3883 PCERT_ENHKEY_USAGE pUsage, DWORD *pcbUsage);
3884 BOOL WINAPI CertSetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext,
3885 PCERT_ENHKEY_USAGE pUsage);
3886 BOOL WINAPI CertAddEnhancedKeyUsageIdentifier(PCCERT_CONTEXT pCertContext,
3887 LPCSTR pszUsageIdentifer);
3888 BOOL WINAPI CertRemoveEnhancedKeyUsageIdentifier(PCCERT_CONTEXT pCertContext,
3889 LPCSTR pszUsageIdentifer);
3890 BOOL WINAPI CertGetValidUsages(DWORD cCerts, PCCERT_CONTEXT *rghCerts,
3891 int *cNumOIDs, LPSTR *rghOIDs, DWORD *pcbOIDs);
3893 BOOL WINAPI CryptEncodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3894 const void *pvStructInfo, BYTE *pbEncoded, DWORD *pcbEncoded);
3895 BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3896 const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara,
3897 void *pvEncoded, DWORD *pcbEncoded);
3899 BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3900 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo,
3901 DWORD *pcbStructInfo);
3902 BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3903 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
3904 PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo);
3906 BOOL WINAPI CryptFormatObject(DWORD dwCertEncodingType, DWORD dwFormatType,
3907 DWORD dwFormatStrType, void *pFormatStruct, LPCSTR lpszStructType,
3908 const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, DWORD *pcbFormat);
3910 BOOL WINAPI CryptHashCertificate(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid,
3911 DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
3912 DWORD *pcbComputedHash);
3914 BOOL WINAPI CryptHashPublicKeyInfo(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid,
3915 DWORD dwFlags, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo,
3916 BYTE *pbComputedHash, DWORD *pcbComputedHash);
3918 BOOL WINAPI CryptHashToBeSigned(HCRYPTPROV_LEGACY hCryptProv, DWORD dwCertEncodingType,
3919 const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
3920 DWORD *pcbComputedHash);
3922 BOOL WINAPI CryptQueryObject(DWORD dwObjectType, const void* pvObject,
3923 DWORD dwExpectedContentTypeFlags, DWORD dwExpectedFormatTypeFlags,
3924 DWORD dwFlags, DWORD* pdwMsgAndCertEncodingType, DWORD* pdwContentType,
3925 DWORD* pdwFormatType, HCERTSTORE* phCertStore, HCRYPTMSG* phMsg,
3926 const void** ppvContext);
3928 BOOL WINAPI CryptSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
3929 DWORD dwCertEncodingType, const BYTE *pbEncodedToBeSigned,
3930 DWORD cbEncodedToBeSigned, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
3931 const void *pvHashAuxInfo, BYTE *pbSignature, DWORD *pcbSignature);
3933 BOOL WINAPI CryptSignAndEncodeCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv,
3934 DWORD dwKeySpec, DWORD dwCertEncodingType, LPCSTR lpszStructType,
3935 const void *pvStructInfo, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
3936 const void *pvHashAuxInfo, BYTE *pbEncoded, DWORD *pcbEncoded);
3938 BOOL WINAPI CryptVerifyCertificateSignature(HCRYPTPROV_LEGACY hCryptProv,
3939 DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded,
3940 PCERT_PUBLIC_KEY_INFO pPublicKey);
3942 BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
3943 DWORD dwCertEncodingType, DWORD dwSubjectType, void *pvSubject,
3944 DWORD dwIssuerType, void *pvIssuer, DWORD dwFlags, void *pvReserved);
3946 PCRYPT_ATTRIBUTE WINAPI CertFindAttribute(LPCSTR pszObjId, DWORD cAttr,
3947 CRYPT_ATTRIBUTE rgAttr[]);
3948 PCERT_EXTENSION WINAPI CertFindExtension(LPCSTR pszObjId, DWORD cExtensions,
3949 CERT_EXTENSION rgExtensions[]);
3950 PCERT_RDN_ATTR WINAPI CertFindRDNAttr(LPCSTR pszObjId, PCERT_NAME_INFO pName);
3952 BOOL WINAPI CertFindSubjectInSortedCTL(PCRYPT_DATA_BLOB pSubjectIdentifier,
3953 PCCTL_CONTEXT pCtlContext, DWORD dwFlags, void *pvReserved,
3954 PCRYPT_DER_BLOB pEncodedAttributes);
3956 BOOL WINAPI CertIsRDNAttrsInCertificateName(DWORD dwCertEncodingType,
3957 DWORD dwFlags, PCERT_NAME_BLOB pCertName, PCERT_RDN pRDN);
3959 BOOL WINAPI CertIsValidCRLForCertificate(PCCERT_CONTEXT pCert,
3960 PCCRL_CONTEXT pCrl, DWORD dwFlags, void *pvReserved);
3961 BOOL WINAPI CertFindCertificateInCRL(PCCERT_CONTEXT pCert,
3962 PCCRL_CONTEXT pCrlContext, DWORD dwFlags, void *pvReserved,
3963 PCRL_ENTRY *ppCrlEntry);
3964 BOOL WINAPI CertVerifyCRLRevocation(DWORD dwCertEncodingType,
3965 PCERT_INFO pCertId, DWORD cCrlInfo, PCRL_INFO rgpCrlInfo[]);
3967 BOOL WINAPI CertVerifySubjectCertificateContext(PCCERT_CONTEXT pSubject,
3968 PCCERT_CONTEXT pIssuer, DWORD *pdwFlags);
3970 LONG WINAPI CertVerifyCRLTimeValidity(LPFILETIME pTimeToVerify,
3971 PCRL_INFO pCrlInfo);
3972 LONG WINAPI CertVerifyTimeValidity(LPFILETIME pTimeToVerify,
3973 PCERT_INFO pCertInfo);
3974 BOOL WINAPI CertVerifyValidityNesting(PCERT_INFO pSubjectInfo,
3975 PCERT_INFO pIssuerInfo);
3977 BOOL WINAPI CertVerifyCTLUsage(DWORD dwEncodingType, DWORD dwSubjectType,
3978 void *pvSubject, PCTL_USAGE pSubjectUsage, DWORD dwFlags,
3979 PCTL_VERIFY_USAGE_PARA pVerifyUsagePara,
3980 PCTL_VERIFY_USAGE_STATUS pVerifyUsageStatus);
3982 BOOL WINAPI CertVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType,
3983 DWORD cContext, PVOID rgpvContext[], DWORD dwFlags,
3984 PCERT_REVOCATION_PARA pRevPara, PCERT_REVOCATION_STATUS pRevStatus);
3986 BOOL WINAPI CryptExportPublicKeyInfo(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
3987 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
3988 BOOL WINAPI CryptExportPublicKeyInfoEx(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
3989 DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags,
3990 void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
3991 BOOL WINAPI CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv,
3992 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, HCRYPTKEY *phKey);
3993 BOOL WINAPI CryptImportPublicKeyInfoEx(HCRYPTPROV hCryptProv,
3994 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg,
3995 DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey);
3997 BOOL WINAPI CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT pCert,
3998 DWORD dwFlags, void *pvReserved, HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProv, DWORD *pdwKeySpec,
3999 BOOL *pfCallerFreeProv);
4001 BOOL WINAPI CryptProtectData( DATA_BLOB* pDataIn, LPCWSTR szDataDescr,
4002 DATA_BLOB* pOptionalEntropy, PVOID pvReserved,
4003 CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
4005 BOOL WINAPI CryptUnprotectData( DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr,
4006 DATA_BLOB* pOptionalEntropy, PVOID pvReserved,
4007 CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
4009 DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType,
4010 DWORD dwFlags, void *pvTypePara, LPSTR pszNameString, DWORD cchNameString);
4011 DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
4012 DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString);
4013 #define CertGetNameString WINELIB_NAME_AW(CertGetNameString)
4015 DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
4016 LPSTR psz, DWORD csz);
4017 DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
4018 LPWSTR psz, DWORD csz);
4019 #define CertRDNValueToStr WINELIB_NAME_AW(CertRDNValueToStr)
4021 DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName,
4022 DWORD dwStrType, LPSTR psz, DWORD csz);
4023 DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName,
4024 DWORD dwStrType, LPWSTR psz, DWORD csz);
4025 #define CertNameToStr WINELIB_NAME_AW(CertNameToStr)
4027 BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
4028 DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded,
4029 LPCSTR *ppszError);
4030 BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
4031 DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded,
4032 LPCWSTR *ppszError);
4033 #define CertStrToName WINELIB_NAME_AW(CertStrToName)
4035 DWORD WINAPI CryptMsgCalculateEncodedLength(DWORD dwMsgEncodingType,
4036 DWORD dwFlags, DWORD dwMsgType, const void *pvMsgEncodeInfo,
4037 LPSTR pszInnerContentObjID, DWORD cbData);
4039 BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg);
4041 BOOL WINAPI CryptMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags,
4042 DWORD dwCtrlType, const void *pvCtrlPara);
4044 BOOL WINAPI CryptMsgCountersign(HCRYPTMSG hCryptMsg, DWORD dwIndex,
4045 DWORD dwCountersigners, PCMSG_SIGNER_ENCODE_INFO rgCountersigners);
4047 BOOL WINAPI CryptMsgCountersignEncoded(DWORD dwEncodingType, PBYTE pbSignerInfo,
4048 DWORD cbSignerInfo, DWORD cCountersigners,
4049 PCMSG_SIGNER_ENCODE_INFO rgCountersigners, PBYTE pbCountersignature,
4050 PDWORD pcbCountersignature);
4052 HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg);
4054 BOOL WINAPI CryptMsgEncodeAndSignCTL(DWORD dwMsgEncodingType,
4055 PCTL_INFO pCtlInfo, PCMSG_SIGNED_ENCODE_INFO pSignInfo, DWORD dwFlags,
4056 BYTE *pbEncoded, DWORD *pcbEncoded);
4058 BOOL WINAPI CryptMsgGetAndVerifySigner(HCRYPTMSG hCryptMsg, DWORD cSignerStore,
4059 HCERTSTORE *rghSignerStore, DWORD dwFlags, PCCERT_CONTEXT *ppSigner,
4060 DWORD *pdwSignerIndex);
4062 BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
4063 DWORD dwIndex, void *pvData, DWORD *pcbData);
4065 HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags,
4066 DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo,
4067 PCMSG_STREAM_INFO pStreamInfo);
4069 HCRYPTMSG WINAPI CryptMsgOpenToEncode(DWORD dwMsgEncodingType, DWORD dwFlags,
4070 DWORD dwMsgType, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID,
4071 PCMSG_STREAM_INFO pStreamInfo);
4073 BOOL WINAPI CryptMsgSignCTL(DWORD dwMsgEncodingType, BYTE *pbCtlContent,
4074 DWORD cbCtlContent, PCMSG_SIGNED_ENCODE_INFO pSignInfo, DWORD dwFlags,
4075 BYTE *pbEncoded, DWORD *pcbEncoded);
4077 BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
4078 DWORD cbData, BOOL fFinal);
4080 BOOL WINAPI CryptMsgVerifyCountersignatureEncoded(HCRYPTPROV_LEGACY hCryptProv,
4081 DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo,
4082 PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature,
4083 PCERT_INFO pciCountersigner);
4085 BOOL WINAPI CryptMsgVerifyCountersignatureEncodedEx(HCRYPTPROV_LEGACY hCryptProv,
4086 DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo,
4087 PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature,
4088 DWORD dwSignerType, void *pvSigner, DWORD dwFlags, void *pvReserved);
4090 BOOL WINAPI CryptSignMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara,
4091 BOOL fDetachedSignature, DWORD cToBeSigned, const BYTE *rgpbToBeSigned[],
4092 DWORD rgcbToBeSigned[], BYTE *pbSignedBlob, DWORD *pcbSignedBlob);
4093 BOOL WINAPI CryptSignMessageWithKey(PCRYPT_KEY_SIGN_MESSAGE_PARA pSignPara,
4094 const BYTE *pbToBeSigned, DWORD cbToBeSigned, BYTE *pbSignedBlob,
4095 DWORD *pcbSignedBlob);
4097 BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
4098 DWORD dwSignerIndex, const BYTE* pbSignedBlob, DWORD cbSignedBlob,
4099 BYTE* pbDecoded, DWORD* pcbDecoded, PCCERT_CONTEXT* ppSignerCert);
4100 BOOL WINAPI CryptVerifyMessageSignatureWithKey(
4101 PCRYPT_KEY_VERIFY_MESSAGE_PARA pVerifyPara,
4102 PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, const BYTE *pbSignedBlob,
4103 DWORD cbSignedBlob, BYTE *pbDecoded, DWORD *pcbDecoded);
4105 BOOL WINAPI CryptVerifyDetachedMessageSignature(
4106 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4107 const BYTE *pbDetachedSignBlob, DWORD cbDetachedSignBlob, DWORD cToBeSigned,
4108 const BYTE *rgpbToBeSigned[], DWORD rgcbToBeSigned[],
4109 PCCERT_CONTEXT *ppSignerCert);
4110 LONG WINAPI CryptGetMessageSignerCount(DWORD dwMsgEncodingType,
4111 const BYTE *pbSignedBlob, DWORD cbSignedBlob);
4113 BOOL WINAPI CryptEncryptMessage(PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara,
4114 DWORD cRecipientCert, PCCERT_CONTEXT rgpRecipientCert[],
4115 const BYTE *pbToBeEncrypted, DWORD cbToBeEncrypted, BYTE *pbEncryptedBlob,
4116 DWORD *pcbEncryptedBlob);
4117 BOOL WINAPI CryptDecryptMessage(PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4118 const BYTE *pbEncryptedBlob, DWORD cbEncryptedBlob, BYTE *pbDecrypted,
4119 DWORD *pcbDecrypted, PCCERT_CONTEXT *ppXchgCert);
4121 BOOL WINAPI CryptSignAndEncryptMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara,
4122 PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara, DWORD cRecipientCert,
4123 PCCERT_CONTEXT rgpRecipientCert[], const BYTE *pbToBeSignedAndEncrypted,
4124 DWORD cbToBeSignedAndEncrypted, BYTE *pbSignedAndEncryptedBlob,
4125 DWORD *pcbSignedAndEncryptedBlob);
4126 BOOL WINAPI CryptDecryptAndVerifyMessageSignature(
4127 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4128 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4129 const BYTE *pbEncryptedBlob, DWORD cbEncryptedBlob, BYTE *pbDecrypted,
4130 DWORD *pcbDecrypted, PCCERT_CONTEXT *ppXchgCert, PCCERT_CONTEXT *ppSignerCert);
4132 HCERTSTORE WINAPI CryptGetMessageCertificates(DWORD dwMsgAndCertEncodingType,
4133 HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const BYTE *pbSignedBlob,
4134 DWORD cbSignedBlob);
4136 BOOL WINAPI CryptDecodeMessage(DWORD dwMsgTypeFlags,
4137 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4138 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4139 const BYTE *pbEncodedBlob, DWORD cbEncodedBlob, DWORD dwPrevInnerContentType,
4140 DWORD *pdwMsgType, DWORD *pdwInnerContentType, BYTE *pbDecoded,
4141 DWORD *pcbDecoded, PCCERT_CONTEXT *ppXchgCert, PCCERT_CONTEXT *ppSignerCert);
4143 BOOL WINAPI CryptHashMessage(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4144 BOOL fDetachedHash, DWORD cToBeHashed, const BYTE *rgpbToBeHashed[],
4145 DWORD rgcbToBeHashed[], BYTE *pbHashedBlob, DWORD *pcbHashedBlob,
4146 BYTE *pbComputedHash, DWORD *pcbComputedHash);
4147 BOOL WINAPI CryptVerifyMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4148 BYTE *pbHashedBlob, DWORD cbHashedBlob, BYTE *pbToBeHashed,
4149 DWORD *pcbToBeHashed, BYTE *pbComputedHash, DWORD *pcbComputedHash);
4150 BOOL WINAPI CryptVerifyDetachedMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4151 BYTE *pbDetachedHashBlob, DWORD cbDetachedHashBlob, DWORD cToBeHashed,
4152 const BYTE *rgpbToBeHashed[], DWORD rgcbToBeHashed[], BYTE *pbComputedHash,
4153 DWORD *pcbComputedHash);
4155 /* cryptnet.dll functions */
4156 BOOL WINAPI CryptCancelAsyncRetrieval(HCRYPTASYNC hAsyncRetrieval);
4158 BOOL WINAPI CryptGetObjectUrl(LPCSTR pszUrlOid, LPVOID pvPara, DWORD dwFlags,
4159 PCRYPT_URL_ARRAY pUrlArray, DWORD *pcbUrlArray, PCRYPT_URL_INFO pUrlInfo,
4160 DWORD *pcbUrlInfo, LPVOID pvReserved);
4162 BOOL WINAPI CryptGetTimeValidObject(LPCSTR pszTimeValidOid, void *pvPara,
4163 PCCERT_CONTEXT pIssuer, LPFILETIME pftValidFor, DWORD dwFlags, DWORD dwTimeout,
4164 void **ppvObject, PCRYPT_CREDENTIALS pCredentials, void *pvReserved);
4166 BOOL WINAPI CryptFlushTimeValidObject(LPCSTR pszFlushTimeValidOid, void *pvPara,
4167 PCCERT_CONTEXT pIssuer, DWORD dwFlags, void *pvReserved);
4169 BOOL WINAPI CryptInstallCancelRetrieval(PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel,
4170 const void *pvArg, DWORD dwFlags, void *pvReserved);
4172 BOOL WINAPI CryptUninstallCancelRetrieval(DWORD dwFlags, void *pvReserved);
4174 BOOL WINAPI CryptRetrieveObjectByUrlA(LPCSTR pszURL, LPCSTR pszObjectOid,
4175 DWORD dwRetrievalFlags, DWORD dwTimeout, LPVOID *ppvObject,
4176 HCRYPTASYNC hAsyncRetrieve, PCRYPT_CREDENTIALS pCredentials, LPVOID pvVerify,
4177 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
4178 BOOL WINAPI CryptRetrieveObjectByUrlW(LPCWSTR pszURL, LPCSTR pszObjectOid,
4179 DWORD dwRetrievalFlags, DWORD dwTimeout, LPVOID *ppvObject,
4180 HCRYPTASYNC hAsyncRetrieve, PCRYPT_CREDENTIALS pCredentials, LPVOID pvVerify,
4181 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
4182 #define CryptRetrieveObjectByUrl WINELIB_NAME_AW(CryptRetrieveObjectByUrl)
4184 #ifdef __cplusplus
4186 #endif
4188 #endif