4 #pragma GCC system_header
14 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
15 #define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
16 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
17 #define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
18 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
19 #define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
20 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
21 #define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
22 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
23 #define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
24 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
25 #define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
26 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
27 #define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
28 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
29 #define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
30 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
31 #define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
32 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Crypto Provider"
33 #define MS_SCARD_PROV_W L"Microsoft Base Smart Card Crypto Provider"
34 #if (_WIN32_WINNT == 0x0501)
35 #define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"
36 #define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"
37 #elif (_WIN32_WINNT > 0x0501)
38 #define MS_ENH_RSA_AES_PROV_A "Microsoft Enhanced RSA and AES Cryptographic Provider"
39 #define MS_ENH_RSA_AES_PROV_W L"Microsoft Enhanced RSA and AES Cryptographic Provider"
42 #define GET_ALG_CLASS(x) (x&57344)
43 #define GET_ALG_TYPE(x) (x&7680)
44 #define GET_ALG_SID(x) (x&511)
45 #define ALG_CLASS_ANY 0
46 #define ALG_CLASS_SIGNATURE 8192
47 #define ALG_CLASS_MSG_ENCRYPT 16384
48 #define ALG_CLASS_DATA_ENCRYPT 24576
49 #define ALG_CLASS_HASH 32768
50 #define ALG_CLASS_KEY_EXCHANGE 40960
51 #define ALG_CLASS_ALL 57344 /* (7 << 13) */
52 #define ALG_TYPE_ANY 0
53 #define ALG_TYPE_DSS 512
54 #define ALG_TYPE_RSA 1024
55 #define ALG_TYPE_BLOCK 1536
56 #define ALG_TYPE_STREAM 2048
57 #define ALG_TYPE_DH 2560 /* (5 << 9) */
58 #define ALG_TYPE_SECURECHANNEL 3072 /* (6 << 9) */
60 #define ALG_SID_RSA_ANY 0
61 #define ALG_SID_RSA_PKCS 1
62 #define ALG_SID_RSA_MSATWORK 2
63 #define ALG_SID_RSA_ENTRUST 3
64 #define ALG_SID_RSA_PGP 4
65 #define ALG_SID_DSS_ANY 0
66 #define ALG_SID_DSS_PKCS 1
67 #define ALG_SID_DSS_DMS 2
69 #define ALG_SID_3DES 3
70 #define ALG_SID_DESX 4
71 #define ALG_SID_IDEA 5
72 #define ALG_SID_CAST 6
73 #define ALG_SID_SAFERSK64 7
74 #define ALG_SID_SAFERSK128 8
75 #define ALG_SID_3DES_112 9
76 #define ALG_SID_SKIPJACK 10
77 #define ALG_SID_TEK 11
78 #define ALG_SID_CYLINK_MEK 12
79 #define ALG_SID_RC5 13
82 #define ALG_SID_SEAL 2
88 #define ALG_SID_RIPEMD 6
89 #define ALG_SID_RIPEMD160 7
90 #define ALG_SID_SSL3SHAMD5 8
91 #define ALG_SID_HMAC 9
92 #define ALG_SID_TLS1PRF 10
93 #define ALG_SID_AES_128 14
94 #define ALG_SID_AES_192 15
95 #define ALG_SID_AES_256 16
96 #define ALG_SID_AES 17
97 #define ALG_SID_EXAMPLE 80
99 #define CALG_MD2 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD2)
100 #define CALG_MD4 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD4)
101 #define CALG_MD5 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD5)
102 #define CALG_SHA (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_SHA)
103 #define CALG_SHA1 CALG_SHA
104 #define CALG_MAC (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MAC)
105 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|3)
106 #define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|12)
107 #define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|10)
108 #define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_STREAM|ALG_TYPE_DSS|4)
109 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE|ALG_TYPE_RSA|ALG_SID_RSA_ANY)
110 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE|ALG_TYPE_DSS|ALG_SID_DSS_ANY)
111 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA_ANY)
112 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DES)
113 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC2)
114 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_RC4)
115 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_SEAL)
116 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_STREAM|ALG_TYPE_DSS|ALG_SID_DSS_DMS)
117 #define CALG_DESX (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX)
118 #define CALG_TLS1PRF (ALG_CLASS_DHASH|ALG_TYPE_ANY|ALG_SID_TLS1PRF)
119 #define CALG_AES_128 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128)
120 #define CALG_AES_192 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_192)
121 #define CALG_AES_256 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_256)
122 #define CALG_AES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES)
124 #define CRYPT_VERIFYCONTEXT 0xF0000000
125 #define CRYPT_NEWKEYSET 8
126 #define CRYPT_DELETEKEYSET 16
127 #define CRYPT_MACHINE_KEYSET 32
128 #define CRYPT_SILENT 64
129 #define CRYPT_EXPORTABLE 1
130 #define CRYPT_USER_PROTECTED 2
131 #define CRYPT_CREATE_SALT 4
132 #define CRYPT_UPDATE_KEY 8
134 #define PUBLICKEYBLOB 6
135 #define PRIVATEKEYBLOB 7
136 #define PLAINTEXTKEYBLOB 8
137 #define OPAQUEKEYBLOB 9
138 #define PUBLICKEYBLOBEX 10
139 #define SYMMETRICWRAPKEYBLOB 11
140 #define AT_KEYEXCHANGE 1
141 #define AT_SIGNATURE 2
142 #define CRYPT_USERDATA 1
143 #define PKCS5_PADDING 1
144 #define CRYPT_MODE_CBC 1
145 #define CRYPT_MODE_ECB 2
146 #define CRYPT_MODE_OFB 3
147 #define CRYPT_MODE_CFB 4
148 #define CRYPT_MODE_CTS 5
149 #define CRYPT_MODE_CBCI 6
150 #define CRYPT_MODE_CFBP 7
151 #define CRYPT_MODE_OFBP 8
152 #define CRYPT_MODE_CBCOFM 9
153 #define CRYPT_MODE_CBCOFMI 10
154 #define CRYPT_ENCRYPT 1
155 #define CRYPT_DECRYPT 2
156 #define CRYPT_EXPORT 4
158 #define CRYPT_WRITE 16
162 #define HP_HASHSIZE 4
163 #define HP_HMAC_INFO 5
164 #define CRYPT_FAILED FALSE
165 #define CRYPT_SUCCEED TRUE
166 #define RCRYPT_SUCCEEDED(r) ((r)==CRYPT_SUCCEED)
167 #define RCRYPT_FAILED(r) ((r)==CRYPT_FAILED)
168 #define PP_ENUMALGS 1
169 #define PP_ENUMCONTAINERS 2
173 #define PP_CONTAINER 6
174 #define PP_CHANGE_PASSWORD 7
175 #define PP_KEYSET_SEC_DESCR 8
176 #define PP_CERTCHAIN 9
177 #define PP_KEY_TYPE_SUBTYPE 10
178 #define PP_PROVTYPE 16
179 #define PP_KEYSTORAGE 17
180 #define PP_APPLI_CERT 18
181 #define PP_SYM_KEYSIZE 19
182 #define PP_SESSION_KEYSIZE 20
183 #define PP_UI_PROMPT 21
184 #define PP_ENUMALGS_EX 22
185 #define PP_ENUMMANDROOTS 25
186 #define PP_ENUMELECTROOTS 26
187 #define PP_KEYSET_TYPE 27
188 #define PP_ADMIN_PIN 31
189 #define PP_KEYEXCHANGE_PIN 32
190 #define PP_SIGNATURE_PIN 33
191 #define PP_SIG_KEYSIZE_INC 34
192 #define PP_KEYX_KEYSIZE_INC 35
193 #define PP_UNIQUE_CONTAINER 36
194 #define PP_SGC_INFO 37
195 #define PP_USE_HARDWARE_RNG 38
196 #define PP_KEYSPEC 39
197 #define PP_ENUMEX_SIGNING_PROT 40
198 #define CRYPT_FIRST 1
200 #define CRYPT_IMPL_HARDWARE 1
201 #define CRYPT_IMPL_SOFTWARE 2
202 #define CRYPT_IMPL_MIXED 3
203 #define CRYPT_IMPL_UNKNOWN 4
204 #define PROV_RSA_FULL 1
205 #define PROV_RSA_SIG 2
207 #define PROV_FORTEZZA 4
208 #define PROV_MS_EXCHANGE 5
209 #define PROV_MS_MAIL 5
211 #define PROV_STT_MER 7
212 #define PROV_STT_ACQ 8
213 #define PROV_STT_BRND 9
214 #define PROV_STT_ROOT 10
215 #define PROV_STT_ISS 11
216 #define PROV_RSA_SCHANNEL 12
217 #define PROV_DSS_DH 13
218 #define PROV_EC_ECDSA_SIG 14
219 #define PROV_EC_ECNRA_SIG 15
220 #define PROV_EC_ECDSA_FULL 16
221 #define PROV_EC_ECNRA_FULL 17
222 #define PROV_DH_SCHANNEL 18
223 #define PROV_SPYRUS_LYNKS 20
225 #define PROV_INTEL_SEC 22
226 #define PROV_RSA_AES 24
228 #define CUR_BLOB_VERSION 2
229 #define X509_ASN_ENCODING 1
230 #define PKCS_7_ASN_ENCODING 65536
234 #define CERT_E_CHAINING (-2146762486)
235 #define CERT_E_CN_NO_MATCH (-2146762481)
236 #define CERT_E_EXPIRED (-2146762495)
237 #define CERT_E_PURPOSE (-2146762490)
238 #define CERT_E_REVOCATION_FAILURE (-2146762482)
239 #define CERT_E_REVOKED (-2146762484)
240 #define CERT_E_ROLE (-2146762493)
241 #define CERT_E_UNTRUSTEDROOT (-2146762487)
242 #define CERT_E_UNTRUSTEDTESTROOT (-2146762483)
243 #define CERT_E_VALIDITYPERIODNESTING (-2146762494)
244 #define CERT_E_WRONG_USAGE (-2146762480)
245 #define CERT_E_PATHLENCONST (-2146762492)
246 #define CERT_E_CRITICAL (-2146762491)
247 #define CERT_E_ISSUERCHAINING (-2146762489)
248 #define CERT_E_MALFORMED (-2146762488)
249 #define CRYPT_E_REVOCATION_OFFLINE (-2146885613)
250 #define CRYPT_E_REVOKED (-2146885616)
251 #define TRUST_E_BASIC_CONSTRAINTS (-2146869223)
252 #define TRUST_E_CERT_SIGNATURE (-2146869244)
253 #define TRUST_E_FAIL (-2146762485)
254 #define CERT_TRUST_NO_ERROR 0
255 #define CERT_TRUST_IS_NOT_TIME_VALID 1
256 #define CERT_TRUST_IS_NOT_TIME_NESTED 2
257 #define CERT_TRUST_IS_REVOKED 4
258 #define CERT_TRUST_IS_NOT_SIGNATURE_VALID 8
259 #define CERT_TRUST_IS_NOT_VALID_FOR_USAGE 16
260 #define CERT_TRUST_IS_UNTRUSTED_ROOT 32
261 #define CERT_TRUST_REVOCATION_STATUS_UNKNOWN 64
262 #define CERT_TRUST_IS_CYCLIC 128
263 #define CERT_TRUST_IS_PARTIAL_CHAIN 65536
264 #define CERT_TRUST_CTL_IS_NOT_TIME_VALID 131072
265 #define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 262144
266 #define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 524288
267 #define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 1
268 #define CERT_TRUST_HAS_KEY_MATCH_ISSUER 2
269 #define CERT_TRUST_HAS_NAME_MATCH_ISSUER 4
270 #define CERT_TRUST_IS_SELF_SIGNED 8
271 #define CERT_TRUST_IS_COMPLEX_CHAIN 65536
272 #define CERT_CHAIN_POLICY_BASE ((LPCSTR) 1)
273 #define CERT_CHAIN_POLICY_AUTHENTICODE ((LPCSTR) 2)
274 #define CERT_CHAIN_POLICY_AUTHENTICODE_TS ((LPCSTR) 3)
275 #define CERT_CHAIN_POLICY_SSL ((LPCSTR) 4)
276 #define CERT_CHAIN_POLICY_BASIC_CONSTRAINTS ((LPCSTR) 5)
277 #define CERT_CHAIN_POLICY_NT_AUTH ((LPCSTR) 6)
278 #define USAGE_MATCH_TYPE_AND 0
279 #define USAGE_MATCH_TYPE_OR 1
280 #define CERT_SIMPLE_NAME_STR 1
281 #define CERT_OID_NAME_STR 2
282 #define CERT_X500_NAME_STR 3
283 #define CERT_NAME_STR_COMMA_FLAG 0x04000000
284 #define CERT_NAME_STR_SEMICOLON_FLAG 1073741824
285 #define CERT_NAME_STR_CRLF_FLAG 134217728
286 #define CERT_NAME_STR_NO_PLUS_FLAG 536870912
287 #define CERT_NAME_STR_NO_QUOTING_FLAG 268435456
288 #define CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG 0x00010000
289 #define CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG 0x00040000
290 #define CERT_NAME_STR_REVERSE_FLAG 33554432
291 #define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 131072
292 #define CERT_FIND_ANY 0
293 #define CERT_FIND_CERT_ID 1048576
294 #define CERT_FIND_CTL_USAGE 655360
295 #define CERT_FIND_ENHKEY_USAGE 655360
296 #define CERT_FIND_EXISTING 851968
297 #define CERT_FIND_HASH 65536
298 #define CERT_FIND_ISSUER_ATTR 196612
299 #define CERT_FIND_ISSUER_NAME 131076
300 #define CERT_FIND_ISSUER_OF 786432
301 #define CERT_FIND_KEY_IDENTIFIER 983040
302 #define CERT_FIND_KEY_SPEC 589824
303 #define CERT_FIND_MD5_HASH 262144
304 #define CERT_FIND_PROPERTY 327680
305 #define CERT_FIND_PUBLIC_KEY 393216
306 #define CERT_FIND_SHA1_HASH 65536
307 #define CERT_FIND_SIGNATURE_HASH 917504
308 #define CERT_FIND_SUBJECT_ATTR 196615
309 #define CERT_FIND_SUBJECT_CERT 720896
310 #define CERT_FIND_SUBJECT_NAME 131079
311 #define CERT_FIND_SUBJECT_STR_A 458759
312 #define CERT_FIND_SUBJECT_STR_W 524295
313 #define CERT_FIND_ISSUER_STR_A 458756
314 #define CERT_FIND_ISSUER_STR_W 524292
315 #define CERT_FIND_OR_ENHKEY_USAGE_FLAG 16
316 #define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 1
317 #define CERT_FIND_NO_ENHKEY_USAGE_FLAG 8
318 #define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 32
319 #define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 2
320 #define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 2
321 #define CERT_UNICODE_IS_RDN_ATTRS_FLAG 1
322 #define CERT_CHAIN_FIND_BY_ISSUER 1
323 #define CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG 1
324 #define CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG 2
325 #define CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG 32768
326 #define CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG 4
327 #define CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG 8
328 #define CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG 16384
329 #define CERT_STORE_PROV_SYSTEM 10
330 #define CERT_SYSTEM_STORE_LOCAL_MACHINE 131072
331 #define szOID_PKIX_KP_SERVER_AUTH "4235600"
332 #define szOID_SERVER_GATED_CRYPTO "4235658"
333 #define szOID_SGC_NETSCAPE "2.16.840.1.113730.4.1"
334 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
335 #define CRYPT_NOHASHOID 0x00000001
336 #define CRYPT_NO_SALT 0x10
337 #define CRYPT_PREGEN 0x40
338 #define CRYPT_RECIPIENT 0x10
339 #define CRYPT_INITIATOR 0x40
340 #define CRYPT_ONLINE 0x80
341 #define CRYPT_SF 0x100
342 #define CRYPT_CREATE_IV 0x200
343 #define CRYPT_KEK 0x400
344 #define CRYPT_DATA_KEY 0x800
345 #define CRYPT_VOLATILE 0x1000
346 #define CRYPT_SGCKEY 0x2000
347 #define KP_IV 0x00000001
348 #define KP_SALT 0x00000002
349 #define KP_PADDING 0x00000003
350 #define KP_MODE 0x00000004
351 #define KP_MODE_BITS 0x00000005
352 #define KP_PERMISSIONS 0x00000006
353 #define KP_ALGID 0x00000007
354 #define KP_BLOCKLEN 0x00000008
355 #define KP_KEYLEN 0x00000009
356 #define KP_SALT_EX 0x0000000a
357 #define KP_P 0x0000000b
358 #define KP_G 0x0000000c
359 #define KP_Q 0x0000000d
360 #define KP_X 0x0000000e
361 #define KP_Y 0x0000000f
362 #define KP_RA 0x00000010
363 #define KP_RB 0x00000011
364 #define KP_INFO 0x00000012
365 #define KP_EFFECTIVE_KEYLEN 0x00000013
366 #define KP_SCHANNEL_ALG 0x00000014
367 #define KP_PUB_PARAMS 0x00000027
368 #define CRYPT_FLAG_PCT1 0x0001
369 #define CRYPT_FLAG_SSL2 0x0002
370 #define CRYPT_FLAG_SSL3 0x0004
371 #define CRYPT_FLAG_TLS1 0x0008
372 #define CRYPT_FLAG_IPSEC 0x0010
373 #define CRYPT_FLAG_SIGNING 0x0020
374 #define SCHANNEL_MAC_KEY 0x00000000
375 #define SCHANNEL_ENC_KEY 0x00000001
376 #define INTERNATIONAL_USAGE 0x00000001
377 #if (WINVER >= 0x0501) /* Windows Server 2003, Windows XP */
378 #define CMC_ADD_ATTRIBUTES (LPCSTR) 63
379 #define CMC_ADD_EXTENSIONS (LPCSTR) 62
380 #define X509_CERT_PAIR (LPCSTR) 53
381 #define X509_CERTIFICATE_TEMPLATE (LPCSTR) 64
382 #define X509_CROSS_CERT_DIST_POINTS (LPCSTR) 58
383 #define CMC_DATA (LPCSTR) 59
384 #define X509_NAME_CONSTRAINTS (LPCSTR) 55
385 #define X509_POLICY_CONSTRAINTS (LPCSTR) 57
386 #define X509_POLICY_MAPPINGS (LPCSTR) 56
387 #define CMC_RESPONSE (LPCSTR) 60
388 #define CMC_STATUS (LPCSTR) 61
389 #endif /* (WINVER >= 0x0501) */ /* Windows Server 2003, Windows XP */
390 #define X509_ALGORITHM_IDENTIFIER (LPCSTR) 74
391 #define X509_ALTERNATE_NAME (LPCSTR) 12
392 /* need X509_ANY_STRING */
393 #define PKCS_ATTRIBUTE (LPCSTR) 22
394 #define X509_AUTHORITY_INFO_ACCESS (LPCSTR) 32
395 #define X509_AUTHORITY_KEY_ID (LPCSTR) 9
396 #define X509_AUTHORITY_KEY_ID2 (LPCSTR) 31
397 #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
398 #define X509_BASIC_CONSTRAINTS2 (LPCSTR) 15
399 #define X509_BIOMETRIC_EXT (LPCSTR) 71
400 #define X509_BITS (LPCSTR) 26
401 #define X509_CERT (LPCSTR) 1
402 #define X509_CERT_CRL_TO_BE_SIGNED (LPCSTR) 3
403 #define X509_CERT_POLICIES (LPCSTR) 16
404 #define X509_CERT_REQUEST_TO_BE_SIGNED (LPCSTR) 4
405 #define X509_CERT_TO_BE_SIGNED (LPCSTR) 2
406 #define X509_CHOICE_OF_TIME (LPCSTR) 30
407 #define PKCS_CONTENT_INFO (LPCSTR) 33
408 #define PKCS_CONTENT_INFO_SEQUENCE_OF_ANY (LPCSTR) 23
409 #define X509_CRL_DIST_POINTS (LPCSTR) 35
410 /* need X509_CRL_REASON_CODE */
411 #define RSA_CSP_PUBLICKEYBLOB (LPCSTR) 19
412 #define PKCS_CTL (LPCSTR) 37
413 #define X509_DSS_PARAMETERS (LPCSTR) 39
414 /* need X509_DSS_PUBLICKEY */
415 #define X509_DSS_SIGNATURE (LPCSTR) 40
416 #define X509_ECC_SIGNATURE (LPCSTR) 47
417 #define X509_ENHANCED_KEY_USAGE (LPCSTR) 36
418 #define X509_ENUMERATED (LPCSTR) 29
419 #define X509_EXTENSIONS (LPCSTR) 5
420 #define X509_INTEGER (LPCSTR) 27
421 #define X509_ISSUING_DIST_POINT (LPCSTR) 54
422 #define X509_KEY_ATTRIBUTES (LPCSTR) 10
423 #define X509_KEY_USAGE (LPCSTR) 14
424 #define X509_KEY_USAGE_RESTRICTION (LPCSTR) 11
425 #define X509_KEYGEN_REQUEST_TO_BE_SIGNED (LPCSTR) 21
426 #define X509_LOGOTYPE_EXT (LPCSTR) 70
427 #define X509_MULTI_BYTE_INTEGER (LPCSTR) 28
428 #define X509_MULTI_BYTE_UINT (LPCSTR) 38
429 #define X509_NAME (LPCSTR) 7
430 #define X509_NAME_VALUE (LPCSTR) 6
431 #define X509_OBJECT_IDENTIFIER (LPCSTR) 73
432 #define X509_OCTET_STRING (LPCSTR) 25
433 #define X509_PUBLIC_KEY_INFO (LPCSTR) 8
434 #define PKCS_RC2_CBC_PARAMETERS (LPCSTR) 41
435 #define CNG_RSA_PUBLIC_KEY_BLOB (LPCSTR) 72
436 #define PKCS_RSA_SSA_PSS_PARAMETERS (LPCSTR) 75
437 #define PKCS_RSAES_OAEP_PARAMETERS (LPCSTR) 76
438 #define ECC_CMS_SHARED_INFO (LPCSTR) 77
439 #define X509_SEQUENCE_OF_ANY (LPCSTR) 34
440 #define PKCS7_SIGNER_INFO (LPCSTR) 500
441 #define CMS_SIGNER_INFO (LPCSTR) 501
442 #define PKCS_SMIME_CAPABILITIES (LPCSTR) 42
443 #define PKCS_TIME_REQUEST (LPCSTR) 18
444 /* need X509_UNICODE_ANY_STRING */
445 #define X509_UNICODE_NAME (LPCSTR) 20
446 #define X509_UNICODE_NAME_VALUE (LPCSTR) 24
447 #define PKCS_UTC_TIME (LPCSTR) 17
448 #define OCSP_SIGNED_REQUEST (LPCSTR) 65
449 #define OCSP_REQUEST (LPCSTR) 66
450 #define OCSP_RESPONSE (LPCSTR) 67
451 #define OCSP_BASIC_SIGNED_RESPONSE (LPCSTR) 68
452 #define OCSP_BASIC_RESPONSE (LPCSTR) 69
453 enum { CRL_REASON_UNSPECIFIED
=0,
454 CRL_REASON_KEY_COMPROMISE
=1,
455 CRL_REASON_CA_COMPROMISE
=2,
456 CRL_REASON_AFFILIATION_CHANGED
=3,
457 CRL_REASON_SUPERSEDED
=4,
458 CRL_REASON_CESSATION_OF_OPERATION
=5,
459 CRL_REASON_CERTIFICATE_HOLD
=6,
460 CRL_REASON_REMOVE_FROM_CRL
=7
462 /* need CRYPT_DECODE_NOCOPY_FLAG */
463 #define CRYPT_ENCODE_ALLOC_FLAG 0x8000
464 #define CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG 0x40000000
465 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG 0x80000000
466 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG 0x20000000
467 #define CRYPT_UNICODE_NAME_ENCODE_FORCE_UTF8_UNICODE_FLAG 0x10000000
470 #define szOID_RSA "1.2.840.113549"
471 #define szOID_PKCS "1.2.840.113549.1"
472 #define szOID_RSA_HASH "1.2.840.113549.2"
473 #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
474 #define szOID_PKCS_1 "1.2.840.113549.1.1"
475 #define szOID_PKCS_2 "1.2.840.113549.1.2"
476 #define szOID_PKCS_3 "1.2.840.113549.1.3"
477 #define szOID_PKCS_4 "1.2.840.113549.1.4"
478 #define szOID_PKCS_5 "1.2.840.113549.1.5"
479 #define szOID_PKCS_6 "1.2.840.113549.1.6"
480 #define szOID_PKCS_7 "1.2.840.113549.1.7"
481 #define szOID_PKCS_8 "1.2.840.113549.1.8"
482 #define szOID_PKCS_9 "1.2.840.113549.1.9"
483 #define szOID_PKCS_10 "1.2.840.113549.1.10"
484 #define szOID_PKCS_12 "1.2.840.113549.1.12"
485 #define szOID_RSA_MD2 "1.2.840.113549.1.1.2"
486 #define szOID_RSA_MD4 "1.2.840.113549.1.1.3"
487 #define szOID_RSA_MD5 "1.2.840.113549.2.5"
488 #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
489 #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
490 #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
491 #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
492 #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
493 #define szOID_RSA_SETOAEP_RSA "1.2.840.113549.1.1.5"
494 #define szOID_RSA_DH "1.2.840.113549.1.3.1"
495 #define szOID_RSA_data "1.2.840.113549.1.7.1"
496 #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
497 #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
498 #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
499 #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
500 #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
501 #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
502 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
503 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
504 #define szOID_RSA_contentType "1.2.840.113549.1.9.3"
505 #define szOID_RSA_messageDigest "1.2.840.113549.1.9.4"
506 #define szOID_RSA_signingTime "1.2.840.113549.1.9.5"
507 #define szOID_RSA_counterSign "1.2.840.113549.1.9.6"
508 #define szOID_RSA_challengePwd "1.2.840.113549.1.9.7"
509 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.8"
510 #define szOID_RSA_extCertAttrs "1.2.840.113549.1.9.9"
511 #define szOID_RSA_SMIMECapabilities "1.2.840.113549.1.9.15"
512 #define szOID_RSA_preferSignedData "1.2.840.113549.1.9.15.1"
513 #define szOID_RSA_RC2CBC "1.2.840.113549.3.2"
514 #define szOID_RSA_RC4 "1.2.840.113549.3.4"
515 #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
516 #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
517 #define szOID_ANSI_x942 "1.2.840.10046"
518 #define szOID_ANSI_x942_DH "1.2.840.10046.2.1"
519 #define szOID_X957 "1.2.840.10040"
520 #define szOID_X957_DSA "1.2.840.10040.4.1"
521 #define szOID_DATA STRUCTURE "1.2.840.10040.4.3"
522 #define szOID_DS "2.5"
523 #define szOID_DSALG "2.5.8"
524 #define szOID_DSALG_CRPT "2.5.8.1"
525 #define szOID_DSALG_HASH "2.5.8.2"
526 #define szOID_DSALG_SIGN "2.5.8.3"
527 #define szOID_DSALG_RSA "2.5.8.1.1"
528 #define szOID_OIW "1.3.14"
529 #define szOID_OIWSEC "1.3.14.3.2"
530 #define szOID_OIWSEC_md4RSA "1.3.14.3.2.2"
531 #define szOID_OIWSEC_md5RSA "1.3.14.3.2.3"
532 #define szOID_OIWSEC_md4RSA2 "1.3.14.3.2.4"
533 #define szOID_OIWSEC_desECB "1.3.14.3.2.6"
534 #define szOID_OIWSEC_desCBC "1.3.14.3.2.7"
535 #define szOID_OIWSEC_desOFB "1.3.14.3.2.8"
536 #define szOID_OIWSEC_desCFB "1.3.14.3.2.9"
537 #define szOID_OIWSEC_desMAC "1.3.14.3.2.10"
538 #define szOID_OIWSEC_rsaSign "1.3.14.3.2.11"
539 #define szOID_OIWSEC_dsa "1.3.14.3.2.12"
540 #define szOID_OIWSEC_shaDSA "1.3.14.3.2.13"
541 #define szOID_OIWSEC_mdc2RSA "1.3.14.3.2.14"
542 #define szOID_OIWSEC_shaRSA "1.3.14.3.2.15"
543 #define szOID_OIWSEC_dhCommMod "1.3.14.3.2.16"
544 #define szOID_OIWSEC_desEDE "1.3.14.3.2.17"
545 #define szOID_OIWSEC_sha "1.3.14.3.2.18"
546 #define szOID_OIWSEC_mdc2 "1.3.14.3.2.19"
547 #define szOID_OIWSEC_dsaComm "1.3.14.3.2.20"
548 #define szOID_OIWSEC_dsaCommSHA "1.3.14.3.2.21"
549 #define szOID_OIWSEC_rsaXchg "1.3.14.3.2.22"
550 #define szOID_OIWSEC_keyHashSeal "1.3.14.3.2.23"
551 #define szOID_OIWSEC_md2RSASign "1.3.14.3.2.24"
552 #define szOID_OIWSEC_md5RSASign "1.3.14.3.2.25"
553 #define szOID_OIWSEC_sha1 "1.3.14.3.2.26"
554 #define szOID_OIWSEC_dsaSHA1 "1.3.14.3.2.27"
555 #define szOID_OIWSEC_dsaCommSHA1 "1.3.14.3.2.28"
556 #define szOID_OIWSEC_sha1RSASign "1.3.14.3.2.29"
557 #define szOID_OIWDIR "1.3.14.7.2"
558 #define szOID_OIWDIR_CRPT "1.3.14.7.2.1"
559 #define szOID_OIWDIR_HASH "1.3.14.7.2.2"
560 #define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
561 #define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
562 #define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
563 #define szOID_INFOSEC "2.16.840.1.101.2.1"
564 #define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
565 #define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
566 #define szOID_INFOSEC_sdnsConfidentiality "2.16.840.1.101.2.1.1.3"
567 #define szOID_INFOSEC_mosaicConfidentiality "2.16.840.1.101.2.1.1.4"
568 #define szOID_INFOSEC_sdnsIntegrity "2.16.840.1.101.2.1.1.5"
569 #define szOID_INFOSEC_mosaicIntegrity "2.16.840.1.101.2.1.1.6"
570 #define szOID_INFOSEC_sdnsTokenProtection "2.16.840.1.101.2.1.1.7"
571 #define szOID_INFOSEC_mosaicTokenProtection "2.16.840.1.101.2.1.1.8"
572 #define szOID_INFOSEC_sdnsKeyManagement "2.16.840.1.101.2.1.1.9"
573 #define szOID_INFOSEC_mosaicKeyManagement "2.16.840.1.101.2.1.1.10"
574 #define szOID_INFOSEC_sdnsKMandSig "2.16.840.1.101.2.1.1.11"
575 #define szOID_INFOSEC_mosaicKMandSig "2.16.840.1.101.2.1.1.12"
576 #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
577 #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
578 #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
579 #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
580 #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
581 #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
582 #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
583 #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
584 #define szOID_INFOSEC_mosaicUpdatedInteg "2.16.840.1.101.2.1.1.21"
585 #define szOID_PKIX_NO_SIGNATURE "1.3.6.1.5.5.7.6.2"
587 #define szOID_COMMON_NAME "2.5.4.3"
588 #define szOID_COUNTRY_NAME "2.5.4.6"
589 #define szOID_DEVICE_SERIAL_NUMBER "2.5.4.5"
590 #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25"
591 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
592 #define szOID_GIVEN_NAME "2.5.4.42"
593 #define szOID_INITIALS "2.5.4.43"
594 #define szOID_LOCALITY_NAME "2.5.4.7"
595 #define szOID_ORGANIZATION_NAME "2.5.4.10"
596 #define szOID_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
597 #define szOID_STATE_OR_PROVINCE_NAME "2.5.4.8"
598 #define szOID_STREET_ADDRESS "2.5.4.9"
599 #define szOID_SUR_NAME "2.5.4.4"
600 #define szOID_TITLE "2.5.4.12"
601 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.8"
602 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
603 #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
604 #define szOID_APPLICATION_CERT_POLICIES "1.3.6.1.4.1.311.21.10"
605 #define szOID_APPLICATION_POLICY_CONSTRAINTS "1.3.6.1.4.1.311.21.12"
606 #define szOID_APPLICATION_POLICY_MAPPINGS "1.3.6.1.4.1.311.21.11"
607 #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
608 #define szOID_AUTHORITY_KEY_IDENTIFIER "2.5.29.1"
609 #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
610 #define X509_BASIC_CONSTRAINTS (LPCSTR) 13
611 #define szOID_BIOMETRIC_EXT "1.3.6.1.5.5.7.1.2"
612 #define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14"
613 #define szOID_CERT_POLICIES "2.5.29.32"
614 #if (WINVER >= 0x0501) /* Windows Server 2003, Windows XP */
615 #define szOID_CERTIFICATE_TEMPLATE "1.3.6.1.4.1.311.21.7"
616 #define szOID_CRL_NUMBER "2.5.29.20"
617 #define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1"
618 #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
619 #define szOID_ENROLLMENT_NAME_VALUE_PAIR "1.3.6.1.4.1.311.13.2.1"
620 #define szOID_FRESHEST_CRL "2.5.29.46"
621 #define szOID_ISSUING_DIST_POINT "2.5.29.28"
622 #define szOID_NAME_CONSTRAINTS "2.5.29.30"
623 #endif /* (WINVER >= 0x0501) */ /* Windows Server 2003, Windows XP */
624 #define szOID_CRL_DIST_POINTS 2.5.29.31
625 #define szOID_CRL_REASON_CODE "2.5.29.21"
626 #define szOID_CRL_VIRTUAL_BASE "1.3.6.1.4.1.311.21.3"
627 #define szOID_ECC_PUBLIC_KEY "1.2.840.10045.2.1"
628 #define szOID_ECDSA_SPECIFIED "1.2.840.10045.4.3"
629 #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
630 #define szOID_ISSUER_ALT_NAME "2.5.29.8"
631 #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
632 #define szOID_KEY_ATTRIBUTES "2.5.29.2"
633 #define szOID_KEY_USAGE "2.5.29.4"
634 #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
635 #define szOID_LOGOTYPE_EXT "1.3.6.1.5.5.7.1.12"
636 /* need szOID_NEXT_UPDATE_LOCATION */
637 #define szOID_POLICY_CONSTRAINTS "2.5.29.36"
638 #define szOID_POLICY_MAPPINGS "2.5.29.33"
639 #define szOID_RSA_SSA_PSS "1.2.840.113549.1.1.10"
640 #define szOID_RSAES_OAEP "1.2.840.113549.1.1.7"
641 #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
642 #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
643 #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
645 typedef struct _CERT_BASIC_CONSTRAINTS2_INFO
{
647 BOOL fPathLenConstraint
;
648 DWORD dwPathLenConstraint
;
649 } CERT_BASIC_CONSTRAINTS2_INFO
,
650 *PCERT_BASIC_CONSTRAINTS2_INFO
;
652 typedef VOID (WINAPI
*PFN_CRYPT_FREE
)(LPVOID pv
);
653 typedef LPVOID (WINAPI
*PFN_CRYPT_ALLOC
)(size_t cbsize
);
654 typedef struct _CRYPT_ENCODE_PARA
{
656 PFN_CRYPT_ALLOC pfnAlloc
;
657 PFN_CRYPT_FREE pfnFree
;
661 /* Definition missing. */
662 typedef struct _CRYPT_DECODE_PARA
*PCRYPT_DECODE_PARA
;
665 typedef struct _VTableProvStruc
{FARPROC FuncVerifyImage
;} VTableProvStruc
,*PVTableProvStruc
;
666 typedef ULONG HCRYPTPROV
;
667 typedef ULONG HCRYPTKEY
;
668 typedef ULONG HCRYPTHASH
;
669 typedef PVOID HCERTSTORE
;
670 typedef PVOID HCRYPTMSG
;
671 typedef PVOID HCERTCHAINENGINE
;
672 typedef struct _CRYPTOAPI_BLOB
{
675 } CRYPT_INTEGER_BLOB
, *PCRYPT_INTEGER_BLOB
,
676 CRYPT_UINT_BLOB
, *PCRYPT_UINT_BLOB
,
677 CRYPT_OBJID_BLOB
, *PCRYPT_OBJID_BLOB
,
678 CERT_NAME_BLOB
, *PCERT_NAME_BLOB
,
679 CERT_RDN_VALUE_BLOB
,*PCERT_RDN_VALUE_BLOB
,
680 CERT_BLOB
, *PCERT_BLOB
,
681 CRL_BLOB
, *PCRL_BLOB
,
682 DATA_BLOB
, *PDATA_BLOB
,
683 CRYPT_DATA_BLOB
, *PCRYPT_DATA_BLOB
,
684 CRYPT_HASH_BLOB
, *PCRYPT_HASH_BLOB
,
685 CRYPT_DIGEST_BLOB
, *PCRYPT_DIGEST_BLOB
,
686 CRYPT_DER_BLOB
, *PCRYPT_DER_BLOB
,
687 CRYPT_ATTR_BLOB
, *PCRYPT_ATTR_BLOB
;
688 /* not described in SDK; has the same layout as HTTPSPolicyCallbackData */
689 typedef struct _SSL_EXTRA_CERT_CHAIN_POLICY_PARA
{
693 LPWSTR pwszServerName
;
694 } SSL_EXTRA_CERT_CHAIN_POLICY_PARA
, *PSSL_EXTRA_CERT_CHAIN_POLICY_PARA
,
695 HTTPSPolicyCallbackData
, *PHTTPSPolicyCallbackData
;
696 /* #if (_WIN32_WINNT>=0x500) */
697 typedef struct _CERT_CHAIN_POLICY_PARA
{
700 void* pvExtraPolicyPara
;
701 } CERT_CHAIN_POLICY_PARA
, *PCERT_CHAIN_POLICY_PARA
;
702 typedef struct _CERT_CHAIN_POLICY_STATUS
{
707 void* pvExtraPolicyStatus
;
708 } CERT_CHAIN_POLICY_STATUS
, *PCERT_CHAIN_POLICY_STATUS
;
710 typedef struct _CRYPT_ALGORITHM_IDENTIFIER
{
712 CRYPT_OBJID_BLOB Parameters
;
713 } CRYPT_ALGORITHM_IDENTIFIER
, *PCRYPT_ALGORITHM_IDENTIFIER
;
714 typedef struct _CRYPT_BIT_BLOB
{
718 } CRYPT_BIT_BLOB
, *PCRYPT_BIT_BLOB
;
719 typedef struct _CERT_PUBLIC_KEY_INFO
{
720 CRYPT_ALGORITHM_IDENTIFIER Algorithm
;
721 CRYPT_BIT_BLOB PublicKey
;
722 } CERT_PUBLIC_KEY_INFO
, *PCERT_PUBLIC_KEY_INFO
;
723 typedef struct _CERT_EXTENSION
{
726 CRYPT_OBJID_BLOB Value
;
727 } CERT_EXTENSION
, *PCERT_EXTENSION
;
728 typedef struct _CERT_INFO
{
730 CRYPT_INTEGER_BLOB SerialNumber
;
731 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
732 CERT_NAME_BLOB Issuer
;
735 CERT_NAME_BLOB Subject
;
736 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo
;
737 CRYPT_BIT_BLOB IssuerUniqueId
;
738 CRYPT_BIT_BLOB SubjectUniqueId
;
740 PCERT_EXTENSION rgExtension
;
741 } CERT_INFO
, *PCERT_INFO
;
742 typedef struct _CERT_CONTEXT
{
743 DWORD dwCertEncodingType
;
746 PCERT_INFO pCertInfo
;
747 HCERTSTORE hCertStore
;
748 } CERT_CONTEXT
, *PCERT_CONTEXT
;
749 typedef const CERT_CONTEXT
*PCCERT_CONTEXT
;
750 typedef struct _CTL_USAGE
{
751 DWORD cUsageIdentifier
;
752 LPSTR
*rgpszUsageIdentifier
;
753 } CTL_USAGE
, *PCTRL_USAGE
,
754 CERT_ENHKEY_USAGE
, *PCERT_ENHKEY_USAGE
;
755 typedef struct _CERT_USAGE_MATCH
{
757 CERT_ENHKEY_USAGE Usage
;
758 } CERT_USAGE_MATCH
, *PCERT_USAGE_MATCH
;
759 /* #if (_WIN32_WINNT>=0x500) */
760 typedef struct _CERT_CHAIN_PARA
{
762 CERT_USAGE_MATCH RequestedUsage
;
763 #if CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
764 CERT_USAGE_MATCH RequestedIssuancePolicy
;
765 DWORD dwUrlRetrievalTimeout
;
766 BOOL fCheckRevocationFreshnessTime
;
767 DWORD dwRevocationFreshnessTime
;
769 } CERT_CHAIN_PARA
, *PCERT_CHAIN_PARA
;
770 typedef BOOL (WINAPI
*PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK
)(PCCERT_CONTEXT
,void*);
771 typedef struct _CERT_CHAIN_FIND_BY_ISSUER_PARA
{
773 LPCSTR pszUsageIdentifier
;
775 DWORD dwAcquirePrivateKeyFlags
;
777 CERT_NAME_BLOB
* rgIssuer
;
778 PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK pfnFIndCallback
;
780 DWORD
* pdwIssuerChainIndex
;
781 DWORD
* pdwIssuerElementIndex
;
782 } CERT_CHAIN_FIND_BY_ISSUER_PARA
, *PCERT_CHAIN_FIND_BY_ISSUER_PARA
;
784 typedef struct _CERT_TRUST_STATUS
{
787 } CERT_TRUST_STATUS
, *PCERT_TRUST_STATUS
;
788 typedef struct _CRL_ENTRY
{
789 CRYPT_INTEGER_BLOB SerialNumber
;
790 FILETIME RevocationDate
;
792 PCERT_EXTENSION rgExtension
;
793 } CRL_ENTRY
, *PCRL_ENTRY
;
794 typedef struct _CRL_INFO
{
796 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
797 CERT_NAME_BLOB Issuer
;
801 PCRL_ENTRY rgCRLEntry
;
803 PCERT_EXTENSION rgExtension
;
804 } CRL_INFO
, *PCRL_INFO
;
805 typedef struct _CRL_CONTEXT
{
806 DWORD dwCertEncodingType
;
810 HCERTSTORE hCertStore
;
811 } CRL_CONTEXT
, *PCRL_CONTEXT
;
812 typedef const CRL_CONTEXT
*PCCRL_CONTEXT
;
813 typedef struct _CERT_REVOCATION_CRL_INFO
{
815 PCCRL_CONTEXT pBaseCRLContext
;
816 PCCRL_CONTEXT pDeltaCRLContext
;
817 PCRL_ENTRY pCrlEntry
;
819 } CERT_REVOCATION_CRL_INFO
, *PCERT_REVOCATION_CRL_INFO
;
820 typedef struct _CERT_REVOCATION_INFO
{
822 DWORD dwRevocationResult
;
823 LPCSTR pszRevocationOid
;
824 LPVOID pvOidSpecificInfo
;
825 BOOL fHasFreshnessTime
;
826 DWORD dwFreshnessTime
;
827 PCERT_REVOCATION_CRL_INFO pCrlInfo
;
828 } CERT_REVOCATION_INFO
, *PCERT_REVOCATION_INFO
;
829 /* #if (_WIN32_WINNT>=0x500) */
830 typedef struct _CERT_CHAIN_ELEMENT
{
832 PCCERT_CONTEXT pCertContext
;
833 CERT_TRUST_STATUS TrustStatus
;
834 PCERT_REVOCATION_INFO pRevocationInfo
;
835 PCERT_ENHKEY_USAGE pIssuanceUsage
;
836 PCERT_ENHKEY_USAGE pApplicationUsage
;
837 } CERT_CHAIN_ELEMENT
, *PCERT_CHAIN_ELEMENT
;
839 typedef struct _CRYPT_ATTRIBUTE
{
842 PCRYPT_ATTR_BLOB rgValue
;
843 } CRYPT_ATTRIBUTE
, *PCRYPT_ATTRIBUTE
;
844 typedef struct _CTL_ENTRY
{
845 CRYPT_DATA_BLOB SubjectIdentifier
;
847 PCRYPT_ATTRIBUTE rgAttribute
;
848 } CTL_ENTRY
, *PCTL_ENTRY
;
849 typedef struct _CTL_INFO
{
851 CTL_USAGE SubjectUsage
;
852 CRYPT_DATA_BLOB ListIdentifier
;
853 CRYPT_INTEGER_BLOB SequenceNumber
;
856 CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm
;
858 PCTL_ENTRY rgCTLEntry
;
860 PCERT_EXTENSION rgExtension
;
861 } CTL_INFO
, *PCTL_INFO
;
862 typedef struct _CTL_CONTEXT
{
863 DWORD dwMsgAndCertEncodingType
;
867 HCERTSTORE hCertStore
;
871 } CTL_CONTEXT
, *PCTL_CONTEXT
;
872 typedef const CTL_CONTEXT
*PCCTL_CONTEXT
;
873 typedef struct _CERT_TRUST_LIST_INFO
{
875 PCTL_ENTRY pCtlEntry
;
876 PCCTL_CONTEXT pCtlContext
;
877 } CERT_TRUST_LIST_INFO
, *PCERT_TRUST_LIST_INFO
;
878 typedef struct _CERT_SIMPLE_CHAIN
{
880 CERT_TRUST_STATUS TrustStatus
;
882 PCERT_CHAIN_ELEMENT
* rgpElement
;
883 PCERT_TRUST_LIST_INFO pTrustListInfo
;
884 BOOL fHasRevocationFreshnessTime
;
885 DWORD dwRevocationFreshnessTime
;
886 } CERT_SIMPLE_CHAIN
, *PCERT_SIMPLE_CHAIN
;
887 /* #if (_WIN32_WINNT>=0x500) */
888 typedef const struct _CERT_CHAIN_CONTEXT
* PCCERT_CHAIN_CONTEXT
;
889 typedef struct _CERT_CHAIN_CONTEXT
{
891 CERT_TRUST_STATUS TrustStatus
;
893 PCERT_SIMPLE_CHAIN
* rgpChain
;
894 DWORD cLowerQualityChainContext
;
895 PCCERT_CHAIN_CONTEXT
* rgpLowerQualityChainContext
;
896 BOOL fHasRevocationFreshnessTime
;
897 DWORD dwRevocationFreshnessTime
;
898 } CERT_CHAIN_CONTEXT
, *PCERT_CHAIN_CONTEXT
;
900 typedef struct _PROV_ENUMALGS
{
906 typedef struct _PUBLICKEYSTRUC
{
911 } BLOBHEADER
, PUBLICKEYSTRUC
;
912 typedef struct _RSAPUBKEY
{
917 typedef struct _HMAC_Info
924 } HMAC_INFO
, *PHMAC_INFO
;
925 #if (WINVER >= 0x0501) /* Windows Server 2003, Windows XP */
926 typedef struct _CMC_ADD_ATTRIBUTES_INFO
{
927 DWORD dwCmcDataReference
;
928 DWORD cCertReference
;
929 DWORD
* rgdwCertReference
;
931 PCRYPT_ATTRIBUTE rgAttribute
;
932 } CMC_ADD_ATTRIBUTES_INFO
,
933 *PCMC_ADD_ATTRIBUTES_INFO
;
934 typedef struct _CMC_ADD_EXTENSIONS_INFO
{
935 DWORD dwCmcDataReference
;
936 DWORD cCertReference
;
937 DWORD
* rgdwCertReference
;
939 PCERT_EXTENSION rgExtension
;
940 } CMC_ADD_EXTENSIONS_INFO
,
941 *PCMC_ADD_EXTENSIONS_INFO
;
942 #endif /* (WINVER >= 0x0501) */ /* Windows Server 2003, Windows XP */
943 #if (WINVER >= 0x0410) /* Windows 98 */
944 /* need PCERT_OTHER_NAME & CERT_DATA_BLOB!
945 typedef struct _CERT_ALT_NAME_ENTRY {
946 DWORD dwAltNameChoice;
948 PCERT_OTHER_NAME pOtherName;
949 LPWSTR pwszRfc822Name;
951 CERT_DATA_BLOB x400Address;
952 CERT_NAME_BLOB DirectoryName;
953 LPWSTR pEdiPartyName;
955 CRYPT_DATA_BLOB IPAddress;
956 LPSTR pszRegisteredID;
958 } CERT_ALT_NAME_ENTRY,
959 *PCERT_ALT_NAME_ENTRY;
961 /* needs CERT_ALT_NAME_ENTRY above, which lacks prereqs
962 typedef struct _CERT_ALT_NAME_INFO {
964 PCERT_ALT_NAME_ENTRY rgAltEntry;
965 } CERT_ALT_NAME_INFO,
966 *PCERT_ALT_NAME_INFO;
968 typedef struct _CERT_NAME_VALUE
{
970 CERT_RDN_VALUE_BLOB Value
;
973 typedef struct _CERT_POLICY_QUALIFIER_INFO
{
974 LPSTR pszPolicyQualifierId
;
975 CRYPT_OBJID_BLOB Qualifier
;
976 } CERT_POLICY_QUALIFIER_INFO
,
977 *PCERT_POLICY_QUALIFIER_INFO
;
978 typedef struct _CERT_POLICY_CONSTRAINTS_INFO
{
979 BOOL fRequireExplicitPolicy
;
980 DWORD dwRequireExplicitPolicySkipCerts
;
981 BOOL fInhibitPolicyMapping
;
982 DWORD dwInhibitPolicyMappingSkipCerts
;
983 } CERT_POLICY_CONSTRAINTS_INFO
,
984 *PCERT_POLICY_CONSTRAINTS_INFO
;
985 #endif /* (WINVER >= 0x0410) */ /* Windows 98 */
986 #if (WINVER >= 0x0501) /* Windows Server 2003, Windows XP */
987 typedef struct _CERT_POLICY_MAPPING
{
988 LPSTR pszIssuerDomainPolicy
;
989 LPSTR pszSubjectDomainPolicy
;
990 } CERT_POLICY_MAPPING
,
991 *PCERT_POLICY_MAPPING
;
992 typedef struct _CERT_POLICY_MAPPINGS_INFO
{
993 DWORD cPolicyMapping
;
994 PCERT_POLICY_MAPPING rgPolicyMapping
;
995 } CERT_POLICY_MAPPINGS_INFO
,
996 *PCERT_POLICY_MAPPINGS_INFO
;
998 #endif /* (WINVER >= 0x0501) */ /* Windows Server 2003, Windows XP */
1000 //http://msdn.microsoft.com/en-us/library/aa922935.aspx
1001 //Some Crypto Key Provider Information structures.
1002 typedef struct _CRYPT_KEY_PROV_PARAM
{
1007 } CRYPT_KEY_PROV_PARAM
, *PCRYPT_KEY_PROV_PARAM
;
1009 //http://msdn.microsoft.com/en-us/library/aa381420(VS.85).aspx
1010 typedef struct _CRYPT_KEY_PROV_INFO
{
1011 LPWSTR pwszContainerName
;
1012 LPWSTR pwszProvName
;
1016 PCRYPT_KEY_PROV_PARAM rgProvParam
;
1018 } CRYPT_KEY_PROV_INFO
, *PCRYPT_KEY_PROV_INFO
;
1020 #define CERT_SET_KEY_PROV_HANDLE_PROP_ID 0x00000001
1021 #define CERT_SET_KEY_CONTEXT_PROP_ID 0x00000001
1023 #define CRYPT_KEYID_DELETE_FLAG 0x00000010
1024 #define CRYPT_KEYID_SET_NEW_FLAG 0x00002000
1026 //certificate crl ctl IDs
1027 #define CERT_KEY_PROV_HANDLE_PROP_ID 1
1028 #define CERT_KEY_PROV_INFO_PROP_ID 2
1029 #define CERT_SHA1_HASH_PROP_ID 3
1030 #define CERT_MD5_HASH_PROP_ID 4
1031 #define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID
1032 #define CERT_KEY_CONTEXT_PROP_ID 5
1033 #define CERT_KEY_SPEC_PROP_ID 6
1034 #define CERT_IE30_RESERVED_PROP_ID 7
1035 #define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8
1036 #define CERT_ENHKEY_USAGE_PROP_ID 9
1037 #define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID
1038 #define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10
1039 #define CERT_FRIENDLY_NAME_PROP_ID 11
1040 #define CERT_PVK_FILE_PROP_ID 12
1041 #define CERT_DESCRIPTION_PROP_ID 13
1042 #define CERT_ACCESS_STATE_PROP_ID 14
1043 #define CERT_SIGNATURE_HASH_PROP_ID 15
1044 #define CERT_SMART_CARD_DATA_PROP_ID 16
1045 #define CERT_EFS_PROP_ID 17
1046 #define CERT_FORTEZZA_DATA_PROP_ID 18
1047 #define CERT_ARCHIVED_PROP_ID 19
1048 #define CERT_KEY_IDENTIFIER_PROP_ID 20
1049 #define CERT_AUTO_ENROLL_PROP_ID 21
1050 #define CERT_PUBKEY_ALG_PARA_PROP_ID 22
1051 #define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23
1052 #define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24
1053 #define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25
1054 #define CERT_ENROLLMENT_PROP_ID 26
1055 #define CERT_DATE_STAMP_PROP_ID 27
1056 #define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28
1057 #define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29
1058 #define CERT_EXTENDED_ERROR_INFO_PROP_ID 30
1060 //Certificate name type
1061 #define CERT_NAME_EMAIL_TYPE 1
1062 #define CERT_NAME_RDN_TYPE 2
1063 #define CERT_NAME_ATTR_TYPE 3
1064 #define CERT_NAME_SIMPLE_DISPLAY_TYPE 4
1065 #define CERT_NAME_FRIENDLY_DISPLAY_TYPE 5
1066 #define CERT_NAME_DNS_TYPE 6
1067 #define CERT_NAME_URL_TYPE 7
1068 #define CERT_NAME_UPN_TYPE 8
1070 //certificate/CRL, encoded, context or element disposition values.
1071 #define CERT_STORE_ADD_NEW 1
1072 #define CERT_STORE_ADD_USE_EXISTING 2
1073 #define CERT_STORE_ADD_REPLACE_EXISTING 3
1074 #define CERT_STORE_ADD_ALWAYS 4
1075 #define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5
1076 #define CERT_STORE_ADD_NEWER 6
1077 #define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES 7
1079 #define CRYPT_ACQUIRE_CACHE_FLAG 0x00000001
1080 #define CRYPT_ACQUIRE_USE_PROV_INFO_FLAG 0x00000002
1081 #define CRYPT_ACQUIRE_COMPARE_KEY_FLAG 0x00000004
1082 #define CRYPT_ACQUIRE_SILENT_FLAG 0x00000040
1084 // dwFlags definitions for CryptAcquireContext
1085 #define CRYPT_VERIFYCONTEXT 0xF0000000
1086 #define CRYPT_NEWKEYSET 0x00000008
1087 #define CRYPT_DELETEKEYSET 0x00000010
1088 #define CRYPT_MACHINE_KEYSET 0x00000020
1089 #define CRYPT_SILENT 0x00000040
1091 // dwFlag definitions for CryptGenKey
1092 #define CRYPT_EXPORTABLE 0x00000001
1093 #define CRYPT_USER_PROTECTED 0x00000002
1094 #define CRYPT_CREATE_SALT 0x00000004
1095 #define CRYPT_UPDATE_KEY 0x00000008
1096 #define CRYPT_NO_SALT 0x00000010
1097 #define CRYPT_PREGEN 0x00000040
1098 #define CRYPT_RECIPIENT 0x00000010
1099 #define CRYPT_INITIATOR 0x00000040
1100 #define CRYPT_ONLINE 0x00000080
1101 #define CRYPT_SF 0x00000100
1102 #define CRYPT_CREATE_IV 0x00000200
1103 #define CRYPT_KEK 0x00000400
1104 #define CRYPT_DATA_KEY 0x00000800
1105 #define CRYPT_VOLATILE 0x00001000
1106 #define CRYPT_SGCKEY 0x00002000
1107 #define CRYPT_ARCHIVABLE 0x00004000
1109 #define RSA1024BIT_KEY 0x04000000
1111 // dwFlags definitions for CryptDeriveKey
1112 #define CRYPT_SERVER 0x00000400
1114 #define KEY_LENGTH_MASK 0xFFFF0000
1116 // dwFlag definitions for CryptExportKey
1117 #define CRYPT_Y_ONLY 0x00000001
1118 #define CRYPT_SSL2_FALLBACK 0x00000002
1119 #define CRYPT_DESTROYKEY 0x00000004
1120 #define CRYPT_OAEP 0x00000040 // used with RSA encryptions/decryptions
1121 // CryptExportKey, CryptImportKey,
1122 // CryptEncrypt and CryptDecrypt
1124 #define CRYPT_BLOB_VER3 0x00000080 // export version 3 of a blob type
1125 #define CRYPT_IPSEC_HMAC_KEY 0x00000100 // CryptImportKey only
1127 // dwFlags definitions for CryptDecrypt
1128 // See also CRYPT_OAEP, above.
1129 // Note, the following flag is not supported for CryptEncrypt
1130 #define CRYPT_DECRYPT_RSA_NO_PADDING_CHECK 0x00000020
1132 // dwFlags definitions for CryptCreateHash
1133 #define CRYPT_SECRETDIGEST 0x00000001
1135 // dwFlags definitions for CryptHashData
1136 #define CRYPT_OWF_REPL_LM_HASH 0x00000001 // this is only for the OWF replacement CSP
1138 // dwFlags definitions for CryptHashSessionKey
1139 #define CRYPT_LITTLE_ENDIAN 0x00000001
1141 // dwFlags definitions for CryptSignHash and CryptVerifySignature
1142 #define CRYPT_NOHASHOID 0x00000001
1143 #define CRYPT_TYPE2_FORMAT 0x00000002
1144 #define CRYPT_X931_FORMAT 0x00000004
1146 // dwFlag definitions for CryptSetProviderEx and CryptGetDefaultProvider
1147 #define CRYPT_MACHINE_DEFAULT 0x00000001
1148 #define CRYPT_USER_DEFAULT 0x00000002
1149 #define CRYPT_DELETE_DEFAULT 0x00000004
1152 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
1154 //End of crypto key provider information structures
1156 BOOL WINAPI
CertCloseStore(HCERTSTORE
,DWORD
);
1157 BOOL WINAPI
CertGetCertificateChain(HCERTCHAINENGINE
,PCCERT_CONTEXT
,LPFILETIME
,HCERTSTORE
,PCERT_CHAIN_PARA
,DWORD
,LPVOID
,PCCERT_CHAIN_CONTEXT
*);
1158 BOOL WINAPI
CertVerifyCertificateChainPolicy(LPCSTR
,PCCERT_CHAIN_CONTEXT
,PCERT_CHAIN_POLICY_PARA
,PCERT_CHAIN_POLICY_STATUS
);
1159 void WINAPI
CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT
);
1160 DWORD WINAPI
CertNameToStrA(DWORD
,PCERT_NAME_BLOB
,DWORD
,LPSTR
,DWORD
);
1161 DWORD WINAPI
CertNameToStrW(DWORD
,PCERT_NAME_BLOB
,DWORD
,LPWSTR
,DWORD
);
1162 HCERTSTORE WINAPI
CertOpenSystemStoreA(HCRYPTPROV
,LPCSTR
);
1163 HCERTSTORE WINAPI
CertOpenSystemStoreW(HCRYPTPROV
,LPCWSTR
);
1164 HCERTSTORE WINAPI
CertOpenStore(LPCSTR
,DWORD
,HCRYPTPROV
,DWORD
,const void*);
1165 PCCERT_CONTEXT WINAPI
CertFindCertificateInStore(HCERTSTORE
,DWORD
,DWORD
,DWORD
,const void*,PCCERT_CONTEXT
);
1166 BOOL WINAPI
CertFreeCertificateContext(PCCERT_CONTEXT
);
1167 PCCERT_CONTEXT WINAPI
CertGetIssuerCertificateFromStore(HCERTSTORE
,PCCERT_CONTEXT
,PCCERT_CONTEXT
,DWORD
*);
1168 PCCERT_CHAIN_CONTEXT WINAPI
CertFindChainInStore(HCERTSTORE
,DWORD
,DWORD
,DWORD
,const void*,PCCERT_CHAIN_CONTEXT
);
1170 HCERTSTORE WINAPI
CertDuplicateStore(HCERTSTORE
);
1171 PCCERT_CONTEXT WINAPI
CertEnumCertificatesInStore(HCERTSTORE
,PCCERT_CONTEXT
);
1172 PCCERT_CONTEXT WINAPI
CertDuplicateCertificateContext(PCCERT_CONTEXT
);
1173 DWORD WINAPI
CertGetNameStringA(PCCERT_CONTEXT
,DWORD
,DWORD
,void*,LPSTR
,DWORD
);
1174 DWORD WINAPI
CertGetNameStringW(PCCERT_CONTEXT
,DWORD
,DWORD
,void*,LPWSTR
,DWORD
);
1175 BOOL WINAPI
PFXIsPFXBlob(CRYPT_DATA_BLOB
*);
1176 PCERT_EXTENSION WINAPI
CertFindExtension(LPCSTR
,DWORD
,CERT_EXTENSION
*);
1177 BOOL WINAPI
CryptDecodeObject(DWORD
,LPCSTR
,const BYTE
*,DWORD
,DWORD
,void*,DWORD
*);
1178 BOOL WINAPI
CryptDecodeObjectEx(DWORD
,LPCSTR
,const BYTE
*,DWORD
,DWORD
,PCRYPT_DECODE_PARA
,void*,DWORD
*);
1179 BOOL WINAPI
CryptEncodeObject(DWORD dwCertEncodingType
,LPCSTR
,const void*,BYTE
*,DWORD
*);
1180 BOOL WINAPI
CryptEncodeObjectEx(DWORD
,LPCSTR
,const void*,DWORD
,PCRYPT_ENCODE_PARA
,void*,DWORD
*);
1181 BOOL WINAPI
CertAddCertificateContextToStore(HCERTSTORE
,PCCERT_CONTEXT
,DWORD
,PCCERT_CONTEXT
*);
1182 BOOL WINAPI
CertCompareCertificate(DWORD
,PCERT_INFO
,PCERT_INFO
);
1183 BOOL WINAPI
PFXVerifyPassword(CRYPT_DATA_BLOB
*,LPCWSTR
,DWORD
);
1184 HCERTSTORE WINAPI
PFXImportCertStore(CRYPT_DATA_BLOB
*,LPCWSTR
,DWORD
);
1185 BOOL WINAPI
CertDeleteCertificateFromStore(PCCERT_CONTEXT
);
1187 WINADVAPI BOOL WINAPI
CryptAcquireContextA(HCRYPTPROV
*,LPCSTR
,LPCSTR
,DWORD
,DWORD
);
1188 WINADVAPI BOOL WINAPI
CryptAcquireContextW(HCRYPTPROV
*,LPCWSTR
,LPCWSTR
,DWORD
,DWORD
);
1189 WINADVAPI BOOL WINAPI
CryptContextAddRef(HCRYPTPROV
,DWORD
*,DWORD
);
1190 WINADVAPI BOOL WINAPI
CryptReleaseContext(HCRYPTPROV
,DWORD
);
1191 WINADVAPI BOOL WINAPI
CryptGenKey(HCRYPTPROV
,ALG_ID
,DWORD
,HCRYPTKEY
*);
1192 WINADVAPI BOOL WINAPI
CryptDeriveKey(HCRYPTPROV
,ALG_ID
,HCRYPTHASH
,DWORD
,HCRYPTKEY
*);
1193 WINADVAPI BOOL WINAPI
CryptDestroyKey(HCRYPTKEY
);
1194 #if (WINVER >= 0x0500)
1195 WINADVAPI BOOL WINAPI
CryptDuplicateHash(HCRYPTHASH
,DWORD
*,DWORD
,HCRYPTHASH
*);
1196 WINADVAPI BOOL WINAPI
CryptDuplicateKey(HCRYPTKEY
,DWORD
*,DWORD
,HCRYPTKEY
*);
1198 WINADVAPI BOOL WINAPI
CryptSetKeyParam(HCRYPTKEY
,DWORD
,PBYTE
,DWORD
);
1199 WINADVAPI BOOL WINAPI
CryptGetKeyParam(HCRYPTKEY
,DWORD
,PBYTE
,PDWORD
,DWORD
);
1200 WINADVAPI BOOL WINAPI
CryptSetHashParam(HCRYPTHASH
,DWORD
,PBYTE
,DWORD
);
1201 WINADVAPI BOOL WINAPI
CryptGetHashParam(HCRYPTHASH
,DWORD
,PBYTE
,PDWORD
,DWORD
);
1202 WINADVAPI BOOL WINAPI
CryptSetProvParam(HCRYPTPROV
,DWORD
,PBYTE
,DWORD
);
1203 WINADVAPI BOOL WINAPI
CryptGetProvParam(HCRYPTPROV
,DWORD
,PBYTE
,PDWORD
,DWORD
);
1204 WINADVAPI BOOL WINAPI
CryptGenRandom(HCRYPTPROV
,DWORD
,PBYTE
);
1205 WINADVAPI BOOL WINAPI
CryptGetUserKey(HCRYPTPROV
,DWORD
,HCRYPTKEY
*);
1206 WINADVAPI BOOL WINAPI
CryptExportKey(HCRYPTKEY
,HCRYPTKEY
,DWORD
,DWORD
,PBYTE
,PDWORD
);
1207 WINADVAPI BOOL WINAPI
CryptImportKey(HCRYPTPROV
,PBYTE
,DWORD
,HCRYPTKEY
,DWORD
,HCRYPTKEY
*);
1208 WINADVAPI BOOL WINAPI
CryptEncrypt(HCRYPTKEY
,HCRYPTHASH
,BOOL
,DWORD
,PBYTE
,PDWORD
,DWORD
);
1209 WINADVAPI BOOL WINAPI
CryptDecrypt(HCRYPTKEY
,HCRYPTHASH
,BOOL
,DWORD
,PBYTE
,PDWORD
);
1210 WINADVAPI BOOL WINAPI
CryptCreateHash(HCRYPTPROV
,ALG_ID
,HCRYPTKEY
,DWORD
,HCRYPTHASH
*);
1211 WINADVAPI BOOL WINAPI
CryptHashData(HCRYPTHASH
,PBYTE
,DWORD
,DWORD
);
1212 WINADVAPI BOOL WINAPI
CryptHashSessionKey(HCRYPTHASH
,HCRYPTKEY
,DWORD
);
1213 WINADVAPI BOOL WINAPI
CryptGetHashValue(HCRYPTHASH
,DWORD
,PBYTE
,PDWORD
);
1214 WINADVAPI BOOL WINAPI
CryptDestroyHash(HCRYPTHASH
);
1215 WINADVAPI BOOL WINAPI
CryptSignHashA(HCRYPTHASH
,DWORD
,LPCSTR
,DWORD
,PBYTE
,PDWORD
);
1216 WINADVAPI BOOL WINAPI
CryptSignHashW(HCRYPTHASH
,DWORD
,LPCWSTR
,DWORD
,PBYTE
,PDWORD
);
1217 WINADVAPI BOOL WINAPI
CryptVerifySignatureA(HCRYPTHASH
,PBYTE
,DWORD
,HCRYPTKEY
,LPCSTR
,DWORD
);
1218 WINADVAPI BOOL WINAPI
CryptVerifySignatureW(HCRYPTHASH
,PBYTE
,DWORD
,HCRYPTKEY
,LPCWSTR
,DWORD
);
1219 WINADVAPI BOOL WINAPI
CryptSetProviderA(LPCSTR
,DWORD
);
1220 WINADVAPI BOOL WINAPI
CryptSetProviderW(LPCWSTR
,DWORD
);
1223 #define CertGetNameString CertGetNameStringW
1225 #define CertGetNameString CertGetNameStringA
1229 #define CertNameToStr CertNameToStrW
1230 #define CryptAcquireContext CryptAcquireContextW
1231 #define CryptSignHash CryptSignHashW
1232 #define CryptVerifySignature CryptVerifySignatureW
1233 #define CryptSetProvider CryptSetProviderW
1234 #define CertOpenSystemStore CertOpenSystemStoreW
1235 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W
1236 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W
1237 #define MS_DEF_PROV MS_DEF_PROV_W
1238 #define MS_ENHANCED_PROV MS_ENHANCED_PROV_W
1239 #define MS_STRONG_PROV MS_STRONG_PROV_W
1240 #define MS_DEF_RSA_SIG_PROV MS_DEF_RSA_SIG_PROV_W
1241 #define MS_DEF_RSA_SCHANNEL_PROV MS_DEF_RSA_SCHANNEL_PROV_W
1242 #define MS_DEF_DSS_PROV MS_DEF_DSS_PROV_W
1243 #define MS_DEF_DSS_DH_PROV MS_DEF_DSS_DH_PROV_W
1244 #define MS_ENH_DSS_DH_PROV MS_ENH_DSS_DH_PROV_W
1245 #define MS_DEF_DH_SCHANNEL_PROV MS_DEF_DH_SCHANNEL_PROV_W
1246 #define MS_SCARD_PROV MS_SCARD_PROV_W
1247 #if (_WIN32_WINNT >= 0x0501)
1248 #define MS_ENH_RSA_AES_PROV MS_ENH_RSA_AES_PROV_W
1251 #define CertNameToStr CertNameToStrA
1252 #define CryptAcquireContext CryptAcquireContextA
1253 #define CryptSignHash CryptSignHashA
1254 #define CryptVerifySignature CryptVerifySignatureA
1255 #define CryptSetProvider CryptSetProviderA
1256 #define CertOpenSystemStore CertOpenSystemStoreA
1257 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_A
1258 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_A
1259 #define MS_DEF_PROV MS_DEF_PROV_A
1260 #define MS_ENHANCED_PROV MS_ENHANCED_PROV_A
1261 #define MS_STRONG_PROV MS_STRONG_PROV_A
1262 #define MS_DEF_RSA_SIG_PROV MS_DEF_RSA_SIG_PROV_A
1263 #define MS_DEF_RSA_SCHANNEL_PROV MS_DEF_RSA_SCHANNEL_PROV_A
1264 #define MS_DEF_DSS_PROV MS_DEF_DSS_PROV_A
1265 #define MS_DEF_DSS_DH_PROV MS_DEF_DSS_DH_PROV_A
1266 #define MS_ENH_DSS_DH_PROV MS_ENH_DSS_DH_PROV_A
1267 #define MS_DEF_DH_SCHANNEL_PROV MS_DEF_DH_SCHANNEL_PROV_A
1268 #define MS_SCARD_PROV MS_SCARD_PROV_A
1269 #if (_WIN32_WINNT >= 0x0501)
1270 #define MS_ENH_RSA_AES_PROV MS_ENH_RSA_AES_PROV_A
1273 /* from http://msdn2.microsoft.com/en-us/library/Aa380263.aspx: */
1274 typedef struct _CRYPTPROTECT_PROMPTSTRUCT
{
1276 DWORD dwPromptFlags
;
1279 } CRYPTPROTECT_PROMPTSTRUCT
,
1280 *PCRYPTPROTECT_PROMPTSTRUCT
;
1283 /* from http://msdn2.microsoft.com/en-us/library/aa380261.aspx */
1284 BOOL WINAPI
CryptProtectData (DATA_BLOB
*, LPCWSTR
, DATA_BLOB
*, PVOID
, CRYPTPROTECT_PROMPTSTRUCT
*, DWORD
, DATA_BLOB
*);
1286 /* http://msdn2.microsoft.com/en-us/library/aa380882.aspx */
1287 BOOL WINAPI
CryptUnprotectData (DATA_BLOB
*, LPWSTR
*, DATA_BLOB
*, PVOID
, CRYPTPROTECT_PROMPTSTRUCT
*, DWORD
, DATA_BLOB
*);
1289 /* from http://msdn2.microsoft.com/en-us/library/aa302402.aspx: */
1290 #define CRYPTPROTECT_UI_FORBIDDEN 0x1
1291 #define CRYPTPROTECT_LOCAL_MACHINE 0x4
1294 typedef BOOL (WINAPI
*PFN_CRYPT_ENUM_KEYID_PROP
)(const CRYPT_HASH_BLOB
*, DWORD
, void *, void *, DWORD
,DWORD
,void **,DWORD
);
1296 BOOL WINAPI
CertGetCertificateContextProperty (PCCERT_CONTEXT
, DWORD
, void *, DWORD
*);
1297 BOOL WINAPI
CryptEnumKeyIdentifierProperties (const CRYPT_HASH_BLOB
*, DWORD
, DWORD
, LPCWSTR
, void *, void *, PFN_CRYPT_ENUM_KEYID_PROP
);
1298 BOOL WINAPI
CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT
, DWORD
, void *, HCRYPTPROV
*, DWORD
*, BOOL
*);
1299 PCCERT_CONTEXT WINAPI
CertCreateCertificateContext (DWORD
, const BYTE
*, DWORD
);
1300 BOOL WINAPI
CryptGetKeyIdentifierProperty( const CRYPT_HASH_BLOB
*, DWORD
, DWORD
, LPCWSTR
, void *, void *, DWORD
*);
1301 BOOL WINAPI
CertSetCertificateContextProperty( PCCERT_CONTEXT
, DWORD
, DWORD
, void *);
1302 BOOL WINAPI
CertCompareCertificateName( DWORD
, PCERT_NAME_BLOB
, PCERT_NAME_BLOB
);
1303 BOOL WINAPI
CryptSetKeyIdentifierProperty (const CRYPT_HASH_BLOB
*, DWORD
, DWORD
, LPCWSTR
, void *, void *);
1304 DWORD WINAPI
CertOIDToAlgId( LPCSTR
);
1305 BOOL WINAPI
CryptGetDefaultProviderA(DWORD
,DWORD
,DWORD
,LPSTR
,DWORD
);
1306 BOOL WINAPI
CryptGetDefaultProviderW(DWORD
,DWORD
,DWORD
,LPSTR
,DWORD
);
1309 #define CryptGetDefaultProvider CryptGetDefaultProviderW
1311 #define CryptGetDefaultProvider CryptGetDefaultProviderA
1318 #endif /* _WINCRYPT_H */