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