winspool: Use unsigned type to avoid a compiler warning.
[wine/gsoc_dplay.git] / include / wincrypt.h
blobd2a2d5d9a4cc6456eb740d1db7a1f321145ad69d
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 /* Algorithm types */
1397 #define ALG_TYPE_ANY (0)
1398 #define ALG_TYPE_DSS (1 << 9)
1399 #define ALG_TYPE_RSA (2 << 9)
1400 #define ALG_TYPE_BLOCK (3 << 9)
1401 #define ALG_TYPE_STREAM (4 << 9)
1402 #define ALG_TYPE_DH (5 << 9)
1403 #define ALG_TYPE_SECURECHANNEL (6 << 9)
1405 /* SIDs */
1406 #define ALG_SID_ANY (0)
1407 /* RSA SIDs */
1408 #define ALG_SID_RSA_ANY 0
1409 #define ALG_SID_RSA_PKCS 1
1410 #define ALG_SID_RSA_MSATWORK 2
1411 #define ALG_SID_RSA_ENTRUST 3
1412 #define ALG_SID_RSA_PGP 4
1413 /* DSS SIDs */
1414 #define ALG_SID_DSS_ANY 0
1415 #define ALG_SID_DSS_PKCS 1
1416 #define ALG_SID_DSS_DMS 2
1418 /* DES SIDs */
1419 #define ALG_SID_DES 1
1420 #define ALG_SID_3DES 3
1421 #define ALG_SID_DESX 4
1422 #define ALG_SID_IDEA 5
1423 #define ALG_SID_CAST 6
1424 #define ALG_SID_SAFERSK64 7
1425 #define ALG_SID_SAFERSK128 8
1426 #define ALG_SID_3DES_112 9
1427 /* Diffie-Hellmans SIDs */
1428 #define ALG_SID_DH_SANDF 1
1429 #define ALG_SID_DH_EPHEM 2
1430 #define ALG_SID_AGREED_KEY_ANY 3
1431 #define ALG_SID_KEA 4
1432 /* RC2 SIDs */
1433 #define ALG_SID_RC4 1
1434 #define ALG_SID_RC2 2
1435 #define ALG_SID_SEAL 2
1436 /* Hash SIDs */
1437 #define ALG_SID_MD2 1
1438 #define ALG_SID_MD4 2
1439 #define ALG_SID_MD5 3
1440 #define ALG_SID_SHA 4
1441 #define ALG_SID_SHA1 ALG_SID_SHA
1442 #define ALG_SID_MAC 5
1443 #define ALG_SID_RIPEMD 6
1444 #define ALG_SID_RIPEMD160 7
1445 #define ALG_SID_SSL3SHAMD5 8
1446 #define ALG_SID_HMAC 9
1447 #define ALG_SID_TLS1PRF 10
1448 /* SCHANNEL SIDs */
1449 #define ALG_SID_SSL3_MASTER 1
1450 #define ALG_SID_SCHANNEL_MASTER_HASH 2
1451 #define ALG_SID_SCHANNEL_MAC_KEY 3
1452 #define ALG_SID_PCT1_MASTER 4
1453 #define ALG_SID_SSL2_MASTER 5
1454 #define ALG_SID_TLS1_MASTER 6
1455 #define ALG_SID_SCHANNEL_ENC_KEY 7
1456 #define ALG_SID_EXAMPLE 80
1458 /* Algorithm Definitions */
1459 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
1460 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
1461 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
1462 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
1463 #define CALG_SHA1 CALG_SHA
1464 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
1465 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
1466 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
1467 #define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
1468 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
1469 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
1470 #define CALG_NO_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY)
1471 #define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF)
1472 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM)
1473 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
1474 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
1475 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
1476 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES)
1477 #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112)
1478 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
1479 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
1480 #define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER)
1481 #define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH)
1482 #define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY)
1483 #define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY)
1484 #define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER)
1485 #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER)
1486 #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER)
1488 /* Protocol Flags */
1489 #define CRYPT_FLAG_PCT1 0x0001
1490 #define CRYPT_FLAG_SSL2 0x0002
1491 #define CRYPT_FLAG_SSL3 0x0004
1492 #define CRYPT_FLAG_TLS1 0x0008
1493 #define CRYPT_FLAG_IPSEC 0x0010
1494 #define CRYPT_FLAG_SIGNING 0x0020
1496 /* Provider names */
1497 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
1498 #if defined(__GNUC__)
1499 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1500 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
1501 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
1502 #elif defined(_MSC_VER)
1503 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
1504 #else
1505 static const WCHAR MS_DEF_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1506 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1507 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
1508 #endif
1509 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
1511 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
1512 #if defined(__GNUC__)
1513 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1514 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
1515 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
1516 #elif defined(_MSC_VER)
1517 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
1518 #else
1519 static const WCHAR MS_ENHANCED_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1520 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1521 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
1522 #endif
1523 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
1525 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
1526 #if defined(__GNUC__)
1527 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1528 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
1529 'P','r','o','v','i','d','e','r',0 }
1530 #elif defined(_MSC_VER)
1531 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
1532 #else
1533 static const WCHAR MS_STRONG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1534 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
1535 'P','r','o','v','i','d','e','r',0 };
1536 #endif
1537 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
1539 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
1540 #if defined(__GNUC__)
1541 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1542 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
1543 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1544 #elif defined(_MSC_VER)
1545 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
1546 #else
1547 static const WCHAR MS_DEF_RSA_SIG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1548 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
1549 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1550 #endif
1551 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
1553 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
1554 #if defined(__GNUC__)
1555 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1556 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
1557 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1558 #elif defined(_MSC_VER)
1559 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
1560 #else
1561 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1562 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
1563 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1564 #endif
1565 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
1567 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
1568 #if defined(__GNUC__)
1569 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1570 'B','a','s','e',' ','D','S','S',' ', \
1571 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1572 #elif defined(_MSC_VER)
1573 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
1574 #else
1575 static const WCHAR MS_DEF_DSS_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1576 'B','a','s','e',' ','D','S','S',' ',
1577 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1578 #endif
1579 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
1581 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
1582 #if defined(__GNUC__)
1583 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1584 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
1585 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
1586 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1587 #elif defined(_MSC_VER)
1588 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
1589 #else
1590 static const WCHAR MS_DEF_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1591 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
1592 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
1593 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1594 #endif
1595 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
1597 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
1598 #if defined(__GNUC__)
1599 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1600 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
1601 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
1602 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1603 #elif defined(_MSC_VER)
1604 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
1605 #else
1606 static const WCHAR MS_ENH_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1607 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
1608 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
1609 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1610 #endif
1611 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
1613 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
1614 #if defined(__GNUC__)
1615 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1616 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
1617 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1618 #elif defined(_MSC_VER)
1619 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
1620 #else
1621 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1622 'D','H',' ','S','C','h','a','n','n','e','l',' ',
1623 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1624 #endif
1625 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
1627 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
1628 #if defined(__GNUC__)
1629 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
1630 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
1631 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
1632 #elif defined(_MSC_VER)
1633 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
1634 #else
1635 static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
1636 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
1637 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
1638 #endif
1639 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
1641 /* Key Specs*/
1642 #define AT_KEYEXCHANGE 1
1643 #define AT_SIGNATURE 2
1645 /* Provider Types */
1646 #define PROV_RSA_FULL 1
1647 #define PROV_RSA_SIG 2
1648 #define PROV_DSS 3
1649 #define PROV_FORTEZZA 4
1650 #define PROV_MS_EXCHANGE 5
1651 #define PROV_SSL 6
1652 #define PROV_RSA_SCHANNEL 12
1653 #define PROV_DSS_DH 13
1654 #define PROV_EC_ECDSA_SIG 14
1655 #define PROV_EC_ECNRA_SIG 15
1656 #define PROV_EC_ECDSA_FULL 16
1657 #define PROV_EC_ECNRA_FULL 17
1658 #define PROV_DH_SCHANNEL 18
1659 #define PROV_SPYRUS_LYNKS 20
1660 #define PROV_RNG 21
1661 #define PROV_INTEL_SEC 22
1662 #define PROV_REPLACE_OWF 23
1663 #define PROV_RSA_AES 24
1665 /* FLAGS Section */
1667 /* Provider Parameters */
1668 #define PP_ENUMALGS 1
1669 #define PP_ENUMCONTAINERS 2
1670 #define PP_IMPTYPE 3
1671 #define PP_NAME 4
1672 #define PP_VERSION 5
1673 #define PP_CONTAINER 6
1675 #define CRYPT_FIRST 1
1676 #define CRYPT_NEXT 2
1678 #define CRYPT_IMPL_HARDWARE 1
1679 #define CRYPT_IMPL_SOFTWARE 2
1680 #define CRYPT_IMPL_MIXED 3
1681 #define CRYPT_IMPL_UNKNOWN 4
1683 /* CryptAcquireContext */
1684 #define CRYPT_VERIFYCONTEXT 0xF0000000
1685 #define CRYPT_NEWKEYSET 0x00000008
1686 #define CRYPT_DELETEKEYSET 0x00000010
1687 #define CRYPT_MACHINE_KEYSET 0x00000020
1688 #define CRYPT_SILENT 0x00000040
1690 /* Crypt{Get|Set}Provider */
1691 #define CRYPT_MACHINE_DEFAULT 0x00000001
1692 #define CRYPT_USER_DEFAULT 0x00000002
1693 #define CRYPT_DELETE_DEFAULT 0x00000004
1695 /* Crypt{Get/Set}ProvParam */
1696 #define PP_CLIENT_HWND 1
1697 #define PP_ENUMALGS 1
1698 #define PP_ENUMCONTAINERS 2
1699 #define PP_IMPTYPE 3
1700 #define PP_NAME 4
1701 #define PP_VERSION 5
1702 #define PP_CONTAINER 6
1703 #define PP_CHANGE_PASSWORD 7
1704 #define PP_KEYSET_SEC_DESCR 8
1705 #define PP_KEY_TYPE_SUBTYPE 10
1706 #define PP_CONTEXT_INFO 11
1707 #define PP_KEYEXCHANGE_KEYSIZE 12
1708 #define PP_SIGNATURE_KEYSIZE 13
1709 #define PP_KEYEXCHANGE_ALG 14
1710 #define PP_SIGNATURE_ALG 15
1711 #define PP_PROVTYPE 16
1712 #define PP_KEYSTORAGE 17
1713 #define PP_SYM_KEYSIZE 19
1714 #define PP_SESSION_KEYSIZE 20
1715 #define PP_UI_PROMPT 21
1716 #define PP_ENUMALGS_EX 22
1717 #define PP_DELETEKEY 24
1718 #define PP_ENUMMANDROOTS 25
1719 #define PP_ENUMELECTROOTS 26
1720 #define PP_KEYSET_TYPE 27
1721 #define PP_ADMIN_PIN 31
1722 #define PP_KEYEXCHANGE_PIN 32
1723 #define PP_SIGNATURE_PIN 33
1724 #define PP_SIG_KEYSIZE_INC 34
1725 #define PP_KEYX_KEYSIZE_INC 35
1726 #define PP_UNIQUE_CONTAINER 36
1727 #define PP_SGC_INFO 37
1728 #define PP_USE_HARDWARE_RNG 38
1729 #define PP_KEYSPEC 39
1730 #define PP_ENUMEX_SIGNING_PROT 40
1732 /* Values returned by CryptGetProvParam of PP_KEYSTORAGE */
1733 #define CRYPT_SEC_DESCR 0x00000001
1734 #define CRYPT_PSTORE 0x00000002
1735 #define CRYPT_UI_PROMPT 0x00000004
1737 /* Crypt{Get/Set}KeyParam */
1738 #define KP_IV 1
1739 #define KP_SALT 2
1740 #define KP_PADDING 3
1741 #define KP_MODE 4
1742 #define KP_MODE_BITS 5
1743 #define KP_PERMISSIONS 6
1744 #define KP_ALGID 7
1745 #define KP_BLOCKLEN 8
1746 #define KP_KEYLEN 9
1747 #define KP_SALT_EX 10
1748 #define KP_P 11
1749 #define KP_G 12
1750 #define KP_Q 13
1751 #define KP_X 14
1752 #define KP_Y 15
1753 #define KP_RA 16
1754 #define KP_RB 17
1755 #define KP_INFO 18
1756 #define KP_EFFECTIVE_KEYLEN 19
1757 #define KP_SCHANNEL_ALG 20
1758 #define KP_CLIENT_RANDOM 21
1759 #define KP_SERVER_RANDOM 22
1760 #define KP_RP 23
1761 #define KP_PRECOMP_MD5 24
1762 #define KP_PRECOMP_SHA 25
1763 #define KP_CERTIFICATE 26
1764 #define KP_CLEAR_KEY 27
1765 #define KP_PUB_EX_LEN 28
1766 #define KP_PUB_EX_VAL 29
1767 #define KP_KEYVAL 30
1768 #define KP_ADMIN_PIN 31
1769 #define KP_KEYEXCHANGE_PIN 32
1770 #define KP_SIGNATURE_PIN 33
1771 #define KP_PREHASH 34
1773 /* CryptSignHash/CryptVerifySignature */
1774 #define CRYPT_NOHASHOID 0x00000001
1775 #define CRYPT_TYPE2_FORMAT 0x00000002
1776 #define CRYPT_X931_FORMAT 0x00000004
1778 /* Crypt{Get,Set}HashParam */
1779 #define HP_ALGID 0x0001
1780 #define HP_HASHVAL 0x0002
1781 #define HP_HASHSIZE 0x0004
1782 #define HP_HMAC_INFO 0x0005
1783 #define HP_TLS1PRF_LABEL 0x0006
1784 #define HP_TLS1PRF_SEED 0x0007
1786 /* Crypt{Get,Set}KeyParam */
1787 #define CRYPT_MODE_CBC 1
1788 #define CRYPT_MODE_ECB 2
1789 #define CRYPT_MODE_OFB 3
1790 #define CRYPT_MODE_CFB 4
1792 #define CRYPT_ENCRYPT 0x0001
1793 #define CRYPT_DECRYPT 0x0002
1794 #define CRYPT_EXPORT 0x0004
1795 #define CRYPT_READ 0x0008
1796 #define CRYPT_WRITE 0x0010
1797 #define CRYPT_MAC 0x0020
1799 /* Crypt*Key */
1800 #define CRYPT_EXPORTABLE 0x00000001
1801 #define CRYPT_USER_PROTECTED 0x00000002
1802 #define CRYPT_CREATE_SALT 0x00000004
1803 #define CRYPT_UPDATE_KEY 0x00000008
1804 #define CRYPT_NO_SALT 0x00000010
1805 #define CRYPT_PREGEN 0x00000040
1806 #define CRYPT_SERVER 0x00000400
1807 #define CRYPT_ARCHIVABLE 0x00004000
1809 /* CryptExportKey */
1810 #define CRYPT_SSL2_FALLBACK 0x00000002
1811 #define CRYPT_DESTROYKEY 0x00000004
1812 #define CRYPT_OAEP 0x00000040
1814 /* CryptHashSessionKey */
1815 #define CRYPT_LITTLE_ENDIAN 0x00000001
1817 /* Crypt{Protect,Unprotect}Data PROMPTSTRUCT flags */
1818 #define CRYPTPROTECT_PROMPT_ON_PROTECT 0x0001
1819 #define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x0002
1820 /* Crypt{Protect,Unprotect}Data flags */
1821 #define CRYPTPROTECT_UI_FORBIDDEN 0x0001
1822 #define CRYPTPROTECT_LOCAL_MACHINE 0x0004
1823 #define CRYPTPROTECT_AUDIT 0x0010
1824 #define CRYPTPROTECT_VERIFY_PROTECTION 0x0040
1826 /* Blob Types */
1827 #define SIMPLEBLOB 0x1
1828 #define PUBLICKEYBLOB 0x6
1829 #define PRIVATEKEYBLOB 0x7
1830 #define PLAINTEXTKEYBLOB 0x8
1831 #define OPAQUEKEYBLOB 0x9
1832 #define PUBLICKEYBLOBEX 0xA
1833 #define SYMMETRICWRAPKEYBLOB 0xB
1835 #define CUR_BLOB_VERSION 2
1837 /* cert store provider types */
1838 #define CERT_STORE_PROV_MSG ((LPCSTR)1)
1839 #define CERT_STORE_PROV_MEMORY ((LPCSTR)2)
1840 #define CERT_STORE_PROV_FILE ((LPCSTR)3)
1841 #define CERT_STORE_PROV_REG ((LPCSTR)4)
1842 #define CERT_STORE_PROV_PKCS7 ((LPCSTR)5)
1843 #define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6)
1844 #define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7)
1845 #define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8)
1846 #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9)
1847 #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10)
1848 #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
1849 #define CERT_STORE_PROV_COLLECTION ((LPCSTR)11)
1850 #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12)
1851 #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13)
1852 #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
1853 #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14)
1854 #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
1855 #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15)
1856 #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
1857 #define CERT_STORE_PROV_LDAP_W ((LPCSTR)16)
1858 #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
1860 #define sz_CERT_STORE_PROV_MEMORY "Memory"
1861 #define sz_CERT_STORE_PROV_FILENAME_W "File"
1862 #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
1863 #define sz_CERT_STORE_PROV_SYSTEM_W "System"
1864 #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
1865 #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
1866 #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
1867 #define sz_CERT_STORE_PROV_COLLECTION "Collection"
1868 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
1869 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
1870 #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
1871 #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
1872 #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
1873 #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
1874 #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
1875 #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
1877 /* types for CertOpenStore dwEncodingType */
1878 #define CERT_ENCODING_TYPE_MASK 0x0000ffff
1879 #define CMSG_ENCODING_TYPE_MASK 0xffff0000
1880 #define GET_CERT_ENCODING_TYPE(x) ((x) & CERT_ENCODING_TYPE_MASK)
1881 #define GET_CMSG_ENCODING_TYPE(x) ((x) & CMSG_ENCODING_TYPE_MASK)
1883 #define CRYPT_ASN_ENCODING 0x00000001
1884 #define CRYPT_NDR_ENCODING 0x00000002
1885 #define X509_ASN_ENCODING 0x00000001
1886 #define X509_NDR_ENCODING 0x00000002
1887 #define PKCS_7_ASN_ENCODING 0x00010000
1888 #define PKCS_7_NDR_ENCODING 0x00020000
1890 /* system store locations */
1891 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000
1892 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
1894 /* system store location ids */
1895 /* hkcu */
1896 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
1897 /* hklm */
1898 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
1899 /* hklm\Software\Microsoft\Cryptography\Services */
1900 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
1901 #define CERT_SYSTEM_STORE_SERVICES_ID 5
1902 /* HKEY_USERS */
1903 #define CERT_SYSTEM_STORE_USERS_ID 6
1904 /* hkcu\Software\Policies\Microsoft\SystemCertificates */
1905 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7
1906 /* hklm\Software\Policies\Microsoft\SystemCertificates */
1907 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8
1908 /* hklm\Software\Microsoft\EnterpriseCertificates */
1909 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9
1911 /* system store location values */
1912 #define CERT_SYSTEM_STORE_CURRENT_USER \
1913 (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1914 #define CERT_SYSTEM_STORE_LOCAL_MACHINE \
1915 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1916 #define CERT_SYSTEM_STORE_CURRENT_SERVICE \
1917 (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1918 #define CERT_SYSTEM_STORE_SERVICES \
1919 (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1920 #define CERT_SYSTEM_STORE_USERS \
1921 (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1922 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \
1923 (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1924 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \
1925 (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1926 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \
1927 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1929 #if defined(__GNUC__)
1930 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH (const WCHAR[])\
1931 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t',\
1932 '\\','S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',\
1934 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH (const WCHAR[])\
1935 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
1936 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
1937 't','i','f','i','c','a','t','e','s',0 }
1938 #elif defined(_MSC_VER)
1939 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \
1940 L"Software\\Microsoft\\SystemCertificates"
1941 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH \
1942 L"Software\\Policies\\Microsoft\\SystemCertificates"
1943 #else
1944 static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] =
1945 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
1946 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0 };
1947 static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] =
1948 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
1949 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
1950 't','i','f','i','c','a','t','e','s',0 };
1951 #endif
1953 #if defined(__GNUC__)
1954 #define CERT_EFSBLOB_REGPATH (const WCHAR[])\
1955 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
1956 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
1957 't','i','f','i','c','a','t','e','s','\\','E','F','S',0 }
1958 #define CERT_EFSBLOB_VALUE_NAME (const WCHAR[]) {'E','F','S','B','l','o','b',0 }
1959 #elif defined(_MSC_VER)
1960 #define CERT_EFSBLOB_REGPATH CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\EFS"
1961 #define CERT_EFSBLOB_VALUE_NAME L"EFSBlob"
1962 #else
1963 static const WCHAR CERT_EFSBLOB_REGPATH[] =
1964 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
1965 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
1966 't','i','f','i','c','a','t','e','s','\\','E','F','S',0 };
1967 static const CERT_EFSBLOB_VALUE_NAME[] = { 'E','F','S','B','l','o','b',0 };
1968 #endif
1970 #if defined(__GNUC__)
1971 #define CERT_PROT_ROOT_FLAGS_REGPATH (const WCHAR[])\
1972 {'\\','R','o','o','t','\\','P','r','o','t','e','c','t','e','d','R','o','o','t',\
1973 's',0 }
1974 #define CERT_PROT_ROOT_FLAGS_VALUE_NAME (const WCHAR[])\
1975 {'F','l','a','g','s',0 }
1976 #elif defined(_MSC_VER)
1977 #define CERT_PROT_ROOT_FLAGS_REGPATH L"\\Root\\ProtectedRoots"
1978 #define CERT_PROT_ROOT_FLAGS_VALUE_NAME L"Flags"
1979 #else
1980 static const WCHAR CERT_PROT_ROOT_FLAGS_REGPATH[] =
1981 { '\\','R','o','o','t','\\','P','r','o','t','e','c','t','e','d','R','o','o',
1982 't','s',0 };
1983 static const WCHAR CERT_PROT_ROOT_FLAGS_VALUE_NAME[] = {'F','l','a','g','s',0 };
1984 #endif
1986 #define CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG 0x01
1987 #define CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG 0x02
1988 #define CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG 0x04
1989 #define CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG 0x08
1990 #define CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG 0x10
1991 #define CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG 0x20
1993 #if defined(__GNUC__)
1994 #define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH (const WCHAR[])\
1995 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
1996 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
1997 't','i','f','i','c','a','t','e','s','\\','T','r','u','s','t','e','d',\
1998 'P','u','b','l','i','s','h','e','r','\\','S','a','f','e','r',0 }
1999 #elif defined(_MSC_VER)
2000 #define CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH \
2001 CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
2002 #else
2003 static const WCHAR CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH[] =
2004 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
2005 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
2006 't','i','f','i','c','a','t','e','s','\\','T','r','u','s','t','e','d',
2007 'P','u','b','l','i','s','h','e','r','\\','S','a','f','e','r',0 };
2008 #endif
2010 #if defined(__GNUC__)
2011 #define CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH (const WCHAR[])\
2012 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',\
2013 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s','\\',\
2014 'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r','\\',\
2015 'S','a','f','e','r',0 }
2016 #define CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME (const WCHAR[])\
2017 {'A','u','t','h','e','n','t','i','c','o','d','e','F','l','a','g','s',0 };
2018 #elif defined(_MSC_VER)
2019 #define CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH \
2020 CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH L"\\TrustedPublisher\\Safer"
2021 #define CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME L"AuthenticodeFlags"
2022 #else
2023 static const WCHAR CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH[] =
2024 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
2025 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s','\\',
2026 'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r','\\',
2027 'S','a','f','e','r',0 };
2028 static const WCHAR CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME[] =
2029 { 'A','u','t','h','e','n','t','i','c','o','d','e','F','l','a','g','s',0 };
2030 #endif
2032 #define CERT_TRUST_PUB_ALLOW_END_USER_TRUST 0x00000000
2033 #define CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST 0x00000001
2034 #define CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST 0x00000002
2035 #define CERT_TRUST_PUB_ALLOW_TRUST_MASK 0x00000003
2036 #define CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG 0x00000100
2037 #define CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG 0x00000200
2039 /* flags for CertOpenStore dwFlags */
2040 #define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001
2041 #define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002
2042 #define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004
2043 #define CERT_STORE_DELETE_FLAG 0x00000010
2044 #define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020
2045 #define CERT_STORE_SHARE_STORE_FLAG 0x00000040
2046 #define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080
2047 #define CERT_STORE_MANIFOLD_FLAG 0x00000100
2048 #define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200
2049 #define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400
2050 #define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800
2051 #define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000
2052 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000
2053 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
2054 #define CERT_STORE_READONLY_FLAG 0x00008000
2056 #define CERT_REGISTRY_STORE_REMOTE_FLAG 0x00010000
2057 #define CERT_REGISTRY_STORE_SERIALIZED_FLAG 0x00020000
2058 #define CERT_REGISTRY_STORE_ROAMING_FLAG 0x00040000
2059 #define CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG 0x00080000
2060 #define CERT_REGISTRY_STORE_LM_GPT_FLAG 0x01000000
2061 #define CERT_REGISTRY_STORE_CLIENT_GPT_FLAG 0x80000000
2063 #define CERT_FILE_STORE_COMMIT_ENABLE_FLAG 0x00010000
2065 /* CertCloseStore dwFlags */
2066 #define CERT_CLOSE_STORE_FORCE_FLAG 0x00000001
2067 #define CERT_CLOSE_STORE_CHECK_FLAG 0x00000002
2069 /* dwAddDisposition */
2070 #define CERT_STORE_ADD_NEW 1
2071 #define CERT_STORE_ADD_USE_EXISTING 2
2072 #define CERT_STORE_ADD_REPLACE_EXISTING 3
2073 #define CERT_STORE_ADD_ALWAYS 4
2074 #define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5
2075 #define CERT_STORE_ADD_NEWER 6
2076 #define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES 7
2078 /* Installable OID function defs */
2079 #define CRYPT_OID_OPEN_STORE_PROV_FUNC "CertDllOpenStoreProv"
2080 #define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject"
2081 #define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject"
2082 #define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx"
2083 #define CRYPT_OID_DECODE_OBJECT_EX_FUNC "CryptDllDecodeObjectEx"
2084 #define CRYPT_OID_CREATE_COM_OBJECT_FUNC "CryptDllCreateComObject"
2085 #define CRYPT_OID_VERIFY_REVOCATION_FUNC "CertDllVerifyRevocation"
2086 #define CRYPT_OID_VERIFY_CTL_USAGE_FUNC "CertDllVerifyCTLUsage"
2087 #define CRYPT_OID_FORMAT_OBJECT_FUNC "CryptDllFormatObject"
2088 #define CRYPT_OID_FIND_OID_INFO_FUNC "CryptDllFindOIDInfo"
2089 #define CRYPT_OID_FIND_LOCALIZED_NAME_FUNC "CryptDllFindLocalizedName"
2090 #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
2091 #define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC "CryptDllImportPublicKeyInfoEx"
2092 #define CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC "CryptDllExportPrivateKeyInfoEx"
2093 #define CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC "CryptDllImportPrivateKeyInfoEx"
2094 #define CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC \
2095 "CertDllVerifyCertificateChainPolicy"
2096 #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
2097 #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
2099 #define CRYPT_OID_REGPATH "Software\\Microsoft\\Cryptography\\OID"
2100 #define CRYPT_OID_REG_ENCODING_TYPE_PREFIX "EncodingType "
2101 #if defined(__GNUC__)
2102 # define CRYPT_OID_REG_DLL_VALUE_NAME (const WCHAR []){ 'D','l','l',0 }
2103 # define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME \
2104 (const WCHAR []){ 'F','u','n','c','N','a','m','e',0 }
2105 # define CRYPT_OID_REG_FLAGS_VALUE_NAME \
2106 (const WCHAR []){ 'C','r','y','p','t','F','l','a','g','s',0 }
2107 #elif defined(_MSC_VER)
2108 # define CRYPT_OID_REG_DLL_VALUE_NAME L"Dll"
2109 # define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME L"FuncName"
2110 # define CRYPT_OID_REG_FLAGS_VALUE_NAME L"CryptFlags"
2111 #else
2112 static const WCHAR CRYPT_OID_REG_DLL_VALUE_NAME[] = { 'D','l','l',0 };
2113 static const WCHAR CRYPT_OID_REG_FUNC_NAME_VALUE_NAME[] =
2114 { 'F','u','n','c','N','a','m','e',0 };
2115 static const WCHAR CRYPT_OID_REG_FLAGS_VALUE_NAME[] =
2116 { 'C','r','y','p','t','F','l','a','g','s',0 };
2117 #endif
2118 #define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A "FuncName"
2119 #define CRYPT_DEFAULT_OID "DEFAULT"
2121 #define CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG 1
2123 #define CRYPT_GET_INSTALLED_OID_FUNC_FLAG 0x1
2125 #define CRYPT_REGISTER_FIRST_INDEX 0
2126 #define CRYPT_REGISTER_LAST_INDEX 0xffffffff
2128 /* values for CERT_STORE_PROV_INFO's dwStoreProvFlags */
2129 #define CERT_STORE_PROV_EXTERNAL_FLAG 0x1
2130 #define CERT_STORE_PROV_DELETED_FLAG 0x2
2131 #define CERT_STORE_PROV_NO_PERSIST_FLAG 0x4
2132 #define CERT_STORE_PROV_SYSTEM_STORE_FLAG 0x8
2133 #define CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG 0x10
2135 /* function indices */
2136 #define CERT_STORE_PROV_CLOSE_FUNC 0
2137 #define CERT_STORE_PROV_READ_CERT_FUNC 1
2138 #define CERT_STORE_PROV_WRITE_CERT_FUNC 2
2139 #define CERT_STORE_PROV_DELETE_CERT_FUNC 3
2140 #define CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC 4
2141 #define CERT_STORE_PROV_READ_CRL_FUNC 5
2142 #define CERT_STORE_PROV_WRITE_CRL_FUNC 6
2143 #define CERT_STORE_PROV_DELETE_CRL_FUNC 7
2144 #define CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC 8
2145 #define CERT_STORE_PROV_READ_CTL_FUNC 9
2146 #define CERT_STORE_PROV_WRITE_CTL_FUNC 10
2147 #define CERT_STORE_PROV_DELETE_CTL_FUNC 11
2148 #define CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC 12
2149 #define CERT_STORE_PROV_CONTROL_FUNC 13
2150 #define CERT_STORE_PROV_FIND_CERT_FUNC 14
2151 #define CERT_STORE_PROV_FREE_FIND_CERT_FUNC 15
2152 #define CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC 16
2153 #define CERT_STORE_PROV_FIND_CRL_FUNC 17
2154 #define CERT_STORE_PROV_FREE_FIND_CRL_FUNC 18
2155 #define CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC 19
2156 #define CERT_STORE_PROV_FIND_CTL_FUNC 20
2157 #define CERT_STORE_PROV_FREE_FIND_CTL_FUNC 21
2158 #define CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC 22
2160 /* physical store dwFlags, also used by CertAddStoreToCollection as
2161 * dwUpdateFlags
2163 #define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1
2164 #define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2
2165 #define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4
2166 #define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8
2168 /* dwFlag values for CertEnumPhysicalStore callback */
2169 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
2171 /* predefined store names */
2172 #if defined(__GNUC__)
2173 # define CERT_PHYSICAL_STORE_DEFAULT_NAME (const WCHAR[])\
2174 {'.','D','e','f','a','u','l','t','0'}
2175 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME (const WCHAR[])\
2176 {'.','G','r','o','u','p','P','o','l','i','c','y',0}
2177 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME (const WCHAR[])\
2178 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0}
2179 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME (const WCHAR[])\
2180 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0}
2181 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME (const WCHAR[])\
2182 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',\
2183 'P','o','l','i','c','y',0}
2184 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME (const WCHAR[])\
2185 {'.','E','n','t','e','r','p','r','i','s','e',0}
2186 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME (const WCHAR[])\
2187 {'.','A','u','t','h','R','o','o','t',0}
2188 #elif defined(_MSC_VER)
2189 # define CERT_PHYSICAL_STORE_DEFAULT_NAME \
2190 L".Default"
2191 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \
2192 L".GroupPolicy"
2193 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \
2194 L".LocalMachine"
2195 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \
2196 L".UserCertificate"
2197 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
2198 L".LocalMachineGroupPolicy"
2199 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \
2200 L".Enterprise"
2201 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \
2202 L".AuthRoot"
2203 #else
2204 static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] =
2205 {'.','D','e','f','a','u','l','t','0'};
2206 static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME[] =
2207 {'.','G','r','o','u','p','P','o','l','i','c','y',0};
2208 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME[] =
2209 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0};
2210 static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME[] =
2211 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0};
2212 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME[] =
2213 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',
2214 'P','o','l','i','c','y',0};
2215 static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME[] =
2216 {'.','E','n','t','e','r','p','r','i','s','e',0};
2217 static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME[] =
2218 {'.','A','u','t','h','R','o','o','t',0};
2219 #endif
2221 /* cert system store flags */
2222 #define CERT_SYSTEM_STORE_MASK 0xffff0000
2223 #define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000
2225 /* CertFindChainInStore dwFindType types */
2226 #define CERT_CHAIN_FIND_BY_ISSUER 1
2228 /* CertSaveStore dwSaveAs values */
2229 #define CERT_STORE_SAVE_AS_STORE 1
2230 #define CERT_STORE_SAVE_AS_PKCS7 2
2231 /* CertSaveStore dwSaveTo values */
2232 #define CERT_STORE_SAVE_TO_FILE 1
2233 #define CERT_STORE_SAVE_TO_MEMORY 2
2234 #define CERT_STORE_SAVE_TO_FILENAME_A 3
2235 #define CERT_STORE_SAVE_TO_FILENAME_W 4
2236 #define CERT_STORE_SAVE_TO_FILENAME CERT_STORE_SAVE_TO_FILENAME_W
2238 /* CERT_INFO versions/flags */
2239 #define CERT_V1 0
2240 #define CERT_V2 1
2241 #define CERT_V3 2
2242 #define CERT_INFO_VERSION_FLAG 1
2243 #define CERT_INFO_SERIAL_NUMBER_FLAG 2
2244 #define CERT_INFO_SIGNATURE_ALGORITHM_FLAG 3
2245 #define CERT_INFO_ISSUER_FLAG 4
2246 #define CERT_INFO_NOT_BEFORE_FLAG 5
2247 #define CERT_INFO_NOT_AFTER_FLAG 6
2248 #define CERT_INFO_SUBJECT_FLAG 7
2249 #define CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG 8
2250 #define CERT_INFO_ISSUER_UNIQUE_ID_FLAG 9
2251 #define CERT_INFO_SUBJECT_UNIQUE_ID_FLAG 10
2252 #define CERT_INFO_EXTENSION_FLAG 11
2254 /* CERT_REQUEST_INFO versions */
2255 #define CERT_REQUEST_V1 0
2257 /* CERT_KEYGEN_REQUEST_INFO versions */
2258 #define CERT_KEYGEN_REQUEST_V1 0
2260 /* CRL versions */
2261 #define CRL_V1 0
2262 #define CRL_V2 1
2264 /* CTL versions */
2265 #define CTL_V1 0
2267 /* Certificate, CRL, CTL property IDs */
2268 #define CERT_KEY_PROV_HANDLE_PROP_ID 1
2269 #define CERT_KEY_PROV_INFO_PROP_ID 2
2270 #define CERT_SHA1_HASH_PROP_ID 3
2271 #define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID
2272 #define CERT_MD5_HASH_PROP_ID 4
2273 #define CERT_KEY_CONTEXT_PROP_ID 5
2274 #define CERT_KEY_SPEC_PROP_ID 6
2275 #define CERT_IE30_RESERVED_PROP_ID 7
2276 #define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8
2277 #define CERT_ENHKEY_USAGE_PROP_ID 9
2278 #define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID
2279 #define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10
2280 #define CERT_FRIENDLY_NAME_PROP_ID 11
2281 #define CERT_PVK_FILE_PROP_ID 12
2282 #define CERT_DESCRIPTION_PROP_ID 13
2283 #define CERT_ACCESS_STATE_PROP_ID 14
2284 #define CERT_SIGNATURE_HASH_PROP_ID 15
2285 #define CERT_SMART_CARD_DATA_PROP_ID 16
2286 #define CERT_EFS_PROP_ID 17
2287 #define CERT_FORTEZZA_DATA_PROP 18
2288 #define CERT_ARCHIVED_PROP_ID 19
2289 #define CERT_KEY_IDENTIFIER_PROP_ID 20
2290 #define CERT_AUTO_ENROLL_PROP_ID 21
2291 #define CERT_PUBKEY_ALG_PARA_PROP_ID 22
2292 #define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23
2293 #define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24
2294 #define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25
2295 #define CERT_ENROLLMENT_PROP_ID 26
2296 #define CERT_DATE_STAMP_PROP_ID 27
2297 #define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28
2298 #define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29
2299 #define CERT_EXTENDED_ERROR_INFO_PROP_ID 30
2300 /* 31 -- unused?
2301 32 -- cert prop id
2302 33 -- CRL prop id
2303 34 -- CTL prop id
2304 35 -- KeyId prop id
2305 36-63 -- reserved
2307 #define CERT_RENEWAL_PROP_ID 64
2308 #define CERT_ARCHIVED_KEY_HASH_PROP_ID 65
2309 #define CERT_AUTO_ENROLL_RETRY_PROP_ID 66
2310 #define CERT_AIA_URL_RETRIEVED_PROP_ID 67
2311 #define CERT_AUTHORITY_INFO_ACCESS_PROP_ID 68
2312 #define CERT_BACKED_UP_PROP_ID 69
2313 #define CERT_OCSP_RESPONSE_PROP_ID 70
2314 #define CERT_REQUEST_ORIGINATOR_PROP_ID 71
2315 #define CERT_SOURCE_LOCATION_PROP_ID 72
2316 #define CERT_SOURCE_URL_PROP_ID 73
2317 #define CERT_NEW_KEY_PROP_ID 74
2318 #define CERT_OCSP_CACHE_PREFIX_PROP_ID 75
2319 #define CERT_SMART_CARD_ROOT_INFO_PROP_ID 76
2320 #define CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID 77
2321 #define CERT_NCRYPT_KEY_HANDLE_PROP_ID 78
2322 #define CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID 79
2323 #define CERT_SUBJECT_INFO_ACCESS_PROP_ID 80
2324 #define CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID 81
2325 #define CERT_CA_DISABLE_CRL_PROP_ID 82
2326 #define CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID 83
2327 #define CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID 84
2329 #define CERT_FIRST_RESERVED_PROP_ID 85
2330 #define CERT_LAST_RESERVED_PROP_ID 0x00007fff
2331 #define CERT_FIRST_USER_PROP_ID 0x00008000
2332 #define CERT_LAST_USER_PROP_ID 0x0000ffff
2334 #define IS_CERT_HASH_PROP_ID(x) \
2335 ((x) == CERT_SHA1_HASH_PROP_ID || (x) == CERT_MD5_HASH_PROP_ID || \
2336 (x) == CERT_SIGNATURE_HASH_PROP_ID)
2338 #define IS_PUBKEY_HASH_PROP_ID(x) \
2339 ((x) == CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2340 (x) == CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID)
2342 #define IS_CHAIN_HASH_PROP_ID(x) \
2343 ((x) == CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2344 (x) == CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID || \
2345 (x) == CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID || \
2346 (x) == CERT_SUBJECT_NAME_MD5_HASH_PROP_ID)
2348 /* access state flags */
2349 #define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1
2350 #define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2
2351 #define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4
2353 /* CertSetCertificateContextProperty flags */
2354 #define CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG 0x40000000
2355 #define CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG 0x80000000
2357 /* CERT_RDN attribute dwValueType types */
2358 #define CERT_RDN_TYPE_MASK 0x000000ff
2359 #define CERT_RDN_ANY_TYPE 0
2360 #define CERT_RDN_ENCODED_BLOB 1
2361 #define CERT_RDN_OCTET_STRING 2
2362 #define CERT_RDN_NUMERIC_STRING 3
2363 #define CERT_RDN_PRINTABLE_STRING 4
2364 #define CERT_RDN_TELETEX_STRING 5
2365 #define CERT_RDN_T61_STRING 5
2366 #define CERT_RDN_VIDEOTEX_STRING 6
2367 #define CERT_RDN_IA5_STRING 7
2368 #define CERT_RDN_GRAPHIC_STRING 8
2369 #define CERT_RDN_VISIBLE_STRING 9
2370 #define CERT_RDN_ISO646_STRING 9
2371 #define CERT_RDN_GENERAL_STRING 10
2372 #define CERT_RDN_UNIVERSAL_STRING 11
2373 #define CERT_RDN_INT4_STRING 11
2374 #define CERT_RDN_BMP_STRING 12
2375 #define CERT_RDN_UNICODE_STRING 12
2376 #define CERT_RDN_UTF8_STRING 13
2378 /* CERT_RDN attribute dwValueType flags */
2379 #define CERT_RDN_FLAGS_MASK 0xff000000
2380 #define CERT_RDN_ENABLE_T61_UNICODE_FLAG 0x80000000
2381 #define CERT_RDN_DISABLE_CHECK_TYPE_FLAG 0x4000000
2382 #define CERT_RDN_ENABLE_UTF8_UNICODE_FLAG 0x2000000
2383 #define CERT_RDN_DISABLE_IE4_UTF8_FLAG 0x0100000
2385 #define IS_CERT_RDN_CHAR_STRING(x) \
2386 (((x) & CERT_RDN_TYPE_MASK) >= CERT_RDN_NUMERIC_STRING)
2388 /* CertIsRDNAttrsInCertificateName flags */
2389 #define CERT_UNICODE_IS_RDN_ATTRS_FLAG 0x1
2390 #define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 0x2
2392 /* CRL reason codes */
2393 #define CRL_REASON_UNSPECIFIED 0
2394 #define CRL_REASON_KEY_COMPROMISE 1
2395 #define CRL_REASON_CA_COMPROMISE 2
2396 #define CRL_REASON_AFFILIATION_CHANGED 3
2397 #define CRL_REASON_SUPERSEDED 4
2398 #define CRL_REASON_CESSATION_OF_OPERATION 5
2399 #define CRL_REASON_CERTIFICATE_HOLD 6
2400 #define CRL_REASON_REMOVE_FROM_CRL 8
2402 /* CertControlStore control types */
2403 #define CERT_STORE_CTRL_RESYNC 1
2404 #define CERT_STORE_CTRL_NOTIFY_CHANGE 2
2405 #define CERT_STORE_CTRL_COMMIT 3
2406 #define CERT_STORE_CTRL_AUTO_RESYNC 4
2407 #define CERT_STORE_CTRL_CANCEL_NOTIFY 5
2409 #define CERT_STORE_CTRL_COMMIT_FORCE_FLAG 0x1
2410 #define CERT_STORE_CTRL_COMMIT_CLEAR_FLAG 0x2
2412 /* cert store properties */
2413 #define CERT_STORE_LOCALIZED_NAME_PROP_ID 0x1000
2415 /* CertCreateContext flags */
2416 #define CERT_CREATE_CONTEXT_NOCOPY_FLAG 0x1
2417 #define CERT_CREATE_CONTEXT_SORTED_FLAG 0x2
2418 #define CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG 0x4
2419 #define CERT_CREATE_CONTEXT_NO_ENTRY_FLAG 0x8
2421 #define CERT_COMPARE_MASK 0xffff
2422 #define CERT_COMPARE_SHIFT 16
2423 #define CERT_COMPARE_ANY 0
2424 #define CERT_COMPARE_SHA1_HASH 1
2425 #define CERT_COMPARE_HASH CERT_COMPARE_SHA1_HASH
2426 #define CERT_COMPARE_NAME 2
2427 #define CERT_COMPARE_ATTR 3
2428 #define CERT_COMPARE_MD5_HASH 4
2429 #define CERT_COMPARE_PROPERTY 5
2430 #define CERT_COMPARE_PUBLIC_KEY 6
2431 #define CERT_COMPARE_NAME_STR_A 7
2432 #define CERT_COMPARE_NAME_STR_W 8
2433 #define CERT_COMPARE_KEY_SPEC 9
2434 #define CERT_COMPARE_ENHKEY_USAGE 10
2435 #define CERT_COMPARE_CTL_USAGE CERT_COMPARE_ENHKEY_USAGE
2436 #define CERT_COMPARE_SUBJECT_CERT 11
2437 #define CERT_COMPARE_ISSUER_OF 12
2438 #define CERT_COMPARE_EXISTING 13
2439 #define CERT_COMPARE_SIGNATURE_HASH 14
2440 #define CERT_COMPARE_KEY_IDENTIFIER 15
2441 #define CERT_COMPARE_CERT_ID 16
2442 #define CERT_COMPARE_CROSS_CERT_DIST_POINTS 17
2443 #define CERT_COMPARE_PUBKEY_MD5_HASH 18
2445 /* values of dwFindType for CertFind*InStore */
2446 #define CERT_FIND_ANY \
2447 (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT)
2448 #define CERT_FIND_SHA1_HASH \
2449 (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT)
2450 #define CERT_FIND_MD5_HASH \
2451 (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT)
2452 #define CERT_FIND_SIGNATURE_HASH \
2453 (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT)
2454 #define CERT_FIND_KEY_IDENTIFIER \
2455 (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT)
2456 #define CERT_FIND_HASH CERT_FIND_SHA1_HASH
2457 #define CERT_FIND_PROPERTY \
2458 (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT)
2459 #define CERT_FIND_PUBLIC_KEY \
2460 (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT)
2461 #define CERT_FIND_SUBJECT_NAME \
2462 (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2463 #define CERT_FIND_SUBJECT_ATTR \
2464 (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2465 #define CERT_FIND_ISSUER_NAME \
2466 (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2467 #define CERT_FIND_ISSUER_ATTR \
2468 (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2469 #define CERT_FIND_SUBJECT_STR_A \
2470 (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2471 #define CERT_FIND_SUBJECT_STR_W \
2472 (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
2473 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W
2474 #define CERT_FIND_ISSUER_STR_A \
2475 (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2476 #define CERT_FIND_ISSUER_STR_W \
2477 (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
2478 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W
2479 #define CERT_FIND_KEY_SPEC \
2480 (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT)
2481 #define CERT_FIND_ENHKEY_USAGE \
2482 (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT)
2483 #define CERT_FIND_CTL_USAGE CERT_FIND_ENHKEY_USAGE
2484 #define CERT_FIND_SUBJECT_CERT \
2485 (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT)
2486 #define CERT_FIND_ISSUER_OF \
2487 (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT)
2488 #define CERT_FIND_EXISTING \
2489 (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT)
2490 #define CERT_FIND_CERT_ID \
2491 (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT)
2492 #define CERT_FIND_CROSS_CERT_DIST_POINTS \
2493 (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT)
2494 #define CERT_FIND_PUBKEY_MD5_HASH \
2495 (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT)
2497 #define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 0x1
2498 #define CERT_FIND_OPTIONAL_CTL_USAGE_FLAG 0x1
2499 #define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 0x2
2500 #define CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG 0x2
2501 #define CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG 0x4
2502 #define CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG 0x4
2503 #define CERT_FIND_NO_ENHKEY_USAGE_FLAG 0x8
2504 #define CERT_FIND_NO_CTL_USAGE_FLAG 0x8
2505 #define CERT_FIND_OR_ENHKEY_USAGE_FLAG 0x10
2506 #define CERT_FIND_OR_CTL_USAGE_FLAG 0x10
2507 #define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 0x20
2508 #define CERT_FIND_VALID_CTL_USAGE_FLAG 0x20
2510 #define CRL_FIND_ANY 0
2511 #define CRL_FIND_ISSUED_BY 1
2512 #define CRL_FIND_EXISTING 2
2513 #define CRL_FIND_ISSUED_FOR 3
2515 #define CRL_FIND_ISSUED_BY_AKI_FLAG 0x1
2516 #define CRL_FIND_ISSUED_BY_SIGNATURE_FLAG 0x2
2517 #define CRL_FIND_ISSUED_BY_DELTA_FLAG 0x4
2518 #define CRL_FIND_ISSUED_BY_BASE_FLAG 0x8
2520 typedef struct _CRL_FIND_ISSUED_FOR_PARA
2522 PCCERT_CONTEXT pSubjectCert;
2523 PCCERT_CONTEXT pIssuerCert;
2524 } CRL_FIND_ISSUED_FOR_PARA, *PCRL_FIND_ISSUED_FOR_PARA;
2526 /* PFN_CERT_STORE_PROV_WRITE_CERT dwFlags values */
2527 #define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1
2529 /* CertAddSerializedElementToStore context types */
2530 #define CERT_STORE_CERTIFICATE_CONTEXT 1
2531 #define CERT_STORE_CRL_CONTEXT 2
2532 #define CERT_STORE_CTL_CONTEXT 3
2533 #define CERT_STORE_ALL_CONTEXT_FLAG ~0U
2534 #define CERT_STORE_CERTIFICATE_CONTEXT_FLAG \
2535 (1 << CERT_STORE_CERTIFICATE_CONTEXT)
2536 #define CERT_STORE_CRL_CONTEXT_FLAG (1 << CERT_STORE_CRL_CONTEXT)
2537 #define CERT_STORE_CTL_CONTEXT_FLAG (1 << CERT_STORE_CTL_CONTEXT)
2539 /* CryptBinaryToString/CryptStringToBinary flags */
2540 #define CRYPT_STRING_BASE64HEADER 0x00000000
2541 #define CRYPT_STRING_BASE64 0x00000001
2542 #define CRYPT_STRING_BINARY 0x00000002
2543 #define CRYPT_STRING_BASE64REQUESTHEADER 0x00000003
2544 #define CRYPT_STRING_HEX 0x00000004
2545 #define CRYPT_STRING_HEXASCII 0x00000005
2546 #define CRYPT_STRING_BASE64_ANY 0x00000006
2547 #define CRYPT_STRING_ANY 0x00000007
2548 #define CRYPT_STRING_HEX_ANY 0x00000008
2549 #define CRYPT_STRING_BASE64X509CRLHEADER 0x00000009
2550 #define CRYPT_STRING_HEXADDR 0x0000000a
2551 #define CRYPT_STRING_HEXASCIIADDR 0x0000000b
2552 #define CRYPT_STRING_NOCR 0x80000000
2554 /* OIDs */
2555 #define szOID_RSA "1.2.840.113549"
2556 #define szOID_PKCS "1.2.840.113549.1"
2557 #define szOID_RSA_HASH "1.2.840.113549.2"
2558 #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
2559 #define szOID_PKCS_1 "1.2.840.113549.1.1"
2560 #define szOID_PKCS_2 "1.2.840.113549.1.2"
2561 #define szOID_PKCS_3 "1.2.840.113549.1.3"
2562 #define szOID_PKCS_4 "1.2.840.113549.1.4"
2563 #define szOID_PKCS_5 "1.2.840.113549.1.5"
2564 #define szOID_PKCS_6 "1.2.840.113549.1.6"
2565 #define szOID_PKCS_7 "1.2.840.113549.1.7"
2566 #define szOID_PKCS_8 "1.2.840.113549.1.8"
2567 #define szOID_PKCS_9 "1.2.840.113549.1.9"
2568 #define szOID_PKCS_10 "1.2.840.113549.1.10"
2569 #define szOID_PKCS_11 "1.2.840.113549.1.12"
2570 #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
2571 #define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA
2572 #define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA
2573 #define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA
2574 #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
2575 #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
2576 #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
2577 #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
2578 #define szOID_RSA_SET0AEP_RSA "1.2.840.113549.1.1.6"
2579 #define szOID_RSA_DH "1.2.840.113549.1.3.1"
2580 #define szOID_RSA_data "1.2.840.113549.1.7.1"
2581 #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
2582 #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
2583 #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
2584 #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
2585 #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
2586 #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
2587 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
2588 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
2589 #define szOID_RSA_contentType "1.2.840.113549.1.9.3"
2590 #define szOID_RSA_messageDigest "1.2.840.113549.1.9.4"
2591 #define szOID_RSA_signingTime "1.2.840.113549.1.9.5"
2592 #define szOID_RSA_counterSign "1.2.840.113549.1.9.6"
2593 #define szOID_RSA_challengePwd "1.2.840.113549.1.9.7"
2594 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.9"
2595 #define szOID_RSA_extCertAttrs "1.2.840.113549.1.9.9"
2596 #define szOID_RSA_certExtensions "1.2.840.113549.1.9.14"
2597 #define szOID_RSA_SMIMECapabilities "1.2.840.113549.1.9.15"
2598 #define szOID_RSA_preferSignedData "1.2.840.113549.1.9.15.1"
2599 #define szOID_RSA_SMIMEalg "1.2.840.113549.1.9.16.3"
2600 #define szOID_RSA_SMIMEalgESDH "1.2.840.113549.1.9.16.3.5"
2601 #define szOID_RSA_SMIMEalgCMS3DESwrap "1.2.840.113549.1.9.16.3.6"
2602 #define szOID_RSA_SMIMEalgCMSRC2wrap "1.2.840.113549.1.9.16.3.7"
2603 #define szOID_RSA_MD2 "1.2.840.113549.2.2"
2604 #define szOID_RSA_MD4 "1.2.840.113549.2.4"
2605 #define szOID_RSA_MD5 "1.2.840.113549.2.5"
2606 #define szOID_RSA_RC2CBC "1.2.840.113549.3.2"
2607 #define szOID_RSA_RC4 "1.2.840.113549.3.4"
2608 #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
2609 #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
2610 #define szOID_ANSI_X942 "1.2.840.10046"
2611 #define szOID_ANSI_X942_DH "1.2.840.10046.2.1"
2612 #define szOID_X957 "1.2.840.10040"
2613 #define szOID_X957_DSA "1.2.840.10040.4.1"
2614 #define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
2615 #define szOID_DS "2.5"
2616 #define szOID_DSALG "2.5.8"
2617 #define szOID_DSALG_CRPT "2.5.8.1"
2618 #define szOID_DSALG_HASH "2.5.8.2"
2619 #define szOID_DSALG_SIGN "2.5.8.3"
2620 #define szOID_DSALG_RSA "2.5.8.1.1"
2621 #define szOID_OIW "1.3.14"
2622 #define szOID_OIWSEC "1.3.14.3.2"
2623 #define szOID_OIWSEC_md4RSA "1.3.14.3.2.2"
2624 #define szOID_OIWSEC_md5RSA "1.3.14.3.2.3"
2625 #define szOID_OIWSEC_md4RSA2 "1.3.14.3.2.4"
2626 #define szOID_OIWSEC_desECB "1.3.14.3.2.6"
2627 #define szOID_OIWSEC_desCBC "1.3.14.3.2.7"
2628 #define szOID_OIWSEC_desOFB "1.3.14.3.2.8"
2629 #define szOID_OIWSEC_desCFB "1.3.14.3.2.9"
2630 #define szOID_OIWSEC_desMAC "1.3.14.3.2.10"
2631 #define szOID_OIWSEC_rsaSign "1.3.14.3.2.11"
2632 #define szOID_OIWSEC_dsa "1.3.14.3.2.12"
2633 #define szOID_OIWSEC_shaDSA "1.3.14.3.2.13"
2634 #define szOID_OIWSEC_mdc2RSA "1.3.14.3.2.14"
2635 #define szOID_OIWSEC_shaRSA "1.3.14.3.2.15"
2636 #define szOID_OIWSEC_dhCommMod "1.3.14.3.2.16"
2637 #define szOID_OIWSEC_desEDE "1.3.14.3.2.17"
2638 #define szOID_OIWSEC_sha "1.3.14.3.2.18"
2639 #define szOID_OIWSEC_mdc2 "1.3.14.3.2.19"
2640 #define szOID_OIWSEC_dsaComm "1.3.14.3.2.20"
2641 #define szOID_OIWSEC_dsaCommSHA "1.3.14.3.2.21"
2642 #define szOID_OIWSEC_rsaXchg "1.3.14.3.2.22"
2643 #define szOID_OIWSEC_keyHashSeal "1.3.14.3.2.23"
2644 #define szOID_OIWSEC_md2RSASign "1.3.14.3.2.24"
2645 #define szOID_OIWSEC_md5RSASign "1.3.14.3.2.25"
2646 #define szOID_OIWSEC_sha1 "1.3.14.3.2.26"
2647 #define szOID_OIWSEC_dsaSHA1 "1.3.14.3.2.27"
2648 #define szOID_OIWSEC_dsaCommSHA1 "1.3.14.3.2.28"
2649 #define szOID_OIWSEC_sha1RSASign "1.3.14.3.2.29"
2650 #define szOID_OIWDIR "1.3.14.7.2"
2651 #define szOID_OIWDIR_CRPT "1.3.14.7.2.1"
2652 #define szOID_OIWDIR_HASH "1.3.14.7.2.2"
2653 #define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
2654 #define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
2655 #define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
2656 #define szOID_INFOSEC "2.16.840.1.101.2.1"
2657 #define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
2658 #define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
2659 #define szOID_INFOSEC_sdnsConfidentiality "2.16.840.1.101.2.1.1.3"
2660 #define szOID_INFOSEC_mosaicConfidentiality "2.16.840.1.101.2.1.1.4"
2661 #define szOID_INFOSEC_sdnsIntegrity "2.16.840.1.101.2.1.1.5"
2662 #define szOID_INFOSEC_mosaicIntegrity "2.16.840.1.101.2.1.1.6"
2663 #define szOID_INFOSEC_sdnsTokenProtection "2.16.840.1.101.2.1.1.7"
2664 #define szOID_INFOSEC_mosaicTokenProtection "2.16.840.1.101.2.1.1.8"
2665 #define szOID_INFOSEC_sdnsKeyManagement "2.16.840.1.101.2.1.1.9"
2666 #define szOID_INFOSEC_mosaicKeyManagement "2.16.840.1.101.2.1.1.10"
2667 #define szOID_INFOSEC_sdnsKMandSig "2.16.840.1.101.2.1.1.11"
2668 #define szOID_INFOSEC_mosaicKMandSig "2.16.840.1.101.2.1.1.12"
2669 #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
2670 #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
2671 #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
2672 #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
2673 #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
2674 #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
2675 #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
2676 #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
2677 #define szOID_INFOSEC_mosaicUpdateInteg "2.16.840.1.101.2.1.1.21"
2678 #define szOID_COMMON_NAME "2.5.4.3"
2679 #define szOID_SUR_NAME "2.5.4.4"
2680 #define szOID_DEVICE_SERIAL_NUMBER "2.5.4.5"
2681 #define szOID_COUNTRY_NAME "2.5.4.6"
2682 #define szOID_LOCALITY_NAME "2.5.4.7"
2683 #define szOID_STATE_OR_PROVINCE_NAME "2.5.4.8"
2684 #define szOID_STREET_ADDRESS "2.5.4.9"
2685 #define szOID_ORGANIZATION_NAME "2.5.4.10"
2686 #define szOID_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
2687 #define szOID_TITLE "2.5.4.12"
2688 #define szOID_DESCRIPTION "2.5.4.13"
2689 #define szOID_SEARCH_GUIDE "2.5.4.14"
2690 #define szOID_BUSINESS_CATEGORY "2.5.4.15"
2691 #define szOID_POSTAL_ADDRESS "2.5.4.16"
2692 #define szOID_POSTAL_CODE "2.5.4.17"
2693 #define szOID_POST_OFFICE_BOX "2.5.4.18"
2694 #define szOID_PHYSICAL_DELIVERY_OFFICE_NAME "2.5.4.19"
2695 #define szOID_TELEPHONE_NUMBER "2.5.4.20"
2696 #define szOID_TELEX_NUMBER "2.5.4.21"
2697 #define szOID_TELETEXT_TERMINAL_IDENTIFIER "2.5.4.22"
2698 #define szOID_FACSIMILE_TELEPHONE_NUMBER "2.5.4.23"
2699 #define szOID_X21_ADDRESS "2.5.4.24"
2700 #define szOID_INTERNATIONAL_ISDN_NUMBER "2.5.4.25"
2701 #define szOID_REGISTERED_ADDRESS "2.5.4.26"
2702 #define szOID_DESTINATION_INDICATOR "2.5.4.27"
2703 #define szOID_PREFERRED_DELIVERY_METHOD "2.5.4.28"
2704 #define szOID_PRESENTATION_ADDRESS "2.5.4.29"
2705 #define szOID_SUPPORTED_APPLICATION_CONTEXT "2.5.4.30"
2706 #define szOID_MEMBER "2.5.4.31"
2707 #define szOID_OWNER "2.5.4.32"
2708 #define szOID_ROLE_OCCUPANT "2.5.4.33"
2709 #define szOID_SEE_ALSO "2.5.4.34"
2710 #define szOID_USER_PASSWORD "2.5.4.35"
2711 #define szOID_USER_CERTIFICATE "2.5.4.36"
2712 #define szOID_CA_CERTIFICATE "2.5.4.37"
2713 #define szOID_AUTHORITY_REVOCATION_LIST "2.5.4.38"
2714 #define szOID_CERTIFICATE_REVOCATION_LIST "2.5.4.39"
2715 #define szOID_CROSS_CERTIFICATE_PAIR "2.5.4.40"
2716 #define szOID_GIVEN_NAME "2.5.4.42"
2717 #define szOID_INITIALS "2.5.4.43"
2718 #define szOID_DN_QUALIFIER "2.5.4.46"
2719 #define szOID_AUTHORITY_KEY_IDENTIFIER "2.5.29.1"
2720 #define szOID_KEY_ATTRIBUTES "2.5.29.2"
2721 #define szOID_CERT_POLICIES_95 "2.5.29.3"
2722 #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
2723 #define szOID_LEGACY_POLICY_MAPPINGS "2.5.29.5"
2724 #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
2725 #define szOID_ISSUER_ALT_NAME "2.5.29.8"
2726 #define szOID_SUBJECT_DIR_ATTRS "2.5.29.9"
2727 #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
2728 #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
2729 #define szOID_KEY_USAGE "2.5.29.15"
2730 #define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16"
2731 #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
2732 #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
2733 #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
2734 #define szOID_CRL_NUMBER "2.5.29.20"
2735 #define szOID_CRL_REASON_CODE "2.5.29.21"
2736 #define szOID_REASON_CODE_HOLD "2.5.29.23"
2737 #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
2738 #define szOID_ISSUING_DIST_POINT "2.5.29.28"
2739 #define szOID_NAME_CONSTRAINTS "2.5.29.30"
2740 #define szOID_CRL_DIST_POINTS "2.5.29.31"
2741 #define szOID_CERT_POLICIES "2.5.29.32"
2742 #define szOID_ANY_CERT_POLICY "2.5.29.32.0"
2743 #define szOID_POLICY_MAPPINGS "2.5.29.33"
2744 #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
2745 #define szOID_POLICY_CONSTRAINTS "2.5.29.36"
2746 #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
2747 #define szOID_FRESHEST_CRL "2.5.29.46"
2748 #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25"
2749 #define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20"
2750 #define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21"
2751 #define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14"
2752 #define szOID_NEXT_UPDATE_LOCATION "1.3.6.1.4.1.311.10.2"
2753 #define szOID_KP_CTL_USAGE_SIGNING "1.3.6.1.4.1.311.10.3.1"
2754 #define szOID_KP_TIME_STAMP_SIGNING "1.3.6.1.4.1.311.10.3.2"
2755 #ifndef szOID_SERVER_GATED_CRYPTO
2756 #define szOID_SERVER_GATED_CRYPTO "1.3.6.1.4.1.311.10.3.3"
2757 #endif
2758 #ifndef szOID_SGC_NETSCAPE
2759 #define szOID_SGC_NETSCAPE "2.16.840.1.113730.4.1"
2760 #endif
2761 #define szOID_KP_EFS "1.3.6.1.4.1.311.10.3.4"
2762 #define szOID_EFS_RECOVERY "1.3.6.1.4.1.311.10.3.4.1"
2763 #define szOID_WHQL_CRYPTO "1.3.6.1.4.1.311.10.3.5"
2764 #define szOID_NT5_CRYPTO "1.3.6.1.4.1.311.10.3.6"
2765 #define szOID_OEM_WHQL_CRYPTO "1.3.6.1.4.1.311.10.3.7"
2766 #define szOID_EMBEDDED_NT_CRYPTO "1.3.6.1.4.1.311.10.3.8"
2767 #define szOID_ROOT_LIST_SIGNER "1.3.6.1.4.1.311.10.3.9"
2768 #define szOID_KP_QUALIFIED_SUBORDINATION "1.3.6.1.4.1.311.10.3.10"
2769 #define szOID_KP_KEY_RECOVERY "1.3.6.1.4.1.311.10.3.11"
2770 #define szOID_KP_DOCUMENT_SIGNING "1.3.6.1.4.1.311.10.3.12"
2771 #define szOID_KP_LIFETIME_SIGNING "1.3.6.1.4.1.311.10.3.13"
2772 #define szOID_KP_MOBILE_DEVICE_SOFTWARE "1.3.6.1.4.1.311.10.3.14"
2773 #define szOID_YESNO_TRUST_ATTR "1.3.6.1.4.1.311.10.4.1"
2774 #ifndef szOID_DRM
2775 #define szOID_DRM "1.3.6.1.4.1.311.10.5.1"
2776 #endif
2777 #ifndef szOID_DRM_INDIVIDUALIZATION
2778 #define szOID_DRM_INDIVIDUALIZATION "1.3.6.1.4.1.311.10.5.2"
2779 #endif
2780 #ifndef szOID_LICENSES
2781 #define szOID_LICENSES "1.3.6.1.4.1.311.10.6.1"
2782 #endif
2783 #ifndef szOID_LICENSE_SERVER
2784 #define szOID_LICENSE_SERVER "1.3.6.1.4.1.311.10.6.2"
2785 #endif
2786 #define szOID_REMOVE_CERTIFICATE "1.3.6.1.4.1.311.10.8.1"
2787 #define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1"
2788 #define szOID_CTL "1.3.6.1.4.1.311.10.10.1"
2789 #define szOID_SORTED_CTL "1.3.6.1.4.1.311.10.10.1.1"
2790 #define szOID_ANY_APPLICATION_POLICY "1.3.6.1.4.1.311.10.12.1"
2791 #define szOID_RENEWAL_CERTIFICATE "1.3.6.1.4.1.311.13.1"
2792 #define szOID_ENROLLMENT_NAME_VALUE_PAIR "1.3.6.1.4.1.311.13.2.1"
2793 #define szOID_ENROLLMENT_CSP_PROVIDER "1.3.6.1.4.1.311.13.2.2"
2794 #define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3"
2795 #define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1"
2796 #define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2"
2797 #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
2798 #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
2799 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
2800 #define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2"
2801 #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
2802 #ifndef szOID_CERTSRV_CA_VERSION
2803 #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
2804 #endif
2805 #define szOID_CERTSRV_PREVIOUS_CERT_HASH "1.3.6.1.4.1.311.21.2"
2806 #define szOID_CRL_VIRTUAL_BASE "1.3.6.1.4.1.311.21.3"
2807 #define szOID_CRL_NEXT_PUBLISH "1.3.6.1.4.1.311.21.4"
2808 #define szOID_KP_CA_EXCHANGE "1.3.6.1.4.1.311.21.5"
2809 #define szOID_KP_KEY_RECOVERY_AGENT "1.3.6.1.4.1.311.21.6"
2810 #define szOID_CERTIFICATE_TEMPLATE "1.3.6.1.4.1.311.21.7"
2811 #define szOID_ENTERPRISE_OID_ROOT "1.3.6.1.4.1.311.21.8"
2812 #define szOID_RDN_DUMMY_SIGNER "1.3.6.1.4.1.311.21.9"
2813 #define szOID_APPLICATION_CERT_POLICIES "1.3.6.1.4.1.311.21.10"
2814 #define szOID_APPLICATION_POLICY_MAPPINGS "1.3.6.1.4.1.311.21.11"
2815 #define szOID_APPLICATION_POLICY_CONSTRAINTS "1.3.6.1.4.1.311.21.12"
2816 #define szOID_ARCHIVED_KEY_ATTR "1.3.6.1.4.1.311.21.13"
2817 #define szOID_CRL_SELF_CDP "1.3.6.1.4.1.311.21.14"
2818 #define szOID_REQUIRE_CERT_CHAIN_POLICY "1.3.6.1.4.1.311.21.15"
2819 #define szOID_ARCHIVED_KEY_CERT_HASH "1.3.6.1.4.1.311.21.16"
2820 #define szOID_ISSUED_CERT_HASH "1.3.6.1.4.1.311.21.17"
2821 #define szOID_DS_EMAIL_REPLICATION "1.3.6.1.4.1.311.21.19"
2822 #define szOID_REQUEST_CLIENT_INFO "1.3.6.1.4.1.311.21.20"
2823 #define szOID_ENCRYPTED_KEY_HASH "1.3.6.1.4.1.311.21.21"
2824 #define szOID_CERTSRV_CROSSCA_VERSION "1.3.6.1.4.1.311.21.22"
2825 #define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1"
2826 #define szOID_PKIX "1.3.6.1.5.5.7"
2827 #define szOID_PKIX_PE "1.3.6.1.5.5.7.1"
2828 #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
2829 #define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1"
2830 #define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2"
2831 #define szOID_PKIX_KP "1.3.6.1.5.5.7.3"
2832 #define szOID_PKIX_KP_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
2833 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
2834 #define szOID_PKIX_KP_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
2835 #define szOID_PKIX_KP_EMAIL_PROTECTION "1.3.6.1.5.5.7.3.4"
2836 #define szOID_PKIX_KP_IPSEC_END_SYSTEM "1.3.6.1.5.5.7.3.5"
2837 #define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6"
2838 #define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7"
2839 #define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8"
2840 #define szOID_PKIX_NO_SIGNATURE "1.3.6.1.5.5.7.6.2"
2841 #define szOID_CMC "1.3.6.1.5.5.7.7"
2842 #define szOID_CMC_STATUS_INFO "1.3.6.1.5.5.7.7.1"
2843 #define szOID_CMC_IDENTIFICATION "1.3.6.1.5.5.7.7.2"
2844 #define szOID_CMC_IDENTITY_PROOF "1.3.6.1.5.5.7.7.3"
2845 #define szOID_CMC_DATA_RETURN "1.3.6.1.5.5.7.7.4"
2846 #define szOID_CMC_TRANSACTION_ID "1.3.6.1.5.5.7.7.5"
2847 #define szOID_CMC_SENDER_NONCE "1.3.6.1.5.5.7.7.6"
2848 #define szOID_CMC_RECIPIENT_NONCE "1.3.6.1.5.5.7.7.7"
2849 #define szOID_CMC_ADD_EXTENSIONS "1.3.6.1.5.5.7.7.8"
2850 #define szOID_CMC_ENCRYPTED_POP "1.3.6.1.5.5.7.7.9"
2851 #define szOID_CMC_DECRYPTED_POP "1.3.6.1.5.5.7.7.10"
2852 #define szOID_CMC_LRA_POP_WITNESS "1.3.6.1.5.5.7.7.11"
2853 #define szOID_CMC_GET_CERT "1.3.6.1.5.5.7.7.15"
2854 #define szOID_CMC_GET_CRL "1.3.6.1.5.5.7.7.16"
2855 #define szOID_CMC_REVOKE_REQUEST "1.3.6.1.5.5.7.7.17"
2856 #define szOID_CMC_REG_INFO "1.3.6.1.5.5.7.7.18"
2857 #define szOID_CMC_RESPONSE_INFO "1.3.6.1.5.5.7.7.19"
2858 #define szOID_CMC_QUERY_PENDING "1.3.6.1.5.5.7.7.21"
2859 #define szOID_CMC_ID_POP_LINK_RANDOM "1.3.6.1.5.5.7.7.22"
2860 #define szOID_CMC_ID_POP_LINK_WITNESS "1.3.6.1.5.5.7.7.23"
2861 #define szOID_CT_PKI_DATA "1.3.6.1.5.5.7.12.2"
2862 #define szOID_CT_PKI_RESPONSE "1.3.6.1.5.5.7.12.3"
2863 #define szOID_PKIX_ACC_DESCR "1.3.6.1.5.5.7.48"
2864 #define szOID_PKIX_OCSP "1.3.6.1.5.5.7.48.1"
2865 #define szOID_PKIX_CA_ISSUERS "1.3.6.1.5.5.7.48.2"
2866 #define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2"
2868 #ifndef szOID_SERIALIZED
2869 #define szOID_SERIALIZED "1.3.6.1.4.1.311.10.3.3.1"
2870 #endif
2872 #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
2873 #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
2874 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
2875 #ifndef szOID_KP_SMARTCARD_LOGON
2876 #define szOID_KP_SMARTCARD_LOGON "1.3.6.1.4.1.311.20.2.2"
2877 #endif
2878 #ifndef szOID_NT_PRINCIPAL_NAME
2879 #define szOID_NT_PRINCIPAL_NAME "1.3.6.1.4.1.311.20.2.3"
2880 #endif
2881 #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
2883 #ifndef szOID_CERTSRV_CA_VERSION
2884 #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
2885 #endif
2887 #ifndef szOID_PRODUCT_UPDATE
2888 #define szOID_PRODUCT_UPDATE "1.3.6.1.4.1.311.31.1"
2889 #endif
2891 #define szOID_NETSCAPE "2.16.840.1.113730"
2892 #define szOID_NETSCAPE_CERT_EXTENSION "2.16.840.1.113730.1"
2893 #define szOID_NETSCAPE_CERT_TYPE "2.16.840.1.113730.1.1"
2894 #define szOID_NETSCAPE_BASE_URL "2.16.840.1.113730.1.2"
2895 #define szOID_NETSCAPE_REVOCATION_URL "2.16.840.1.113730.1.3"
2896 #define szOID_NETSCAPE_CA_REVOCATION_URL "2.16.840.1.113730.1.4"
2897 #define szOID_NETSCAPE_CERT_RENEWAL_URL "2.16.840.1.113730.1.7"
2898 #define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8"
2899 #define szOID_NETSCAPE_SSL_SERVER_NAME "2.16.840.1.113730.1.12"
2900 #define szOID_NETSCAPE_COMMENT "2.16.840.1.113730.1.13"
2902 #define CRYPT_ENCODE_DECODE_NONE 0
2903 #define X509_CERT ((LPCSTR)1)
2904 #define X509_CERT_TO_BE_SIGNED ((LPCSTR)2)
2905 #define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR)3)
2906 #define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR)4)
2907 #define X509_EXTENSIONS ((LPCSTR)5)
2908 #define X509_NAME_VALUE ((LPCSTR)6)
2909 #define X509_ANY_STRING X509_NAME_VALUE
2910 #define X509_NAME ((LPCSTR)7)
2911 #define X509_PUBLIC_KEY_INFO ((LPCSTR)8)
2912 #define X509_AUTHORITY_KEY_ID ((LPCSTR)9)
2913 #define X509_KEY_ATTRIBUTES ((LPCSTR)10)
2914 #define X509_KEY_USAGE_RESTRICTION ((LPCSTR)11)
2915 #define X509_ALTERNATE_NAME ((LPCSTR)12)
2916 #define X509_BASIC_CONSTRAINTS ((LPCSTR)13)
2917 #define X509_KEY_USAGE ((LPCSTR)14)
2918 #define X509_BASIC_CONSTRAINTS2 ((LPCSTR)15)
2919 #define X509_CERT_POLICIES ((LPCSTR)16)
2920 #define PKCS_UTC_TIME ((LPCSTR)17)
2921 #define PKCS_TIME_REQUEST ((LPCSTR)18)
2922 #define RSA_CSP_PUBLICKEYBLOB ((LPCSTR)19)
2923 #define X509_UNICODE_NAME ((LPCSTR)20)
2924 #define X509_KEYGEN_REQUEST_TO_BE_SIGNED ((LPCSTR)21)
2925 #define PKCS_ATTRIBUTE ((LPCSTR)22)
2926 #define PKCS_CONTENT_INFO_SEQUENCE_OF_ANY ((LPCSTR)23)
2927 #define X509_UNICODE_NAME_VALUE ((LPCSTR)24)
2928 #define X509_UNICODE_ANY_STRING X509_UNICODE_NAME_VALUE
2929 #define X509_OCTET_STRING ((LPCSTR)25)
2930 #define X509_BITS ((LPCSTR)26)
2931 #define X509_INTEGER ((LPCSTR)27)
2932 #define X509_MULTI_BYTE_INTEGER ((LPCSTR)28)
2933 #define X509_ENUMERATED ((LPCSTR)29)
2934 #define X509_CRL_REASON_CODE X509_ENUMERATED
2935 #define X509_CHOICE_OF_TIME ((LPCSTR)30)
2936 #define X509_AUTHORITY_KEY_ID2 ((LPCSTR)31)
2937 #define X509_AUTHORITY_INFO_ACCESS ((LPCSTR)32)
2938 #define PKCS_CONTENT_INFO ((LPCSTR)33)
2939 #define X509_SEQUENCE_OF_ANY ((LPCSTR)34)
2940 #define X509_CRL_DIST_POINTS ((LPCSTR)35)
2941 #define X509_ENHANCED_KEY_USAGE ((LPCSTR)36)
2942 #define PKCS_CTL ((LPCSTR)37)
2943 #define X509_MULTI_BYTE_UINT ((LPCSTR)38)
2944 #define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT
2945 #define X509_DSS_PARAMETERS ((LPCSTR)39)
2946 #define X509_DSS_SIGNATURE ((LPCSTR)40)
2947 #define PKCS_RC2_CBC_PARAMETERS ((LPCSTR)41)
2948 #define PKCS_SMIME_CAPABILITIES ((LPCSTR)42)
2949 #define PKCS_RSA_PRIVATE_KEY ((LPCSTR)43)
2950 #define PKCS_PRIVATE_KEY_INFO ((LPCSTR)44)
2951 #define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR)45)
2952 #define X509_PKIX_POLICY_QUALIFIER_USERNOTICE ((LPCSTR)46)
2953 #define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
2954 #define X509_DH_PARAMETERS ((LPCSTR)47)
2955 #define PKCS_ATTRIBUTES ((LPCSTR)48)
2956 #define PKCS_SORTED_CTL ((LPCSTR)49)
2957 #define X942_DH_PARAMETERS ((LPCSTR)50)
2958 #define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR)51)
2959 #define X942_OTHER_INFO ((LPCSTR)52)
2960 #define X509_CERT_PAIR ((LPCSTR)53)
2961 #define X509_ISSUING_DIST_POINT ((LPCSTR)54)
2962 #define X509_NAME_CONSTRAINTS ((LPCSTR)55)
2963 #define X509_POLICY_MAPPINGS ((LPCSTR)56)
2964 #define X509_POLICY_CONSTRAINTS ((LPCSTR)57)
2965 #define X509_CROSS_CERT_DIST_POINTS ((LPCSTR)58)
2966 #define CMC_DATA ((LPCSTR)59)
2967 #define CMC_RESPONSE ((LPCSTR)60)
2968 #define CMC_STATUS ((LPCSTR)61)
2969 #define CMC_ADD_EXTENSIONS ((LPCSTR)62)
2970 #define CMC_ADD_ATTRIBUTES ((LPCSTR)63)
2971 #define X509_CERTIFICATE_TEMPLATE ((LPCSTR)64)
2972 #define PKCS7_SIGNER_INFO ((LPCSTR)500)
2973 #define CMS_SIGNER_INFO ((LPCSTR)501)
2975 /* encode/decode flags */
2976 #define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
2977 #define CRYPT_ENCODE_ALLOC_FLAG 0x08000
2978 #define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000
2979 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG \
2980 CERT_RDN_ENABLE_T61_UNICODE_FLAG
2981 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG \
2982 CERT_RDN_ENABLE_UTF8_UNICODE_FLAG
2983 #define CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG \
2984 CERT_RDN_DISABLE_CHECK_TYPE_FLAG
2986 #define CRYPT_DECODE_NOCOPY_FLAG 0x00001
2987 #define CRYPT_DECODE_TO_BE_SIGNED_FLAG 0x00002
2988 #define CRYPT_DECODE_SHARE_OID_STRING_FLAG 0x00004
2989 #define CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
2990 #define CRYPT_DECODE_ALLOC_FLAG 0x08000
2991 #define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \
2992 CERT_RDN_DISABLE_IE4_UTF8_FLAG
2994 #define CERT_STORE_SIGNATURE_FLAG 0x00000001
2995 #define CERT_STORE_TIME_VALIDITY_FLAG 0x00000002
2996 #define CERT_STORE_REVOCATION_FLAG 0x00000004
2997 #define CERT_STORE_NO_CRL_FLAG 0x00010000
2998 #define CERT_STORE_NO_ISSUER_FLAG 0x00020000
3000 #define CERT_STORE_BASE_CRL_FLAG 0x00000100
3001 #define CERT_STORE_DELTA_CRL_FLAG 0x00000200
3003 /* subject types for CryptVerifyCertificateSignatureEx */
3004 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1
3005 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2
3006 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3
3008 /* issuer types for CryptVerifyCertificateSignatureEx */
3009 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1
3010 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2
3011 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3
3012 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4
3014 #define CRYPT_GET_URL_FROM_PROPERTY 0x00000001
3015 #define CRYPT_GET_URL_FROM_EXTENSION 0x00000002
3016 #define CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE 0x00000004
3017 #define CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE 0x00000008
3019 /* Certificate name string types and flags */
3020 #define CERT_SIMPLE_NAME_STR 1
3021 #define CERT_OID_NAME_STR 2
3022 #define CERT_X500_NAME_STR 3
3023 #define CERT_NAME_STR_SEMICOLON_FLAG 0x40000000
3024 #define CERT_NAME_STR_NO_PLUS_FLAG 0x20000000
3025 #define CERT_NAME_STR_NO_QUOTING_FLAG 0x10000000
3026 #define CERT_NAME_STR_CRLF_FLAG 0x08000000
3027 #define CERT_NAME_STR_COMMA_FLAG 0x04000000
3028 #define CERT_NAME_STR_REVERSE_FLAG 0x02000000
3029 #define CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG 0x00040000
3030 #define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 0x00020000
3031 #define CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG 0x00010000
3033 #define CERT_NAME_EMAIL_TYPE 1
3034 #define CERT_NAME_RDN_TYPE 2
3035 #define CERT_NAME_ATTR_TYPE 3
3036 #define CERT_NAME_SIMPLE_DISPLAY_TYPE 4
3037 #define CERT_NAME_FRIENDLY_DISPLAY_TYPE 5
3038 #define CERT_NAME_DNS_TYPE 6
3039 #define CERT_NAME_URL_TYPE 7
3040 #define CERT_NAME_UPN_TYPE 8
3042 #define CERT_NAME_ISSUER_FLAG 0x00000001
3043 #define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000
3045 /* CryptFormatObject flags */
3046 #define CRYPT_FORMAT_STR_MULTI_LINE 0x0001
3047 #define CRYPT_FORMAT_STR_NO_HEX 0x0010
3049 #define CRYPT_FORMAT_SIMPLE 0x0001
3050 #define CRYPT_FORMAT_X509 0x0002
3051 #define CRYPT_FORMAT_OID 0x0004
3052 #define CRYPT_FORMAT_RDN_SEMICOLON 0x0100
3053 #define CRYPT_FORMAT_RDN_CRLF 0x0200
3054 #define CRYPT_FORMAT_RDN_UNQUOTE 0x0400
3055 #define CRYPT_FORMAT_RDN_REVERSE 0x0800
3057 #define CRYPT_FORMAT_COMMA 0x1000
3058 #define CRYPT_FORMAT_SEMICOLON CRYPT_FORMAT_RDN_SEMICOLON
3059 #define CRYPT_FORMAT_CRLF CRYPT_FORMAT_RDN_CRLF
3061 /* CryptQueryObject types and flags */
3062 #define CERT_QUERY_OBJECT_FILE 1
3063 #define CERT_QUERY_OBJECT_BLOB 2
3065 #define CERT_QUERY_CONTENT_CERT 1
3066 #define CERT_QUERY_CONTENT_CTL 2
3067 #define CERT_QUERY_CONTENT_CRL 3
3068 #define CERT_QUERY_CONTENT_SERIALIZED_STORE 4
3069 #define CERT_QUERY_CONTENT_SERIALIZED_CERT 5
3070 #define CERT_QUERY_CONTENT_SERIALIZED_CTL 6
3071 #define CERT_QUERY_CONTENT_SERIALIZED_CRL 7
3072 #define CERT_QUERY_CONTENT_PKCS7_SIGNED 8
3073 #define CERT_QUERY_CONTENT_PKCS7_UNSIGNED 9
3074 #define CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED 10
3075 #define CERT_QUERY_CONTENT_PKCS10 11
3076 #define CERT_QUERY_CONTENT_PFX 12
3077 #define CERT_QUERY_CONTENT_CERT_PAIR 13
3079 #define CERT_QUERY_CONTENT_FLAG_CERT (1 << CERT_QUERY_CONTENT_CERT)
3080 #define CERT_QUERY_CONTENT_FLAG_CTL (1 << CERT_QUERY_CONTENT_CTL)
3081 #define CERT_QUERY_CONTENT_FLAG_CRL (1 << CERT_QUERY_CONTENT_CRL)
3082 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE \
3083 (1 << CERT_QUERY_CONTENT_SERIALIZED_STORE)
3084 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT \
3085 (1 << CERT_QUERY_CONTENT_SERIALIZED_CERT)
3086 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL \
3087 (1 << CERT_QUERY_CONTENT_SERIALIZED_CTL)
3088 #define CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL \
3089 (1 << CERT_QUERY_CONTENT_SERIALIZED_CRL)
3090 #define CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED \
3091 (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED)
3092 #define CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED \
3093 (1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED)
3094 #define CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED \
3095 (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED)
3096 #define CERT_QUERY_CONTENT_FLAG_PKCS10 (1 << CERT_QUERY_CONTENT_PKCS10)
3097 #define CERT_QUERY_CONTENT_FLAG_PFX (1 << CERT_QUERY_CONTENT_PFX)
3098 #define CERT_QUERY_CONTENT_FLAG_CERT_PAIR (1 << CERT_QUERY_CONTENT_CERT_PAIR)
3100 #define CERT_QUERY_CONTENT_FLAG_ALL \
3101 CERT_QUERY_CONTENT_FLAG_CERT | \
3102 CERT_QUERY_CONTENT_FLAG_CTL | \
3103 CERT_QUERY_CONTENT_FLAG_CRL | \
3104 CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \
3105 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \
3106 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | \
3107 CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | \
3108 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \
3109 CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | \
3110 CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | \
3111 CERT_QUERY_CONTENT_FLAG_PKCS10 | \
3112 CERT_QUERY_CONTENT_FLAG_PFX | \
3113 CERT_QUERY_CONTENT_FLAG_CERT_PAIR
3115 #define CERT_QUERY_FORMAT_BINARY 1
3116 #define CERT_QUERY_FORMAT_BASE64_ENCODED 2
3117 #define CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED 3
3119 #define CERT_QUERY_FORMAT_FLAG_BINARY (1 << CERT_QUERY_FORMAT_BINARY)
3120 #define CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED \
3121 (1 << CERT_QUERY_FORMAT_BASE64_ENCODED)
3122 #define CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
3123 (1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
3125 #define CERT_QUERY_FORMAT_FLAG_ALL \
3126 CERT_QUERY_FORMAT_FLAG_BINARY | \
3127 CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | \
3128 CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED \
3130 #define CERT_SET_KEY_PROV_HANDLE_PROP_ID 0x00000001
3131 #define CERT_SET_KEY_CONTEXT_PROP_ID 0x00000001
3133 #define CERT_CREATE_SELFSIGN_NO_SIGN 1
3134 #define CERT_CREATE_SELFSIGN_NO_KEY_INFO 2
3136 /* flags for CryptAcquireCertificatePrivateKey */
3137 #define CRYPT_ACQUIRE_CACHE_FLAG 0x00000001
3138 #define CRYPT_ACQUIRE_USE_PROV_INFO_FLAG 0x00000002
3139 #define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
3140 #define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040
3142 /* Chain engines and chains */
3143 typedef HANDLE HCERTCHAINENGINE;
3144 #define HCCE_CURRENT_USER ((HCERTCHAINENGINE)NULL)
3145 #define HCCE_LOCAL_MACHINE ((HCERTCHAINENGINE)1)
3147 #define CERT_CHAIN_CACHE_END_CERT 0x00000001
3148 #define CERT_CHAIN_THREAD_STORE_SYNC 0x00000002
3149 #define CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL 0x00000004
3150 #define CERT_CHAIN_USE_LOCAL_MACHINE_STORE 0x00000008
3151 #define CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE 0x00000010
3152 #define CERT_CHAIN_ENABLE_SHARE_STORE 0x00000020
3154 typedef struct _CERT_CHAIN_ENGINE_CONFIG
3156 DWORD cbSize;
3157 HCERTSTORE hRestrictedRoot;
3158 HCERTSTORE hRestrictedTrust;
3159 HCERTSTORE hRestrictedOther;
3160 DWORD cAdditionalStore;
3161 HCERTSTORE *rghAdditionalStore;
3162 DWORD dwFlags;
3163 DWORD dwUrlRetrievalTimeout;
3164 DWORD MaximumCachedCertificates;
3165 DWORD CycleDetectionModulus;
3166 } CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
3168 /* message-related definitions */
3170 typedef BOOL (WINAPI *PFN_CMSG_STREAM_OUTPUT)(const void *pvArg, BYTE *pbData,
3171 DWORD cbData, BOOL fFinal);
3173 #define CMSG_INDEFINITE_LENGTH 0xffffffff
3175 typedef struct _CMSG_STREAM_INFO
3177 DWORD cbContent;
3178 PFN_CMSG_STREAM_OUTPUT pfnStreamOutput;
3179 void *pvArg;
3180 } CMSG_STREAM_INFO, *PCMSG_STREAM_INFO;
3182 typedef struct _CERT_ISSUER_SERIAL_NUMBER
3184 CERT_NAME_BLOB Issuer;
3185 CRYPT_INTEGER_BLOB SerialNumber;
3186 } CERT_ISSUER_SERIAL_NUMBER, *PCERT_ISSUER_SERIAL_NUMBER;
3188 typedef struct _CERT_ID
3190 DWORD dwIdChoice;
3191 union {
3192 CERT_ISSUER_SERIAL_NUMBER IssuerSerialNumber;
3193 CRYPT_HASH_BLOB KeyId;
3194 CRYPT_HASH_BLOB HashId;
3195 } DUMMYUNIONNAME;
3196 } CERT_ID, *PCERT_ID;
3198 #define CERT_ID_ISSUER_SERIAL_NUMBER 1
3199 #define CERT_ID_KEY_IDENTIFIER 2
3200 #define CERT_ID_SHA1_HASH 3
3202 #undef CMSG_DATA /* may be defined by sys/socket.h */
3203 #define CMSG_DATA 1
3204 #define CMSG_SIGNED 2
3205 #define CMSG_ENVELOPED 3
3206 #define CMSG_SIGNED_AND_ENVELOPED 4
3207 #define CMSG_HASHED 5
3208 #define CMSG_ENCRYPTED 6
3210 #define CMSG_ALL_FLAGS ~0U
3211 #define CMSG_DATA_FLAG (1 << CMSG_DATA)
3212 #define CMSG_SIGNED_FLAG (1 << CMSG_SIGNED)
3213 #define CMSG_ENVELOPED_FLAG (1 << CMSG_ENVELOPED)
3214 #define CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << CMSG_SIGNED_AND_ENVELOPED)
3215 #define CMSG_ENCRYPTED_FLAG (1 << CMSG_ENCRYPTED)
3217 typedef struct _CMSG_SIGNER_ENCODE_INFO
3219 DWORD cbSize;
3220 PCERT_INFO pCertInfo;
3221 HCRYPTPROV hCryptProv;
3222 DWORD dwKeySpec;
3223 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3224 void *pvHashAuxInfo;
3225 DWORD cAuthAttr;
3226 PCRYPT_ATTRIBUTE rgAuthAttr;
3227 DWORD cUnauthAttr;
3228 PCRYPT_ATTRIBUTE rgUnauthAttr;
3229 #ifdef CMSG_SIGNER_ENCODE_INFO_HAS_CMS_FIELDS
3230 CERT_ID SignerId;
3231 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm;
3232 void *pvHashEncryptionAuxInfo;
3233 #endif
3234 } CMSG_SIGNER_ENCODE_INFO, *PCMSG_SIGNER_ENCODE_INFO;
3236 typedef struct _CMSG_SIGNED_ENCODE_INFO
3238 DWORD cbSize;
3239 DWORD cSigners;
3240 PCMSG_SIGNER_ENCODE_INFO rgSigners;
3241 DWORD cCertEncoded;
3242 PCERT_BLOB rgCertEncoded;
3243 DWORD cCrlEncoded;
3244 PCRL_BLOB rgCrlEncoded;
3245 #ifdef CMSG_SIGNED_ENCODE_INFO_HAS_CMS_FIELDS
3246 DWORD cAttrCertEncoded;
3247 PCERT_BLOB rgAttrCertEncoded;
3248 #endif
3249 } CMSG_SIGNED_ENCODE_INFO, *PCMSG_SIGNED_ENCODE_INFO;
3251 typedef struct _CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO
3253 DWORD cbSize;
3254 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3255 void *pvKeyEncryptionAuxInfo;
3256 HCRYPTPROV_LEGACY hCryptProv;
3257 CRYPT_BIT_BLOB RecipientPublicKey;
3258 CERT_ID RecipientId;
3259 } CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO;
3261 typedef struct _CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO
3263 DWORD cbSize;
3264 CRYPT_BIT_BLOB RecipientPublicKey;
3265 CERT_ID RecipientId;
3266 FILETIME Date;
3267 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3268 } CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO,
3269 *PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO;
3271 typedef struct _CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO
3273 DWORD cbSize;
3274 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3275 void *pvKeyEncryptionAuxInfo;
3276 CRYPT_ALGORITHM_IDENTIFIER KeyWrapAlgorithm;
3277 void *pvKeyWrapAuxInfo;
3278 HCRYPTPROV_LEGACY hCryptProv;
3279 DWORD dwKeySpec;
3280 DWORD dwKeyChoice;
3281 union {
3282 PCRYPT_ALGORITHM_IDENTIFIER pEphemeralAlgorithm;
3283 PCERT_ID pSenderId;
3284 } DUMMYUNIONNAME;
3285 CRYPT_DATA_BLOB UserKeyingMaterial;
3286 DWORD cRecipientEncryptedKeys;
3287 PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO *rgpRecipientEncryptedKeys;
3288 } CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, *PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO;
3290 #define CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE 1
3291 #define CMSG_KEY_AGREE_STATIC_KEY_CHOICE 2
3293 typedef struct _CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO
3295 DWORD cbSize;
3296 CRYPT_ALGORITHM_IDENTIFIER KeyEncryptionAlgorithm;
3297 void *pvKeyEncryptionAuxInfo;
3298 HCRYPTPROV hCryptProv;
3299 DWORD dwKeyChoice;
3300 union {
3301 HCRYPTKEY hKeyEncryptionKey;
3302 void *pvKeyEncryptionKey;
3303 } DUMMYUNIONNAME;
3304 CRYPT_DATA_BLOB KeyId;
3305 FILETIME Date;
3306 PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
3307 } CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, *PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO;
3309 #define CMSG_MAIL_LIST_HANDLE_KEY_CHOICE 1
3311 typedef struct _CMSG_RECIPIENT_ENCODE_INFO
3313 DWORD dwRecipientChoice;
3314 union {
3315 PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO pKeyTrans;
3316 PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO pKeyAgree;
3317 PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO pMailList;
3318 } DUMMYUNIONNAME;
3319 } CMSG_RECIPIENT_ENCODE_INFO, *PCMSG_RECIPIENT_ENCODE_INFO;
3321 #define CMSG_KEY_TRANS_RECIPIENT 1
3322 #define CMSG_KEY_AGREE_RECIPIENT 2
3323 #define CMSG_MAIL_LIST_RECIPIENT 3
3325 typedef struct _CMSG_ENVELOPED_ENCODE_INFO
3327 DWORD cbSize;
3328 HCRYPTPROV_LEGACY hCryptProv;
3329 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3330 void *pvEncryptionAuxInfo;
3331 DWORD cRecipients;
3332 PCERT_INFO *rgpRecipientCert;
3333 #ifdef CMSG_ENVELOPED_ENCODE_INFO_HAS_CMS_FIELDS
3334 PCMSG_RECIPIENT_ENCODE_INFO rgCmsRecipients;
3335 DWORD cCertEncoded;
3336 PCERT_BLOB rgCertEncoded;
3337 DWORD cCrlEncoded;
3338 PCRL_BLOB rgCrlEncoded;
3339 DWORD cAttrCertEncoded;
3340 PCERT_BLOB rgAttrCertEncoded;
3341 DWORD cUnprotectedAttr;
3342 PCRYPT_ATTRIBUTE rgUnprotectedAttr;
3343 #endif
3344 } CMSG_ENVELOPED_ENCODE_INFO, *PCMSG_ENVELOPED_ENCODE_INFO;
3346 typedef struct _CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO
3348 DWORD cbSize;
3349 CMSG_SIGNED_ENCODE_INFO SignedInfo;
3350 CMSG_ENVELOPED_ENCODE_INFO EnvelopedInfo;
3351 } CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO,
3352 *PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO;
3354 typedef struct _CMSG_HASHED_ENCODE_INFO
3356 DWORD cbSize;
3357 HCRYPTPROV_LEGACY hCryptProv;
3358 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm;
3359 void *pvHashAuxInfo;
3360 } CMSG_HASHED_ENCODE_INFO, *PCMSG_HASHED_ENCODE_INFO;
3362 typedef struct _CMSG_ENCRYPTED_ENCODE_INFO
3364 DWORD cbSize;
3365 CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm;
3366 void *pvEncryptionAuxInfo;
3367 } CMSG_ENCRYPTED_ENCODE_INFO, *PCMSG_ENCRYPTED_ENCODE_INFO;
3369 #define CMSG_BARE_CONTENT_FLAG 0x00000001
3370 #define CMSG_LENGTH_ONLY_FLAG 0x00000002
3371 #define CMSG_DETACHED_FLAG 0x00000004
3372 #define CMSG_AUTHENTICATED_ATTRIBUTES_FLAG 0x00000008
3373 #define CMSG_CONTENTS_OCTETS_FLAG 0x00000010
3374 #define CMSG_MAX_LENGTH_FLAG 0x00000020
3375 #define CMSG_CMS_ENCAPSULATED_CONTENT_FLAG 0x00000040
3376 #define CMSG_CRYPT_RELEASE_CONTEXT_FLAG 0x00008000
3378 #define CMSG_CTRL_VERIFY_SIGNATURE 1
3379 #define CMSG_CTRL_DECRYPT 2
3380 #define CMSG_CTRL_VERIFY_HASH 5
3381 #define CMSG_CTRL_ADD_SIGNER 6
3382 #define CMSG_CTRL_DEL_SIGNER 7
3383 #define CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR 8
3384 #define CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR 9
3385 #define CMSG_CTRL_ADD_CERT 10
3386 #define CMSG_CTRL_DEL_CERT 11
3387 #define CMSG_CTRL_ADD_CRL 12
3388 #define CMSG_CTRL_DEL_CRL 13
3389 #define CMSG_CTRL_ADD_ATTR_CERT 14
3390 #define CMSG_CTRL_DEL_ATTR_CERT 15
3391 #define CMSG_CTRL_KEY_TRANS_DECRYPT 16
3392 #define CMSG_CTRL_KEY_AGREE_DECRYPT 17
3393 #define CMSG_CTRL_MAIL_LIST_DECRYPT 18
3394 #define CMSG_CTRL_VERIFY_SIGNATURE_EX 19
3395 #define CMSG_CTRL_ADD_CMS_SIGNER_INFO 20
3397 typedef struct _CMSG_CTRL_DECRYPT_PARA
3399 DWORD cbSize;
3400 HCRYPTPROV hCryptProv;
3401 DWORD dwKeySpec;
3402 DWORD dwRecipientIndex;
3403 } CMSG_CTRL_DECRYPT_PARA, *PCMSG_CTRL_DECRYPT_PARA;
3405 typedef struct _CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA
3407 DWORD cbSize;
3408 DWORD dwSignerIndex;
3409 CRYPT_DATA_BLOB blob;
3410 } CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA,
3411 *PCMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA;
3413 typedef struct _CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA
3415 DWORD cbSize;
3416 DWORD dwSignerIndex;
3417 DWORD dwUnauthAttrIndex;
3418 } CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA,
3419 *PCMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA;
3421 typedef struct _CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA {
3422 DWORD cbSize;
3423 HCRYPTPROV hCryptProv;
3424 DWORD dwSignerIndex;
3425 DWORD dwSignerType;
3426 void *pvSigner;
3427 } CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA, *PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA;
3429 #define CMSG_VERIFY_SIGNER_PUBKEY 1
3430 #define CMSG_VERIFY_SIGNER_CERT 2
3431 #define CMSG_VERIFY_SIGNER_CHAIN 3
3432 #define CMSG_VERIFY_SIGNER_NULL 4
3434 #define CMSG_TYPE_PARAM 1
3435 #define CMSG_CONTENT_PARAM 2
3436 #define CMSG_BARE_CONTENT_PARAM 3
3437 #define CMSG_INNER_CONTENT_TYPE_PARAM 4
3438 #define CMSG_SIGNER_COUNT_PARAM 5
3439 #define CMSG_SIGNER_INFO_PARAM 6
3440 #define CMSG_SIGNER_CERT_INFO_PARAM 7
3441 #define CMSG_SIGNER_HASH_ALGORITHM_PARAM 8
3442 #define CMSG_SIGNER_AUTH_ATTR_PARAM 9
3443 #define CMSG_SIGNER_UNAUTH_ATTR_PARAM 10
3444 #define CMSG_CERT_COUNT_PARAM 11
3445 #define CMSG_CERT_PARAM 12
3446 #define CMSG_CRL_COUNT_PARAM 13
3447 #define CMSG_CRL_PARAM 14
3448 #define CMSG_ENVELOPE_ALGORITHM_PARAM 15
3449 #define CMSG_RECIPIENT_COUNT_PARAM 17
3450 #define CMSG_RECIPIENT_INDEX_PARAM 18
3451 #define CMSG_RECIPIENT_INFO_PARAM 19
3452 #define CMSG_HASH_ALGORITHM_PARAM 20
3453 #define CMSG_HASH_DATA_PARAM 21
3454 #define CMSG_COMPUTED_HASH_PARAM 22
3455 #define CMSG_ENCRYPT_PARAM 26
3456 #define CMSG_ENCRYPTED_DIGEST 27
3457 #define CMSG_ENCODED_SIGNER 28
3458 #define CMSG_ENCODED_MESSAGE 29
3459 #define CMSG_VERSION_PARAM 30
3460 #define CMSG_ATTR_CERT_COUNT_PARAM 31
3461 #define CMSG_ATTR_CERT_PARAM 32
3462 #define CMSG_CMS_RECIPIENT_COUNT_PARAM 33
3463 #define CMSG_CMS_RECIPIENT_INDEX_PARAM 34
3464 #define CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM 35
3465 #define CMSG_CMS_RECIPIENT_INFO_PARAM 36
3466 #define CMSG_UNPROTECTED_ATTR_PARAM 37
3467 #define CMSG_SIGNER_CERT_ID_PARAM 38
3468 #define CMSG_CMS_SIGNER_INFO_PARAM 39
3470 #define CMSG_SIGNED_DATA_V1 1
3471 #define CMSG_SIGNED_DATA_V3 3
3472 #define CMSG_SIGNED_DATA_PKCS_1_5_VERSION CMSG_SIGNED_DATA_V1
3473 #define CMSG_SIGNED_DATA_CMS_VERSION CMSG_SIGNED_DATA_V3
3475 #define CMSG_SIGNER_INFO_V1 1
3476 #define CMSG_SIGNER_INFO_V3 3
3477 #define CMSG_SIGNER_INFO_PKCS_1_5_VERSION CMSG_SIGNER_INFO_V1
3478 #define CMSG_SIGNER_INFO_CMS_VERSION CMSG_SIGNER_INFO_V3
3480 #define CMSG_HASHED_DATA_V0 0
3481 #define CMSG_HASHED_DATA_V2 2
3482 #define CMSG_HASHED_DATA_PKCS_1_5_VERSION CMSG_HASHED_DATA_V0
3483 #define CMSG_HASHED_DATA_CMS_VERSION CMSG_HASHED_DATA_V2
3485 #define CMSG_ENVELOPED_DATA_V0 0
3486 #define CMSG_ENVELOPED_DATA_V2 2
3487 #define CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION CMSG_ENVELOPED_DATA_V0
3488 #define CMSG_ENVELOPED_DATA_CMS_VERSION CMSG_ENVELOPED_DATA_V2
3490 /* CryptMsgGetAndVerifySigner flags */
3491 #define CMSG_TRUSTED_SIGNER_FLAG 0x1
3492 #define CMSG_SIGNER_ONLY_FLAG 0x2
3493 #define CMSG_USE_SIGNER_INDEX_FLAG 0x4
3495 /* CryptMsgSignCTL flags */
3496 #define CMSG_CMS_ENCAPSULATED_CTL_FLAG 0x00008000
3498 /* CryptMsgEncodeAndSignCTL flags */
3499 #define CMSG_ENCODED_SORTED_CTL_FLAG 0x1
3500 #define CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x2
3502 /* function declarations */
3503 /* advapi32.dll */
3504 WINADVAPI BOOL WINAPI CryptAcquireContextA(HCRYPTPROV *, LPCSTR, LPCSTR, DWORD, DWORD);
3505 WINADVAPI BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *, LPCWSTR, LPCWSTR, DWORD, DWORD);
3506 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
3507 WINADVAPI BOOL WINAPI CryptGenRandom (HCRYPTPROV, DWORD, BYTE *);
3508 WINADVAPI BOOL WINAPI CryptContextAddRef (HCRYPTPROV, DWORD *, DWORD);
3509 WINADVAPI BOOL WINAPI CryptCreateHash (HCRYPTPROV, ALG_ID, HCRYPTKEY, DWORD, HCRYPTHASH *);
3510 WINADVAPI BOOL WINAPI CryptDecrypt (HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *);
3511 WINADVAPI BOOL WINAPI CryptDeriveKey (HCRYPTPROV, ALG_ID, HCRYPTHASH, DWORD, HCRYPTKEY *);
3512 WINADVAPI BOOL WINAPI CryptDestroyHash (HCRYPTHASH);
3513 WINADVAPI BOOL WINAPI CryptDestroyKey (HCRYPTKEY);
3514 WINADVAPI BOOL WINAPI CryptDuplicateKey (HCRYPTKEY, DWORD *, DWORD, HCRYPTKEY *);
3515 WINADVAPI BOOL WINAPI CryptDuplicateHash (HCRYPTHASH, DWORD *, DWORD, HCRYPTHASH *);
3516 WINADVAPI BOOL WINAPI CryptEncrypt (HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *, DWORD);
3517 WINADVAPI BOOL WINAPI CryptEnumProvidersA (DWORD, DWORD *, DWORD, DWORD *, LPSTR, DWORD *);
3518 WINADVAPI BOOL WINAPI CryptEnumProvidersW (DWORD, DWORD *, DWORD, DWORD *, LPWSTR, DWORD *);
3519 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
3520 WINADVAPI BOOL WINAPI CryptEnumProviderTypesA (DWORD, DWORD *, DWORD, DWORD *, LPSTR, DWORD *);
3521 WINADVAPI BOOL WINAPI CryptEnumProviderTypesW (DWORD, DWORD *, DWORD, DWORD *, LPWSTR, DWORD *);
3522 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
3523 WINADVAPI BOOL WINAPI CryptExportKey (HCRYPTKEY, HCRYPTKEY, DWORD, DWORD, BYTE *, DWORD *);
3524 WINADVAPI BOOL WINAPI CryptGenKey (HCRYPTPROV, ALG_ID, DWORD, HCRYPTKEY *);
3525 WINADVAPI BOOL WINAPI CryptGetKeyParam (HCRYPTKEY, DWORD, BYTE *, DWORD *, DWORD);
3526 WINADVAPI BOOL WINAPI CryptGetHashParam (HCRYPTHASH, DWORD, BYTE *, DWORD *, DWORD);
3527 WINADVAPI BOOL WINAPI CryptGetProvParam (HCRYPTPROV, DWORD, BYTE *, DWORD *, DWORD);
3528 WINADVAPI BOOL WINAPI CryptGetDefaultProviderA (DWORD, DWORD *, DWORD, LPSTR, DWORD *);
3529 WINADVAPI BOOL WINAPI CryptGetDefaultProviderW (DWORD, DWORD *, DWORD, LPWSTR, DWORD *);
3530 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
3531 WINADVAPI BOOL WINAPI CryptGetUserKey (HCRYPTPROV, DWORD, HCRYPTKEY *);
3532 WINADVAPI BOOL WINAPI CryptHashData (HCRYPTHASH, CONST BYTE *, DWORD, DWORD);
3533 WINADVAPI BOOL WINAPI CryptHashSessionKey (HCRYPTHASH, HCRYPTKEY, DWORD);
3534 WINADVAPI BOOL WINAPI CryptImportKey (HCRYPTPROV, CONST BYTE *, DWORD, HCRYPTKEY, DWORD, HCRYPTKEY *);
3535 WINADVAPI BOOL WINAPI CryptReleaseContext (HCRYPTPROV, ULONG_PTR);
3536 WINADVAPI BOOL WINAPI CryptSetHashParam (HCRYPTHASH, DWORD, CONST BYTE *, DWORD);
3537 WINADVAPI BOOL WINAPI CryptSetKeyParam (HCRYPTKEY, DWORD, CONST BYTE *, DWORD);
3538 WINADVAPI BOOL WINAPI CryptSetProviderA (LPCSTR, DWORD);
3539 WINADVAPI BOOL WINAPI CryptSetProviderW (LPCWSTR, DWORD);
3540 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
3541 WINADVAPI BOOL WINAPI CryptSetProviderExA (LPCSTR, DWORD, DWORD *, DWORD);
3542 WINADVAPI BOOL WINAPI CryptSetProviderExW (LPCWSTR, DWORD, DWORD *, DWORD);
3543 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
3544 WINADVAPI BOOL WINAPI CryptSetProvParam (HCRYPTPROV, DWORD, CONST BYTE *, DWORD);
3545 WINADVAPI BOOL WINAPI CryptSignHashA (HCRYPTHASH, DWORD, LPCSTR, DWORD, BYTE *, DWORD *);
3546 WINADVAPI BOOL WINAPI CryptSignHashW (HCRYPTHASH, DWORD, LPCWSTR, DWORD, BYTE *, DWORD *);
3547 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
3548 WINADVAPI BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH, CONST BYTE *, DWORD, HCRYPTKEY, LPCSTR, DWORD);
3549 WINADVAPI BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH, CONST BYTE *, DWORD, HCRYPTKEY, LPCWSTR, DWORD);
3550 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
3552 /* crypt32.dll functions */
3553 LPVOID WINAPI CryptMemAlloc(ULONG cbSize);
3554 LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize);
3555 VOID WINAPI CryptMemFree(LPVOID pv);
3557 BOOL WINAPI CryptBinaryToStringA(const BYTE *pbBinary,
3558 DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD *pcchString);
3559 BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary,
3560 DWORD cbBinary, DWORD dwFlags, LPWSTR pszString, DWORD *pcchString);
3561 #define CryptBinaryToString WINELIB_NAME_AW(CryptBinaryToString)
3563 BOOL WINAPI CryptStringToBinaryA(LPCSTR pszString,
3564 DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
3565 DWORD *pdwSkip, DWORD *pdwFlags);
3566 BOOL WINAPI CryptStringToBinaryW(LPCWSTR pszString,
3567 DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
3568 DWORD *pdwSkip, DWORD *pdwFlags);
3569 #define CryptStringToBinary WINELIB_NAME_AW(CryptStringToBinary)
3571 BOOL WINAPI CryptCreateAsyncHandle(DWORD dwFlags, PHCRYPTASYNC phAsync);
3572 BOOL WINAPI CryptSetAsyncParam(HCRYPTASYNC hAsync, LPSTR pszParamOid,
3573 LPVOID pvParam, PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree);
3574 BOOL WINAPI CryptGetAsyncParam(HCRYPTASYNC hAsync, LPSTR pszParamOid,
3575 LPVOID *ppvParam, PFN_CRYPT_ASYNC_PARAM_FREE_FUNC *ppfnFree);
3576 BOOL WINAPI CryptCloseAsyncHandle(HCRYPTASYNC hAsync);
3578 BOOL WINAPI CryptRegisterDefaultOIDFunction(DWORD,LPCSTR,DWORD,LPCWSTR);
3579 BOOL WINAPI CryptRegisterOIDFunction(DWORD,LPCSTR,LPCSTR,LPCWSTR,LPCSTR);
3580 BOOL WINAPI CryptGetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
3581 LPCSTR pszOID, LPCWSTR szValueName, DWORD *pdwValueType,
3582 BYTE *pbValueData, DWORD *pcbValueData);
3583 BOOL WINAPI CryptSetOIDFunctionValue(DWORD dwEncodingType, LPCSTR pszFuncName,
3584 LPCSTR pszOID, LPCWSTR pwszValueName, DWORD dwValueType,
3585 const BYTE *pbValueData, DWORD cbValueData);
3586 BOOL WINAPI CryptUnregisterDefaultOIDFunction(DWORD,LPCSTR,LPCWSTR);
3587 BOOL WINAPI CryptUnregisterOIDFunction(DWORD,LPCSTR,LPCSTR);
3588 BOOL WINAPI CryptEnumOIDFunction(DWORD dwEncodingType, LPCSTR pszFuncName,
3589 LPCSTR pszOID, DWORD dwFlags, void *pvArg,
3590 PFN_CRYPT_ENUM_OID_FUNC pfnEnumOIDFunc);
3591 HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR,DWORD);
3592 BOOL WINAPI CryptGetDefaultOIDDllList(HCRYPTOIDFUNCSET hFuncSet,
3593 DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList);
3594 BOOL WINAPI CryptGetDefaultOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
3595 DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr,
3596 HCRYPTOIDFUNCADDR *phFuncAddr);
3597 BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
3598 DWORD dwEncodingType, LPCSTR pszOID, DWORD dwFlags, void **ppvFuncAddr,
3599 HCRYPTOIDFUNCADDR *phFuncAddr);
3600 BOOL WINAPI CryptFreeOIDFunctionAddress(HCRYPTOIDFUNCADDR hFuncAddr,
3601 DWORD dwFlags);
3602 BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule,
3603 DWORD dwEncodingType, LPCSTR pszFuncName, DWORD cFuncEntry,
3604 const CRYPT_OID_FUNC_ENTRY rgFuncEntry[], DWORD dwFlags);
3605 BOOL WINAPI CryptInstallDefaultContext(HCRYPTPROV hCryptProv,
3606 DWORD dwDefaultType, const void *pvDefaultPara, DWORD dwFlags,
3607 void *pvReserved, HCRYPTDEFAULTCONTEXT *phDefaultContext);
3608 BOOL WINAPI CryptUninstallDefaultContext(HCRYPTDEFAULTCONTEXT hDefaultContext,
3609 DWORD dwFlags, void *pvReserved);
3611 BOOL WINAPI CryptEnumOIDInfo(DWORD dwGroupId, DWORD dwFlags, void *pvArg,
3612 PFN_CRYPT_ENUM_OID_INFO pfnEnumOIDInfo);
3613 PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey,
3614 DWORD dwGroupId);
3615 BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO pInfo, DWORD dwFlags);
3616 BOOL WINAPI CryptUnregisterOIDInfo(PCCRYPT_OID_INFO pInfo);
3618 LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId);
3619 DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId);
3621 /* cert store functions */
3622 HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType,
3623 HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara);
3625 HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV_LEGACY hProv,
3626 LPCSTR szSubSystemProtocol);
3627 HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV_LEGACY hProv,
3628 LPCWSTR szSubSystemProtocol);
3629 #define CertOpenSystemStore WINELIB_NAME_AW(CertOpenSystemStore)
3631 PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore,
3632 PCCERT_CONTEXT pPrev);
3634 PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore,
3635 PCCRL_CONTEXT pPrev);
3637 PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore,
3638 PCCTL_CONTEXT pPrev);
3640 BOOL WINAPI CertEnumSystemStoreLocation(DWORD dwFlags, void *pvArg,
3641 PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum);
3643 BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara,
3644 void *pvArg, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum);
3646 BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags,
3647 void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum);
3649 BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
3650 DWORD dwSaveAs, DWORD dwSaveTo, void* pvSaveToPara, DWORD dwFlags);
3652 BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore,
3653 HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority);
3655 void WINAPI CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore,
3656 HCERTSTORE hSiblingStore);
3658 BOOL WINAPI CertCreateCertificateChainEngine(PCERT_CHAIN_ENGINE_CONFIG pConfig,
3659 HCERTCHAINENGINE *phChainEngine);
3661 BOOL WINAPI CertResyncCertificateChainEngine(HCERTCHAINENGINE hChainEngine);
3663 VOID WINAPI CertFreeCertificateChainEngine(HCERTCHAINENGINE hChainEngine);
3665 BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
3666 PCCERT_CONTEXT pCertContext, LPFILETIME pTime, HCERTSTORE hAdditionalStore,
3667 PCERT_CHAIN_PARA pChainPara, DWORD dwFlags, LPVOID pvReserved,
3668 PCCERT_CHAIN_CONTEXT *ppChainContext);
3670 PCCERT_CHAIN_CONTEXT WINAPI CertDuplicateCertificateChain(
3671 PCCERT_CHAIN_CONTEXT pChainContext);
3673 VOID WINAPI CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT pChainContext);
3675 PCCERT_CHAIN_CONTEXT WINAPI CertFindChainInStore(HCERTSTORE hCertStore,
3676 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3677 const void *pvFindPara, PCCERT_CHAIN_CONTEXT pPrevChainContext);
3679 BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID,
3680 PCCERT_CHAIN_CONTEXT pChainContext, PCERT_CHAIN_POLICY_PARA pPolicyPara,
3681 PCERT_CHAIN_POLICY_STATUS pPolicyStatus);
3683 DWORD WINAPI CertEnumCertificateContextProperties(PCCERT_CONTEXT pCertContext,
3684 DWORD dwPropId);
3686 BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
3687 DWORD dwPropId, void *pvData, DWORD *pcbData);
3689 BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
3690 DWORD dwPropId, DWORD dwFlags, const void *pvData);
3692 DWORD WINAPI CertEnumCRLContextProperties(PCCRL_CONTEXT pCRLContext,
3693 DWORD dwPropId);
3695 BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
3696 DWORD dwPropId, void *pvData, DWORD *pcbData);
3698 BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
3699 DWORD dwPropId, DWORD dwFlags, const void *pvData);
3701 DWORD WINAPI CertEnumCTLContextProperties(PCCTL_CONTEXT pCTLContext,
3702 DWORD dwPropId);
3704 BOOL WINAPI CertEnumSubjectInSortedCTL(PCCTL_CONTEXT pCTLContext,
3705 void **ppvNextSubject, PCRYPT_DER_BLOB pSubjectIdentifier,
3706 PCRYPT_DER_BLOB pEncodedAttributes);
3708 BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
3709 DWORD dwPropId, void *pvData, DWORD *pcbData);
3711 BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext,
3712 DWORD dwPropId, DWORD dwFlags, const void *pvData);
3714 BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
3715 void *pvData, DWORD *pcbData);
3717 BOOL WINAPI CertSetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
3718 DWORD dwFlags, const void *pvData);
3720 BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
3721 DWORD dwCtrlType, void const *pvCtrlPara);
3723 HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore);
3725 BOOL WINAPI CertCloseStore( HCERTSTORE hCertStore, DWORD dwFlags );
3727 BOOL WINAPI CertFreeCertificateContext( PCCERT_CONTEXT pCertContext );
3729 BOOL WINAPI CertFreeCRLContext( PCCRL_CONTEXT pCrlContext );
3731 BOOL WINAPI CertFreeCTLContext( PCCTL_CONTEXT pCtlContext );
3733 BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore,
3734 PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
3735 PCCERT_CONTEXT *ppStoreContext);
3737 BOOL WINAPI CertAddCRLContextToStore( HCERTSTORE hCertStore,
3738 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
3739 PCCRL_CONTEXT *ppStoreContext );
3741 BOOL WINAPI CertAddCTLContextToStore( HCERTSTORE hCertStore,
3742 PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
3743 PCCTL_CONTEXT *ppStoreContext );
3745 BOOL WINAPI CertAddCertificateLinkToStore(HCERTSTORE hCertStore,
3746 PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition,
3747 PCCERT_CONTEXT *ppStoreContext);
3749 BOOL WINAPI CertAddCRLLinkToStore(HCERTSTORE hCertStore,
3750 PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition,
3751 PCCRL_CONTEXT *ppStoreContext);
3753 BOOL WINAPI CertAddCTLLinkToStore(HCERTSTORE hCertStore,
3754 PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition,
3755 PCCTL_CONTEXT *ppStoreContext);
3757 BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore,
3758 DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded,
3759 DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext);
3761 BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore,
3762 DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded,
3763 DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext);
3765 BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore,
3766 DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded,
3767 DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext);
3769 BOOL WINAPI CertAddSerializedElementToStore(HCERTSTORE hCertStore,
3770 const BYTE *pbElement, DWORD cbElement, DWORD dwAddDisposition, DWORD dwFlags,
3771 DWORD dwContextTypeFlags, DWORD *pdwContentType, const void **ppvContext);
3773 BOOL WINAPI CertCompareCertificate(DWORD dwCertEncodingType,
3774 PCERT_INFO pCertId1, PCERT_INFO pCertId2);
3775 BOOL WINAPI CertCompareCertificateName(DWORD dwCertEncodingType,
3776 PCERT_NAME_BLOB pCertName1, PCERT_NAME_BLOB pCertName2);
3777 BOOL WINAPI CertCompareIntegerBlob(PCRYPT_INTEGER_BLOB pInt1,
3778 PCRYPT_INTEGER_BLOB pInt2);
3779 BOOL WINAPI CertComparePublicKeyInfo(DWORD dwCertEncodingType,
3780 PCERT_PUBLIC_KEY_INFO pPublicKey1, PCERT_PUBLIC_KEY_INFO pPublicKey2);
3781 DWORD WINAPI CertGetPublicKeyLength(DWORD dwCertEncodingType,
3782 PCERT_PUBLIC_KEY_INFO pPublicKey);
3784 const void *CertCreateContext(DWORD dwContextType, DWORD dwEncodingType,
3785 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
3786 PCERT_CREATE_CONTEXT_PARA pCreatePara);
3788 PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
3789 const BYTE *pbCertEncoded, DWORD cbCertEncoded);
3791 PCCRL_CONTEXT WINAPI CertCreateCRLContext( DWORD dwCertEncodingType,
3792 const BYTE* pbCrlEncoded, DWORD cbCrlEncoded);
3794 PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType,
3795 const BYTE *pbCtlEncoded, DWORD cbCtlEncoded);
3797 PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hProv,
3798 PCERT_NAME_BLOB pSubjectIssuerBlob, DWORD dwFlags,
3799 PCRYPT_KEY_PROV_INFO pKeyProvInfo,
3800 PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, PSYSTEMTIME pStartTime,
3801 PSYSTEMTIME pEndTime, PCERT_EXTENSIONS pExtensions);
3803 BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext);
3805 BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext);
3807 BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext);
3809 PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(
3810 PCCERT_CONTEXT pCertContext);
3812 PCCRL_CONTEXT WINAPI CertDuplicateCRLContext(PCCRL_CONTEXT pCrlContext);
3814 PCCTL_CONTEXT WINAPI CertDuplicateCTLContext(PCCTL_CONTEXT pCtlContext);
3816 PCCERT_CONTEXT WINAPI CertFindCertificateInStore( HCERTSTORE hCertStore,
3817 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3818 const void *pvFindPara, PCCERT_CONTEXT pPrevCertContext );
3820 PCCRL_CONTEXT WINAPI CertFindCRLInStore(HCERTSTORE hCertStore,
3821 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3822 const void *pvFindPara, PCCRL_CONTEXT pPrevCrlContext);
3824 PCCTL_CONTEXT WINAPI CertFindCTLInStore(HCERTSTORE hCertStore,
3825 DWORD dwCertEncodingType, DWORD dwFindFlags, DWORD dwFindType,
3826 const void *pvFindPara, PCCTL_CONTEXT pPrevCtlContext);
3828 PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE hCertStore,
3829 PCCERT_CONTEXT pSubjectContext, PCCERT_CONTEXT pPrevIssuerContext,
3830 DWORD *pdwFlags);
3832 PCCERT_CONTEXT WINAPI CertGetSubjectCertificateFromStore(HCERTSTORE hCertStore,
3833 DWORD dwCertEncodingType, PCERT_INFO pCertId);
3835 PCCRL_CONTEXT WINAPI CertGetCRLFromStore(HCERTSTORE hCertStore,
3836 PCCERT_CONTEXT pIssuerContext, PCCRL_CONTEXT pPrevCrlContext, DWORD *pdwFlags);
3838 BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
3839 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
3841 BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext,
3842 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
3844 BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext,
3845 DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
3847 BOOL WINAPI CertGetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext, DWORD dwFlags,
3848 PCERT_ENHKEY_USAGE pUsage, DWORD *pcbUsage);
3849 BOOL WINAPI CertSetEnhancedKeyUsage(PCCERT_CONTEXT pCertContext,
3850 PCERT_ENHKEY_USAGE pUsage);
3851 BOOL WINAPI CertAddEnhancedKeyUsageIdentifier(PCCERT_CONTEXT pCertContext,
3852 LPCSTR pszUsageIdentifer);
3853 BOOL WINAPI CertRemoveEnhancedKeyUsageIdentifier(PCCERT_CONTEXT pCertContext,
3854 LPCSTR pszUsageIdentifer);
3855 BOOL WINAPI CertGetValidUsages(DWORD cCerts, PCCERT_CONTEXT *rghCerts,
3856 int *cNumOIDs, LPSTR *rghOIDs, DWORD *pcbOIDs);
3858 BOOL WINAPI CryptEncodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3859 const void *pvStructInfo, BYTE *pbEncoded, DWORD *pcbEncoded);
3860 BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3861 const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara,
3862 void *pvEncoded, DWORD *pcbEncoded);
3864 BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3865 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo,
3866 DWORD *pcbStructInfo);
3867 BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
3868 const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
3869 PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo);
3871 BOOL WINAPI CryptFormatObject(DWORD dwCertEncodingType, DWORD dwFormatType,
3872 DWORD dwFormatStrType, void *pFormatStruct, LPCSTR lpszStructType,
3873 const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, DWORD *pcbFormat);
3875 BOOL WINAPI CryptHashCertificate(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid,
3876 DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
3877 DWORD *pcbComputedHash);
3879 BOOL WINAPI CryptHashPublicKeyInfo(HCRYPTPROV_LEGACY hCryptProv, ALG_ID Algid,
3880 DWORD dwFlags, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo,
3881 BYTE *pbComputedHash, DWORD *pcbComputedHash);
3883 BOOL WINAPI CryptHashToBeSigned(HCRYPTPROV_LEGACY hCryptProv, DWORD dwCertEncodingType,
3884 const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash,
3885 DWORD *pcbComputedHash);
3887 BOOL WINAPI CryptQueryObject(DWORD dwObjectType, const void* pvObject,
3888 DWORD dwExpectedContentTypeFlags, DWORD dwExpectedFormatTypeFlags,
3889 DWORD dwFlags, DWORD* pdwMsgAndCertEncodingType, DWORD* pdwContentType,
3890 DWORD* pdwFormatType, HCERTSTORE* phCertStore, HCRYPTMSG* phMsg,
3891 const void** ppvContext);
3893 BOOL WINAPI CryptSignCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
3894 DWORD dwCertEncodingType, const BYTE *pbEncodedToBeSigned,
3895 DWORD cbEncodedToBeSigned, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
3896 const void *pvHashAuxInfo, BYTE *pbSignature, DWORD *pcbSignature);
3898 BOOL WINAPI CryptSignAndEncodeCertificate(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv,
3899 DWORD dwKeySpec, DWORD dwCertEncodingType, LPCSTR lpszStructType,
3900 const void *pvStructInfo, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
3901 const void *pvHashAuxInfo, BYTE *pbEncoded, DWORD *pcbEncoded);
3903 BOOL WINAPI CryptVerifyCertificateSignature(HCRYPTPROV_LEGACY hCryptProv,
3904 DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded,
3905 PCERT_PUBLIC_KEY_INFO pPublicKey);
3907 BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV_LEGACY hCryptProv,
3908 DWORD dwCertEncodingType, DWORD dwSubjectType, void *pvSubject,
3909 DWORD dwIssuerType, void *pvIssuer, DWORD dwFlags, void *pvReserved);
3911 PCRYPT_ATTRIBUTE WINAPI CertFindAttribute(LPCSTR pszObjId, DWORD cAttr,
3912 CRYPT_ATTRIBUTE rgAttr[]);
3913 PCERT_EXTENSION WINAPI CertFindExtension(LPCSTR pszObjId, DWORD cExtensions,
3914 CERT_EXTENSION rgExtensions[]);
3915 PCERT_RDN_ATTR WINAPI CertFindRDNAttr(LPCSTR pszObjId, PCERT_NAME_INFO pName);
3917 BOOL WINAPI CertFindSubjectInSortedCTL(PCRYPT_DATA_BLOB pSubjectIdentifier,
3918 PCCTL_CONTEXT pCtlContext, DWORD dwFlags, void *pvReserved,
3919 PCRYPT_DER_BLOB pEncodedAttributes);
3921 BOOL WINAPI CertIsRDNAttrsInCertificateName(DWORD dwCertEncodingType,
3922 DWORD dwFlags, PCERT_NAME_BLOB pCertName, PCERT_RDN pRDN);
3924 BOOL WINAPI CertIsValidCRLForCertificate(PCCERT_CONTEXT pCert,
3925 PCCRL_CONTEXT pCrl, DWORD dwFlags, void *pvReserved);
3926 BOOL WINAPI CertFindCertificateInCRL(PCCERT_CONTEXT pCert,
3927 PCCRL_CONTEXT pCrlContext, DWORD dwFlags, void *pvReserved,
3928 PCRL_ENTRY *ppCrlEntry);
3929 BOOL WINAPI CertVerifyCRLRevocation(DWORD dwCertEncodingType,
3930 PCERT_INFO pCertId, DWORD cCrlInfo, PCRL_INFO rgpCrlInfo[]);
3932 BOOL WINAPI CertVerifySubjectCertificateContext(PCCERT_CONTEXT pSubject,
3933 PCCERT_CONTEXT pIssuer, DWORD *pdwFlags);
3935 LONG WINAPI CertVerifyCRLTimeValidity(LPFILETIME pTimeToVerify,
3936 PCRL_INFO pCrlInfo);
3937 LONG WINAPI CertVerifyTimeValidity(LPFILETIME pTimeToVerify,
3938 PCERT_INFO pCertInfo);
3939 BOOL WINAPI CertVerifyValidityNesting(PCERT_INFO pSubjectInfo,
3940 PCERT_INFO pIssuerInfo);
3942 BOOL WINAPI CertVerifyCTLUsage(DWORD dwEncodingType, DWORD dwSubjectType,
3943 void *pvSubject, PCTL_USAGE pSubjectUsage, DWORD dwFlags,
3944 PCTL_VERIFY_USAGE_PARA pVerifyUsagePara,
3945 PCTL_VERIFY_USAGE_STATUS pVerifyUsageStatus);
3947 BOOL WINAPI CertVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType,
3948 DWORD cContext, PVOID rgpvContext[], DWORD dwFlags,
3949 PCERT_REVOCATION_PARA pRevPara, PCERT_REVOCATION_STATUS pRevStatus);
3951 BOOL WINAPI CryptExportPublicKeyInfo(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
3952 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
3953 BOOL WINAPI CryptExportPublicKeyInfoEx(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProv, DWORD dwKeySpec,
3954 DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags,
3955 void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
3956 BOOL WINAPI CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv,
3957 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, HCRYPTKEY *phKey);
3958 BOOL WINAPI CryptImportPublicKeyInfoEx(HCRYPTPROV hCryptProv,
3959 DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg,
3960 DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey);
3962 BOOL WINAPI CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT pCert,
3963 DWORD dwFlags, void *pvReserved, HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProv, DWORD *pdwKeySpec,
3964 BOOL *pfCallerFreeProv);
3966 BOOL WINAPI CryptProtectData( DATA_BLOB* pDataIn, LPCWSTR szDataDescr,
3967 DATA_BLOB* pOptionalEntropy, PVOID pvReserved,
3968 CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
3970 BOOL WINAPI CryptUnprotectData( DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr,
3971 DATA_BLOB* pOptionalEntropy, PVOID pvReserved,
3972 CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
3974 DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType,
3975 DWORD dwFlags, void *pvTypePara, LPSTR pszNameString, DWORD cchNameString);
3976 DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType,
3977 DWORD dwFlags, void *pvTypePara, LPWSTR pszNameString, DWORD cchNameString);
3978 #define CertGetNameString WINELIB_NAME_AW(CertGetNameString)
3980 DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
3981 LPSTR psz, DWORD csz);
3982 DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
3983 LPWSTR psz, DWORD csz);
3984 #define CertRDNValueToStr WINELIB_NAME_AW(CertRDNValueToStr)
3986 DWORD WINAPI CertNameToStrA(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName,
3987 DWORD dwStrType, LPSTR psz, DWORD csz);
3988 DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName,
3989 DWORD dwStrType, LPWSTR psz, DWORD csz);
3990 #define CertNameToStr WINELIB_NAME_AW(CertNameToStr)
3992 BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
3993 DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded,
3994 LPCSTR *ppszError);
3995 BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
3996 DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded,
3997 LPCWSTR *ppszError);
3998 #define CertStrToName WINELIB_NAME_AW(CertStrToName)
4000 DWORD WINAPI CryptMsgCalculateEncodedLength(DWORD dwMsgEncodingType,
4001 DWORD dwFlags, DWORD dwMsgType, const void *pvMsgEncodeInfo,
4002 LPSTR pszInnerContentObjID, DWORD cbData);
4004 BOOL WINAPI CryptMsgClose(HCRYPTMSG hCryptMsg);
4006 BOOL WINAPI CryptMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags,
4007 DWORD dwCtrlType, const void *pvCtrlPara);
4009 BOOL WINAPI CryptMsgCountersign(HCRYPTMSG hCryptMsg, DWORD dwIndex,
4010 DWORD dwCountersigners, PCMSG_SIGNER_ENCODE_INFO rgCountersigners);
4012 BOOL WINAPI CryptMsgCountersignEncoded(DWORD dwEncodingType, PBYTE pbSignerInfo,
4013 DWORD cbSignerInfo, DWORD cCountersigners,
4014 PCMSG_SIGNER_ENCODE_INFO rgCountersigners, PBYTE pbCountersignature,
4015 PDWORD pcbCountersignature);
4017 HCRYPTMSG WINAPI CryptMsgDuplicate(HCRYPTMSG hCryptMsg);
4019 BOOL WINAPI CryptMsgEncodeAndSignCTL(DWORD dwMsgEncodingType,
4020 PCTL_INFO pCtlInfo, PCMSG_SIGNED_ENCODE_INFO pSignInfo, DWORD dwFlags,
4021 BYTE *pbEncoded, DWORD *pcbEncoded);
4023 BOOL WINAPI CryptMsgGetAndVerifySigner(HCRYPTMSG hCryptMsg, DWORD cSignerStore,
4024 HCERTSTORE *rghSignerStore, DWORD dwFlags, PCCERT_CONTEXT *ppSigner,
4025 DWORD *pdwSignerIndex);
4027 BOOL WINAPI CryptMsgGetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
4028 DWORD dwIndex, void *pvData, DWORD *pcbData);
4030 HCRYPTMSG WINAPI CryptMsgOpenToDecode(DWORD dwMsgEncodingType, DWORD dwFlags,
4031 DWORD dwMsgType, HCRYPTPROV_LEGACY hCryptProv, PCERT_INFO pRecipientInfo,
4032 PCMSG_STREAM_INFO pStreamInfo);
4034 HCRYPTMSG WINAPI CryptMsgOpenToEncode(DWORD dwMsgEncodingType, DWORD dwFlags,
4035 DWORD dwMsgType, const void *pvMsgEncodeInfo, LPSTR pszInnerContentObjID,
4036 PCMSG_STREAM_INFO pStreamInfo);
4038 BOOL WINAPI CryptMsgSignCTL(DWORD dwMsgEncodingType, BYTE *pbCtlContent,
4039 DWORD cbCtlContent, PCMSG_SIGNED_ENCODE_INFO pSignInfo, DWORD dwFlags,
4040 BYTE *pbEncoded, DWORD *pcbEncoded);
4042 BOOL WINAPI CryptMsgUpdate(HCRYPTMSG hCryptMsg, const BYTE *pbData,
4043 DWORD cbData, BOOL fFinal);
4045 BOOL WINAPI CryptMsgVerifyCountersignatureEncoded(HCRYPTPROV_LEGACY hCryptProv,
4046 DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo,
4047 PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature,
4048 PCERT_INFO pciCountersigner);
4050 BOOL WINAPI CryptMsgVerifyCountersignatureEncodedEx(HCRYPTPROV_LEGACY hCryptProv,
4051 DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo,
4052 PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature,
4053 DWORD dwSignerType, void *pvSigner, DWORD dwFlags, void *pvReserved);
4055 BOOL WINAPI CryptSignMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara,
4056 BOOL fDetachedSignature, DWORD cToBeSigned, const BYTE *rgpbToBeSigned[],
4057 DWORD rgcbToBeSigned[], BYTE *pbSignedBlob, DWORD *pcbSignedBlob);
4058 BOOL WINAPI CryptSignMessageWithKey(PCRYPT_KEY_SIGN_MESSAGE_PARA pSignPara,
4059 const BYTE *pbToBeSigned, DWORD cbToBeSigned, BYTE *pbSignedBlob,
4060 DWORD *pcbSignedBlob);
4062 BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
4063 DWORD dwSignerIndex, const BYTE* pbSignedBlob, DWORD cbSignedBlob,
4064 BYTE* pbDecoded, DWORD* pcbDecoded, PCCERT_CONTEXT* ppSignerCert);
4065 BOOL WINAPI CryptVerifyMessageSignatureWithKey(
4066 PCRYPT_KEY_VERIFY_MESSAGE_PARA pVerifyPara,
4067 PCERT_PUBLIC_KEY_INFO pPublicKeyInfo, const BYTE *pbSignedBlob,
4068 DWORD cbSignedBlob, BYTE *pbDecoded, DWORD *pcbDecoded);
4070 BOOL WINAPI CryptVerifyDetachedMessageSignature(
4071 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4072 const BYTE *pbDetachedSignBlob, DWORD cbDetachedSignBlob, DWORD cToBeSigned,
4073 const BYTE *rgpbToBeSigned[], DWORD rgcbToBeSigned[],
4074 PCCERT_CONTEXT *ppSignerCert);
4075 LONG WINAPI CryptGetMessageSignerCount(DWORD dwMsgEncodingType,
4076 const BYTE *pbSignedBlob, DWORD cbSignedBlob);
4078 BOOL WINAPI CryptEncryptMessage(PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara,
4079 DWORD cRecipientCert, PCCERT_CONTEXT rgpRecipientCert[],
4080 const BYTE *pbToBeEncrypted, DWORD cbToBeEncrypted, BYTE *pbEncryptedBlob,
4081 DWORD *pcbEncryptedBlob);
4082 BOOL WINAPI CryptDecryptMessage(PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4083 const BYTE *pbEncryptedBlob, DWORD cbEncryptedBlob, BYTE *pbDecrypted,
4084 DWORD *pcbDecrypted, PCCERT_CONTEXT *ppXchgCert);
4086 BOOL WINAPI CryptSignAndEncryptMessage(PCRYPT_SIGN_MESSAGE_PARA pSignPara,
4087 PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptPara, DWORD cRecipientCert,
4088 PCCERT_CONTEXT rgpRecipientCert[], const BYTE *pbToBeSignedAndEncrypted,
4089 DWORD cbToBeSignedAndEncrypted, BYTE *pbSignedAndEncryptedBlob,
4090 DWORD *pcbSignedAndEncryptedBlob);
4091 BOOL WINAPI CryptDecryptAndVerifyMessageSignature(
4092 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4093 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4094 const BYTE *pbEncryptedBlob, DWORD cbEncryptedBlob, BYTE *pbDecrypted,
4095 DWORD *pcbDecrypted, PCCERT_CONTEXT *ppXchgCert, PCCERT_CONTEXT *ppSignerCert);
4097 HCERTSTORE WINAPI CryptGetMessageCertificates(DWORD dwMsgAndCertEncodingType,
4098 HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const BYTE *pbSignedBlob,
4099 DWORD cbSignedBlob);
4101 BOOL WINAPI CryptDecodeMessage(DWORD dwMsgTypeFlags,
4102 PCRYPT_DECRYPT_MESSAGE_PARA pDecryptPara,
4103 PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, DWORD dwSignerIndex,
4104 const BYTE *pbEncodedBlob, DWORD cbEncodedBlob, DWORD dwPrevInnerContentType,
4105 DWORD *pdwMsgType, DWORD *pdwInnerContentType, BYTE *pbDecoded,
4106 DWORD *pcbDecoded, PCCERT_CONTEXT *ppXchgCert, PCCERT_CONTEXT *ppSignerCert);
4108 BOOL WINAPI CryptHashMessage(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4109 BOOL fDetachedHash, DWORD cToBeHashed, const BYTE *rgpbToBeHashed[],
4110 DWORD rgcbToBeHashed[], BYTE *pbHashedBlob, DWORD *pcbHashedBlob,
4111 BYTE *pbComputedHash, DWORD *pcbComputedHash);
4112 BOOL WINAPI CryptVerifyMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4113 BYTE *pbHashedBlob, DWORD cbHashedBlob, BYTE *pbToBeHashed,
4114 DWORD *pcbToBeHashed, BYTE *pbComputedHash, DWORD *pcbComputedHash);
4115 BOOL WINAPI CryptVerifyDetachedMessageHash(PCRYPT_HASH_MESSAGE_PARA pHashPara,
4116 BYTE *pbDetachedHashBlob, DWORD cbDetachedHashBlob, DWORD cToBeHashed,
4117 const BYTE *rgpbToBeHashed[], DWORD rgcbToBeHashed[], BYTE *pbComputedHash,
4118 DWORD *pcbComputedHash);
4120 /* cryptnet.dll functions */
4121 BOOL WINAPI CryptCancelAsyncRetrieval(HCRYPTASYNC hAsyncRetrieval);
4123 BOOL WINAPI CryptGetObjectUrl(LPCSTR pszUrlOid, LPVOID pvPara, DWORD dwFlags,
4124 PCRYPT_URL_ARRAY pUrlArray, DWORD *pcbUrlArray, PCRYPT_URL_INFO pUrlInfo,
4125 DWORD *pcbUrlInfo, LPVOID pvReserved);
4127 BOOL WINAPI CryptGetTimeValidObject(LPCSTR pszTimeValidOid, void *pvPara,
4128 PCCERT_CONTEXT pIssuer, LPFILETIME pftValidFor, DWORD dwFlags, DWORD dwTimeout,
4129 void **ppvObject, PCRYPT_CREDENTIALS pCredentials, void *pvReserved);
4131 BOOL WINAPI CryptFlushTimeValidObject(LPCSTR pszFlushTimeValidOid, void *pvPara,
4132 PCCERT_CONTEXT pIssuer, DWORD dwFlags, void *pvReserved);
4134 BOOL WINAPI CryptInstallCancelRetrieval(PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel,
4135 const void *pvArg, DWORD dwFlags, void *pvReserved);
4137 BOOL WINAPI CryptUninstallCancelRetrieval(DWORD dwFlags, void *pvReserved);
4139 BOOL WINAPI CryptRetrieveObjectByUrlA(LPCSTR pszURL, LPCSTR pszObjectOid,
4140 DWORD dwRetrievalFlags, DWORD dwTimeout, LPVOID *ppvObject,
4141 HCRYPTASYNC hAsyncRetrieve, PCRYPT_CREDENTIALS pCredentials, LPVOID pvVerify,
4142 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
4143 BOOL WINAPI CryptRetrieveObjectByUrlW(LPCWSTR pszURL, LPCSTR pszObjectOid,
4144 DWORD dwRetrievalFlags, DWORD dwTimeout, LPVOID *ppvObject,
4145 HCRYPTASYNC hAsyncRetrieve, PCRYPT_CREDENTIALS pCredentials, LPVOID pvVerify,
4146 PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
4147 #define CryptRetrieveObjectByUrl WINELIB_NAME_AW(CryptRetrieveObjectByUrl)
4149 #ifdef __cplusplus
4151 #endif
4153 #endif