463df7d638ef8dea15ae23e851722eee45cc279e
[reactos.git] / reactos / w32api / include / wincrypt.h
1 #ifndef _WINCRYPT_H
2 #define _WINCRYPT_H
3 #if __GNUC__ >= 3
4 #pragma GCC system_header
5 #endif
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
11 #define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
12 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
13 #define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
14 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
15 #define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
16 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
17 #define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
18 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
19 #define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
20 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
21 #define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
22 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
23 #define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
24 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
25 #define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
26 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
27 #define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
28 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Crypto Provider"
29 #define MS_SCARD_PROV_W L"Microsoft Base Smart Card Crypto Provider"
30 #define GET_ALG_CLASS(x) (x&57344)
31 #define GET_ALG_TYPE(x) (x&7680)
32 #define GET_ALG_SID(x) (x&511)
33 #define ALG_CLASS_ANY 0
34 #define ALG_CLASS_SIGNATURE 8192
35 #define ALG_CLASS_MSG_ENCRYPT 16384
36 #define ALG_CLASS_DATA_ENCRYPT 24576
37 #define ALG_CLASS_HASH 32768
38 #define ALG_CLASS_KEY_EXCHANGE 40960
39 #define ALG_CLASS_ALL 57344 /* (7 << 13) */
40 #define ALG_TYPE_ANY 0
41 #define ALG_TYPE_DSS 512
42 #define ALG_TYPE_RSA 1024
43 #define ALG_TYPE_BLOCK 1536
44 #define ALG_TYPE_STREAM 2048
45 #define ALG_TYPE_DH 2560 /* (5 << 9) */
46 #define ALG_TYPE_SECURECHANNEL 3072 /* (6 << 9) */
47 #define ALG_SID_ANY 0
48 #define ALG_SID_RSA_ANY 0
49 #define ALG_SID_RSA_PKCS 1
50 #define ALG_SID_RSA_MSATWORK 2
51 #define ALG_SID_RSA_ENTRUST 3
52 #define ALG_SID_RSA_PGP 4
53 #define ALG_SID_DSS_ANY 0
54 #define ALG_SID_DSS_PKCS 1
55 #define ALG_SID_DSS_DMS 2
56 #define ALG_SID_DES 1
57 #define ALG_SID_3DES 3
58 #define ALG_SID_DESX 4
59 #define ALG_SID_IDEA 5
60 #define ALG_SID_CAST 6
61 #define ALG_SID_SAFERSK64 7
62 #define ALG_SID_SAFERSK128 8
63 #define ALG_SID_3DES_112 9
64 #define ALG_SID_SKIPJACK 10
65 #define ALG_SID_TEK 11
66 #define ALG_SID_CYLINK_MEK 12
67 #define ALG_SID_RC5 13
68 #define ALG_SID_RC2 2
69 #define ALG_SID_RC4 1
70 #define ALG_SID_SEAL 2
71 #define ALG_SID_MD2 1
72 #define ALG_SID_MD4 2
73 #define ALG_SID_MD5 3
74 #define ALG_SID_SHA 4
75 #define ALG_SID_MAC 5
76 #define ALG_SID_RIPEMD 6
77 #define ALG_SID_RIPEMD160 7
78 #define ALG_SID_SSL3SHAMD5 8
79 #define ALG_SID_HMAC 9
80 #define ALG_SID_TLS1PRF 10
81 #define ALG_SID_EXAMPLE 80
82
83 /* some typedefs for function parameters */
84 typedef unsigned int ALG_ID;
85 typedef unsigned long HCRYPTPROV;
86 typedef unsigned long HCRYPTKEY;
87 typedef unsigned long HCRYPTHASH;
88 typedef void *HCERTSTORE;
89 typedef void *HCRYPTMSG;
90 typedef void *HCERTSTOREPROV;
91 typedef void *HCRYPTOIDFUNCSET;
92 typedef void *HCRYPTOIDFUNCADDR;
93
94 #define CALG_MD2 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD2)
95 #define CALG_MD4 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD4)
96 #define CALG_MD5 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD5)
97 #define CALG_SHA (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_SHA)
98 #define CALG_MAC (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MAC)
99 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|3)
100 #define CALG_CYLINK_MEK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|12)
101 #define CALG_SKIPJACK (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|10)
102 #define CALG_KEA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_STREAM|ALG_TYPE_DSS|4)
103 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE|ALG_TYPE_RSA|ALG_SID_RSA_ANY)
104 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE|ALG_TYPE_DSS|ALG_SID_DSS_ANY)
105 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA_ANY)
106 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DES)
107 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC2)
108 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_RC4)
109 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_SEAL)
110 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_STREAM|ALG_TYPE_DSS|ALG_SID_DSS_DMS)
111 #define CALG_DESX (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX)
112 #define CALG_TLS1PRF (ALG_CLASS_DHASH|ALG_TYPE_ANY|ALG_SID_TLS1PRF)
113
114 /* physical store dwFlags, also used by CertAddStoreToCollection as
115 * dwUpdateFlags
116 */
117 #define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1
118 #define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2
119 #define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4
120 #define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8
121
122 /* dwFlag values for CertEnumPhysicalStore callback */
123 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
124
125 /* predefined store names */
126 #if defined(__GNUC__)
127 # define CERT_PHYSICAL_STORE_DEFAULT_NAME (const WCHAR[])\
128 {'.','D','e','f','a','u','l','t','0'}
129 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME (const WCHAR[])\
130 {'.','G','r','o','u','p','P','o','l','i','c','y',0}
131 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME (const WCHAR[])\
132 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0}
133 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME (const WCHAR[])\
134 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0}
135 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME (const WCHAR[])\
136 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',\
137 'P','o','l','i','c','y',0}
138 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME (const WCHAR[])\
139 {'.','E','n','t','e','r','p','r','i','s','e',0}
140 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME (const WCHAR[])\
141 {'.','A','u','t','h','R','o','o','t',0}
142 #elif defined(_MSC_VER)
143 # define CERT_PHYSICAL_STORE_DEFAULT_NAME \
144 L".Default"
145 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \
146 L".GroupPolicy"
147 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \
148 L".LocalMachine"
149 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \
150 L".UserCertificate"
151 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
152 L".LocalMachineGroupPolicy"
153 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \
154 L".Enterprise"
155 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \
156 L".AuthRoot"
157 #else
158 static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] =
159 {'.','D','e','f','a','u','l','t','0'};
160 static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME[] =
161 {'.','G','r','o','u','p','P','o','l','i','c','y',0};
162 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME[] =
163 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0};
164 static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME[] =
165 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0};
166 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME[] =
167 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',
168 'P','o','l','i','c','y',0};
169 static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME[] =
170 {'.','E','n','t','e','r','p','r','i','s','e',0};
171 static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME[] =
172 {'.','A','u','t','h','R','o','o','t',0};
173 #endif
174
175 /* system store locations */
176 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000
177 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
178
179 /* system store location ids */
180 /* hkcu */
181 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
182 /* hklm */
183 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
184 /* hklm\Software\Microsoft\Cryptography\Services */
185 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
186 #define CERT_SYSTEM_STORE_SERVICES_ID 5
187 /* HKEY_USERS */
188 #define CERT_SYSTEM_STORE_USERS_ID 6
189 /* hkcu\Software\Policies\Microsoft\SystemCertificates */
190 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7
191 /* hklm\Software\Policies\Microsoft\SystemCertificates */
192 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8
193 /* hklm\Software\Microsoft\EnterpriseCertificates */
194 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9
195
196 /* system store location values */
197 #define CERT_SYSTEM_STORE_CURRENT_USER \
198 (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
199 #define CERT_SYSTEM_STORE_LOCAL_MACHINE \
200 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
201 #define CERT_SYSTEM_STORE_CURRENT_SERVICE \
202 (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
203 #define CERT_SYSTEM_STORE_SERVICES \
204 (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
205 #define CERT_SYSTEM_STORE_USERS \
206 (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
207 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \
208 (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
209 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \
210 (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
211 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \
212 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
213
214 #if defined(__GNUC__)
215 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH (const WCHAR[])\
216 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t',\
217 '\\','S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',\
218 0 }
219 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH (const WCHAR[])\
220 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',\
221 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',\
222 't','i','f','i','c','a','t','e','s',0 }
223 #elif defined(_MSC_VER)
224 #define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \
225 L"Software\\Microsoft\\SystemCertificates"
226 #define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH \
227 L"Software\\Policies\\Microsoft\\SystemCertificates"
228 #else
229 static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] =
230 {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
231 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0 };
232 static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] =
233 {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\\',
234 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e','r',
235 't','i','f','i','c','a','t','e','s',0 };
236 #endif
237
238 /* flags for CertOpenStore dwFlags */
239 #define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001
240 #define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002
241 #define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004
242 #define CERT_STORE_DELETE_FLAG 0x00000010
243 #define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020
244 #define CERT_STORE_SHARE_STORE_FLAG 0x00000040
245 #define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080
246 #define CERT_STORE_MANIFOLD_FLAG 0x00000100
247 #define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200
248 #define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400
249 #define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800
250 #define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000
251 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000
252 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
253 #define CERT_STORE_READONLY_FLAG 0x00008000
254
255 /* dwAddDisposition */
256 #define CERT_STORE_ADD_NEW 1
257 #define CERT_STORE_ADD_USE_EXISTING 2
258 #define CERT_STORE_ADD_REPLACE_EXISTING 3
259 #define CERT_STORE_ADD_ALWAYS 4
260 #define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5
261 #define CERT_STORE_ADD_NEWER 6
262 #define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES 7
263
264 /* cert store provider types */
265 #define CERT_STORE_PROV_MSG ((LPCSTR)1)
266 #define CERT_STORE_PROV_MEMORY ((LPCSTR)2)
267 #define CERT_STORE_PROV_FILE ((LPCSTR)3)
268 #define CERT_STORE_PROV_REG ((LPCSTR)4)
269 #define CERT_STORE_PROV_PKCS7 ((LPCSTR)5)
270 #define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6)
271 #define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7)
272 #define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8)
273 #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9)
274 #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10)
275 #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
276 #define CERT_STORE_PROV_COLLECTION ((LPCSTR)11)
277 #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12)
278 #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13)
279 #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
280 #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14)
281 #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
282 #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15)
283 #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
284 #define CERT_STORE_PROV_LDAP_W ((LPCSTR)16)
285 #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
286
287 #define sz_CERT_STORE_PROV_MEMORY "Memory"
288 #define sz_CERT_STORE_PROV_FILENAME_W "File"
289 #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
290 #define sz_CERT_STORE_PROV_SYSTEM_W "System"
291 #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
292 #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
293 #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
294 #define sz_CERT_STORE_PROV_COLLECTION "Collection"
295 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
296 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
297 #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
298 #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
299 #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
300 #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
301 #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
302 #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
303
304 #define CRYPT_VERIFYCONTEXT 0xF0000000
305 #define CRYPT_NEWKEYSET 8
306 #define CRYPT_DELETEKEYSET 16
307 #define CRYPT_MACHINE_KEYSET 32
308 #define CRYPT_SILENT 64
309 #define CRYPT_EXPORTABLE 1
310 #define CRYPT_USER_PROTECTED 2
311 #define CRYPT_CREATE_SALT 4
312 #define CRYPT_UPDATE_KEY 8
313 #define SIMPLEBLOB 1
314 #define PUBLICKEYBLOB 6
315 #define PRIVATEKEYBLOB 7
316 #define PLAINTEXTKEYBLOB 8
317 #define OPAQUEKEYBLOB 9
318 #define PUBLICKEYBLOBEX 10
319 #define SYMMETRICWRAPKEYBLOB 11
320 #define AT_KEYEXCHANGE 1
321 #define AT_SIGNATURE 2
322 #define CRYPT_USERDATA 1
323 #define PKCS5_PADDING 1
324 #define CRYPT_MODE_CBC 1
325 #define CRYPT_MODE_ECB 2
326 #define CRYPT_MODE_OFB 3
327 #define CRYPT_MODE_CFB 4
328 #define CRYPT_MODE_CTS 5
329 #define CRYPT_MODE_CBCI 6
330 #define CRYPT_MODE_CFBP 7
331 #define CRYPT_MODE_OFBP 8
332 #define CRYPT_MODE_CBCOFM 9
333 #define CRYPT_MODE_CBCOFMI 10
334 #define CRYPT_ENCRYPT 1
335 #define CRYPT_DECRYPT 2
336 #define CRYPT_EXPORT 4
337 #define CRYPT_READ 8
338 #define CRYPT_WRITE 16
339 #define CRYPT_MAC 32
340 /* Crypt{Get|Set}Provider */
341 #define CRYPT_MACHINE_DEFAULT 0x00000001
342 #define CRYPT_USER_DEFAULT 0x00000002
343 #define CRYPT_DELETE_DEFAULT 0x00000004
344
345 /* cert system store flags */
346 #define CERT_SYSTEM_STORE_MASK 0xffff0000
347 #define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000
348
349 /* CertFindChainInStore dwFindType types */
350 #define CERT_CHAIN_FIND_BY_ISSUER 1
351
352 /* CERT_INFO versions/flags */
353 #define CERT_V1 0
354 #define CERT_V2 1
355 #define CERT_V3 2
356 #define CERT_INFO_VERSION_FLAG 1
357 #define CERT_INFO_SERIAL_NUMBER_FLAG 2
358 #define CERT_INFO_SIGNATURE_ALGORITHM_FLAG 3
359 #define CERT_INFO_ISSUER_FLAG 4
360 #define CERT_INFO_NOT_BEFORE_FLAG 5
361 #define CERT_INFO_NOT_AFTER_FLAG 6
362 #define CERT_INFO_SUBJECT_FLAG 7
363 #define CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG 8
364 #define CERT_INFO_ISSUER_UNIQUE_ID_FLAG 9
365 #define CERT_INFO_SUBJECT_UNIQUE_ID_FLAG 10
366 #define CERT_INFO_EXTENSION_FLAG 11
367
368 /* CERT_REQUEST_INFO versions */
369 #define CERT_REQUEST_V1 0
370
371 /* CERT_KEYGEN_REQUEST_INFO versions */
372 #define CERT_KEYGEN_REQUEST_V1 0
373
374 /* CRL versions */
375 #define CRL_V1 0
376 #define CRL_V2 1
377
378 /* CTL versions */
379 #define CTL_V1 0
380
381 /* Certificate, CRL, CTL property IDs */
382 #define CERT_KEY_PROV_HANDLE_PROP_ID 1
383 #define CERT_KEY_PROV_INFO_PROP_ID 2
384 #define CERT_SHA1_HASH_PROP_ID 3
385 #define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID
386 #define CERT_MD5_HASH_PROP_ID 4
387 #define CERT_KEY_CONTEXT_PROP_ID 5
388 #define CERT_KEY_SPEC_PROP_ID 6
389 #define CERT_IE30_RESERVED_PROP_ID 7
390 #define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8
391 #define CERT_ENHKEY_USAGE_PROP_ID 9
392 #define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID
393 #define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10
394 #define CERT_FRIENDLY_NAME_PROP_ID 11
395 #define CERT_PVK_FILE_PROP_ID 12
396 #define CERT_DESCRIPTION_PROP_ID 13
397 #define CERT_ACCESS_STATE_PROP_ID 14
398 #define CERT_SIGNATURE_HASH_PROP_ID 15
399 #define CERT_SMART_CARD_DATA_PROP_ID 16
400 #define CERT_EFS_PROP_ID 17
401 #define CERT_FORTEZZA_DATA_PROP 18
402 #define CERT_ARCHIVED_PROP_ID 19
403 #define CERT_KEY_IDENTIFIER_PROP_ID 20
404 #define CERT_AUTO_ENROLL_PROP_ID 21
405 #define CERT_PUBKEY_ALG_PARA_PROP_ID 22
406 #define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23
407 #define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24
408 #define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25
409 #define CERT_ENROLLMENT_PROP_ID 26
410 #define CERT_DATE_STAMP_PROP_ID 27
411 #define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28
412 #define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29
413 #define CERT_EXTENDED_ERROR_INFO_PROP_ID 30
414 /* 31 -- unused?
415 32 -- cert prop id
416 33 -- CRL prop id
417 34 -- CTL prop id
418 35 -- KeyId prop id
419 36-63 -- reserved
420 */
421 #define CERT_RENEWAL_PROP_ID 64
422 #define CERT_ARCHIVED_KEY_HASH_PROP_ID 65
423 #define CERT_AUTO_ENROLL_RETRY_PROP_ID 66
424 #define CERT_AIA_URL_RETRIEVED_PROP_ID 67
425 #define CERT_FIRST_RESERVED_PROP_ID 68
426 #define CERT_LAST_RESERVED_PROP_ID 0x00007fff
427 #define CERT_FIRST_USER_PROP_ID 0x00008000
428 #define CERT_LAST_USER_PROP_ID 0x0000ffff
429
430 /* Algorithm IDs */
431
432 #define GET_ALG_CLASS(x) (x & (7 << 13))
433 #define GET_ALG_TYPE(x) (x & (15 << 9))
434 #define GET_ALG_SID(x) (x & (511))
435
436 /* Algorithm Classes */
437 #define ALG_CLASS_ANY (0)
438 #define ALG_CLASS_SIGNATURE (1 << 13)
439 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
440 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
441 #define ALG_CLASS_HASH (4 << 13)
442 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
443 /* Algorithm types */
444 #define ALG_TYPE_ANY (0)
445 #define ALG_TYPE_DSS (1 << 9)
446 #define ALG_TYPE_RSA (2 << 9)
447 #define ALG_TYPE_BLOCK (3 << 9)
448 #define ALG_TYPE_STREAM (4 << 9)
449 #define ALG_TYPE_DH (5 << 9)
450 #define ALG_TYPE_SECURECHANNEL (6 << 9)
451
452 /* SIDs */
453 #define ALG_SID_ANY (0)
454 /* RSA SIDs */
455 #define ALG_SID_RSA_ANY 0
456 #define ALG_SID_RSA_PKCS 1
457 #define ALG_SID_RSA_MSATWORK 2
458 #define ALG_SID_RSA_ENTRUST 3
459 #define ALG_SID_RSA_PGP 4
460 /* DSS SIDs */
461 #define ALG_SID_DSS_ANY 0
462 #define ALG_SID_DSS_PKCS 1
463 #define ALG_SID_DSS_DMS 2
464
465 /* DES SIDs */
466 #define ALG_SID_DES 1
467 #define ALG_SID_3DES 3
468 #define ALG_SID_DESX 4
469 #define ALG_SID_IDEA 5
470 #define ALG_SID_CAST 6
471 #define ALG_SID_SAFERSK64 7
472 #define ALG_SID_SAFERSK128 8
473 #define ALG_SID_3DES_112 9
474 /* Diffie-Hellmans SIDs */
475 #define ALG_SID_DH_SANDF 1
476 #define ALG_SID_DH_EPHEM 2
477 #define ALG_SID_AGREED_KEY_ANY 3
478 #define ALG_SID_KEA 4
479 /* RC2 SIDs */
480 #define ALG_SID_RC4 1
481 #define ALG_SID_RC2 2
482 #define ALG_SID_SEAL 2
483 /* Hash SIDs */
484 #define ALG_SID_MD2 1
485 #define ALG_SID_MD4 2
486 #define ALG_SID_MD5 3
487 #define ALG_SID_SHA 4
488 #define ALG_SID_SHA1 CALG_SHA
489 #define ALG_SID_MAC 5
490 #define ALG_SID_RIPEMD 6
491 #define ALG_SID_RIPEMD160 7
492 #define ALG_SID_SSL3SHAMD5 8
493 #define ALG_SID_HMAC 9
494 #define ALG_SID_TLS1PRF 10
495 /* SCHANNEL SIDs */
496 #define ALG_SID_SSL3_MASTER 1
497 #define ALG_SID_SCHANNEL_MASTER_HASH 2
498 #define ALG_SID_SCHANNEL_MAC_KEY 3
499 #define ALG_SID_PCT1_MASTER 4
500 #define ALG_SID_SSL2_MASTER 5
501 #define ALG_SID_TLS1_MASTER 6
502 #define ALG_SID_SCHANNEL_ENC_KEY 7
503 #define ALG_SID_EXAMPLE 80
504
505 /* Algorithm Definitions */
506 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
507 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
508 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
509 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
510 #define CALG_SHA1 CALG_SHA
511 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
512 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
513 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
514 #define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
515 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
516 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
517 #define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF)
518 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM)
519 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
520 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
521 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
522 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES)
523 #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112)
524 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
525 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
526 #define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER)
527 #define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH)
528 #define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY)
529 #define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY)
530 #define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER)
531 #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER)
532 #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER)
533
534 /* CRL reason codes */
535 #define CRL_REASON_UNSPECIFIED 0
536 #define CRL_REASON_KEY_COMPROMISE 1
537 #define CRL_REASON_CA_COMPROMISE 2
538 #define CRL_REASON_AFFILIATION_CHANGED 3
539 #define CRL_REASON_SUPERSEDED 4
540 #define CRL_REASON_CESSATION_OF_OPERATION 5
541 #define CRL_REASON_CERTIFICATE_HOLD 6
542 #define CRL_REASON_REMOVE_FROM_CRL 8
543
544 /* CertControlStore control types */
545 #define CERT_STORE_CTRL_RESYNC 1
546 #define CERT_STORE_CTRL_NOTIFY_CHANGE 2
547 #define CERT_STORE_CTRL_COMMIT 3
548 #define CERT_STORE_CTRL_AUTO_RESYNC 4
549 #define CERT_STORE_CTRL_CANCEL_NOTIFY 5
550
551 #define CERT_STORE_CTRL_COMMIT_FORCE_FLAG 0x1
552 #define CERT_STORE_CTRL_COMMIT_CLEAR_FLAG 0x2
553
554 /* access state flags */
555 #define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1
556 #define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2
557 #define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4
558
559 /* PFN_CERT_STORE_PROV_WRITE_CERT dwFlags values */
560 #define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1
561
562 /* CertAddSerializedElementToStore context types */
563 #define CERT_STORE_CERTIFICATE_CONTEXT 1
564 #define CERT_STORE_CRL_CONTEXT 2
565 #define CERT_STORE_CTL_CONTEXT 3
566 #define CERT_STORE_ALL_CONTEXT_FLAG ~0U
567 #define CERT_STORE_CERTIFICATE_CONTEXT_FLAG \
568 (1 << CERT_STORE_CERTIFICATE_CONTEXT)
569 #define CERT_STORE_CRL_CONTEXT_FLAG (1 << CERT_STORE_CRL_CONTEXT)
570 #define CERT_STORE_CTL_CONTEXT_FLAG (1 << CERT_STORE_CTL_CONTEXT)
571
572 /* OIDs */
573 #define szOID_RSA "1.2.840.113549"
574 #define szOID_PKCS "1.2.840.113549.1"
575 #define szOID_RSA_HASH "1.2.840.113549.2"
576 #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
577 #define szOID_PKCS_1 "1.2.840.113549.1.1"
578 #define szOID_PKCS_2 "1.2.840.113549.1.2"
579 #define szOID_PKCS_3 "1.2.840.113549.1.3"
580 #define szOID_PKCS_4 "1.2.840.113549.1.4"
581 #define szOID_PKCS_5 "1.2.840.113549.1.5"
582 #define szOID_PKCS_6 "1.2.840.113549.1.6"
583 #define szOID_PKCS_7 "1.2.840.113549.1.7"
584 #define szOID_PKCS_8 "1.2.840.113549.1.8"
585 #define szOID_PKCS_9 "1.2.840.113549.1.9"
586 #define szOID_PKCS_10 "1.2.840.113549.1.10"
587 #define szOID_PKCS_11 "1.2.840.113549.1.12"
588 #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
589 #define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA
590 #define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA
591 #define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA
592 #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
593 #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
594 #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
595 #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
596 #define szOID_RSA_SET0AEP_RSA "1.2.840.113549.1.1.6"
597 #define szOID_RSA_DH "1.2.840.113549.1.3.1"
598 #define szOID_RSA_data "1.2.840.113549.1.7.1"
599 #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
600 #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
601 #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
602 #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
603 #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
604 #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
605 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
606 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
607 #define szOID_RSA_contentType "1.2.840.113549.1.9.3"
608 #define szOID_RSA_messageDigest "1.2.840.113549.1.9.4"
609 #define szOID_RSA_signingTime "1.2.840.113549.1.9.5"
610 #define szOID_RSA_counterSign "1.2.840.113549.1.9.6"
611 #define szOID_RSA_challengePwd "1.2.840.113549.1.9.7"
612 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.9"
613 #define szOID_RSA_extCertAttrs "1.2.840.113549.1.9.9"
614 #define szOID_RSA_certExtensions "1.2.840.113549.1.9.14"
615 #define szOID_RSA_SMIMECapabilities "1.2.840.113549.1.9.15"
616 #define szOID_RSA_preferSignedData "1.2.840.113549.1.9.15.1"
617 #define szOID_RSA_SMIMEalg "1.2.840.113549.1.9.16.3"
618 #define szOID_RSA_SMIMEalgESDH "1.2.840.113549.1.9.16.3.5"
619 #define szOID_RSA_SMIMEalgCMS3DESwrap "1.2.840.113549.1.9.16.3.6"
620 #define szOID_RSA_SMIMEalgCMSRC2wrap "1.2.840.113549.1.9.16.3.7"
621 #define szOID_RSA_MD2 "1.2.840.113549.2.2"
622 #define szOID_RSA_MD4 "1.2.840.113549.2.4"
623 #define szOID_RSA_MD5 "1.2.840.113549.2.5"
624 #define szOID_RSA_RC2CBC "1.2.840.113549.3.2"
625 #define szOID_RSA_RC4 "1.2.840.113549.3.4"
626 #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
627 #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
628 #define szOID_ANSI_X942 "1.2.840.10046"
629 #define szOID_ANSI_X942_DH "1.2.840.10046.2.1"
630 #define szOID_X957 "1.2.840.10040"
631 #define szOID_X957_DSA "1.2.840.10040.4.1"
632 #define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
633 #define szOID_DS "2.5"
634 #define szOID_DSALG "2.5.8"
635 #define szOID_DSALG_CRPT "2.5.8.1"
636 #define szOID_DSALG_HASH "2.5.8.2"
637 #define szOID_DSALG_SIGN "2.5.8.3"
638 #define szOID_DSALG_RSA "2.5.8.1.1"
639 #define szOID_OIW "1.3.14"
640 #define szOID_OIWSEC "1.3.14.3.2"
641 #define szOID_OIWSEC_md4RSA "1.3.14.3.2.2"
642 #define szOID_OIWSEC_md5RSA "1.3.14.3.2.3"
643 #define szOID_OIWSEC_md4RSA2 "1.3.14.3.2.4"
644 #define szOID_OIWSEC_desECB "1.3.14.3.2.6"
645 #define szOID_OIWSEC_desCBC "1.3.14.3.2.7"
646 #define szOID_OIWSEC_desOFB "1.3.14.3.2.8"
647 #define szOID_OIWSEC_desCFB "1.3.14.3.2.9"
648 #define szOID_OIWSEC_desMAC "1.3.14.3.2.10"
649 #define szOID_OIWSEC_rsaSign "1.3.14.3.2.11"
650 #define szOID_OIWSEC_dsa "1.3.14.3.2.12"
651 #define szOID_OIWSEC_shaDSA "1.3.14.3.2.13"
652 #define szOID_OIWSEC_mdc2RSA "1.3.14.3.2.14"
653 #define szOID_OIWSEC_shaRSA "1.3.14.3.2.15"
654 #define szOID_OIWSEC_dhCommMod "1.3.14.3.2.16"
655 #define szOID_OIWSEC_desEDE "1.3.14.3.2.17"
656 #define szOID_OIWSEC_sha "1.3.14.3.2.18"
657 #define szOID_OIWSEC_mdc2 "1.3.14.3.2.19"
658 #define szOID_OIWSEC_dsaComm "1.3.14.3.2.20"
659 #define szOID_OIWSEC_dsaCommSHA "1.3.14.3.2.21"
660 #define szOID_OIWSEC_rsaXchg "1.3.14.3.2.22"
661 #define szOID_OIWSEC_keyHashSeal "1.3.14.3.2.23"
662 #define szOID_OIWSEC_md2RSASign "1.3.14.3.2.24"
663 #define szOID_OIWSEC_md5RSASign "1.3.14.3.2.25"
664 #define szOID_OIWSEC_sha1 "1.3.14.3.2.26"
665 #define szOID_OIWSEC_dsaSHA1 "1.3.14.3.2.27"
666 #define szOID_OIWSEC_dsaCommSHA1 "1.3.14.3.2.28"
667 #define szOID_OIWSEC_sha1RSASign "1.3.14.3.2.29"
668 #define szOID_OIWDIR "1.3.14.7.2"
669 #define szOID_OIWDIR_CRPT "1.3.14.7.2.1"
670 #define szOID_OIWDIR_HASH "1.3.14.7.2.2"
671 #define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
672 #define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
673 #define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
674 #define szOID_INFOSEC "2.16.840.1.101.2.1"
675 #define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
676 #define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
677 #define szOID_INFOSEC_sdnsConfidentiality "2.16.840.1.101.2.1.1.3"
678 #define szOID_INFOSEC_mosaicConfidentiality "2.16.840.1.101.2.1.1.4"
679 #define szOID_INFOSEC_sdnsIntegrity "2.16.840.1.101.2.1.1.5"
680 #define szOID_INFOSEC_mosaicIntegrity "2.16.840.1.101.2.1.1.6"
681 #define szOID_INFOSEC_sdnsTokenProtection "2.16.840.1.101.2.1.1.7"
682 #define szOID_INFOSEC_mosaicTokenProtection "2.16.840.1.101.2.1.1.8"
683 #define szOID_INFOSEC_sdnsKeyManagement "2.16.840.1.101.2.1.1.9"
684 #define szOID_INFOSEC_mosaicKeyManagement "2.16.840.1.101.2.1.1.10"
685 #define szOID_INFOSEC_sdnsKMandSig "2.16.840.1.101.2.1.1.11"
686 #define szOID_INFOSEC_mosaicKMandSig "2.16.840.1.101.2.1.1.12"
687 #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
688 #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
689 #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
690 #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
691 #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
692 #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
693 #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
694 #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
695 #define szOID_INFOSEC_mosaicUpdateInteg "2.16.840.1.101.2.1.1.21"
696 #define szOID_COMMON_NAME "2.5.4.3"
697 #define szOID_SUR_NAME "2.5.4.4"
698 #define szOID_DEVICE_SERIAL_NUMBER "2.5.4.5"
699 #define szOID_COUNTRY_NAME "2.5.4.6"
700 #define szOID_LOCALITY_NAME "2.5.4.7"
701 #define szOID_STATE_OR_PROVINCE_NAME "2.5.4.8"
702 #define szOID_STREET_ADDRESS "2.5.4.9"
703 #define szOID_ORGANIZATION_NAME "2.5.4.10"
704 #define szOID_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
705 #define szOID_TITLE "2.5.4.12"
706 #define szOID_DESCRIPTION "2.5.4.13"
707 #define szOID_SEARCH_GUIDE "2.5.4.14"
708 #define szOID_BUSINESS_CATEGORY "2.5.4.15"
709 #define szOID_POSTAL_ADDRESS "2.5.4.16"
710 #define szOID_POSTAL_CODE "2.5.4.17"
711 #define szOID_POST_OFFICE_BOX "2.5.4.18"
712 #define szOID_PHYSICAL_DELIVERY_OFFICE_NAME "2.5.4.19"
713 #define szOID_TELEPHONE_NUMBER "2.5.4.20"
714 #define szOID_TELEX_NUMBER "2.5.4.21"
715 #define szOID_TELETEXT_TERMINAL_IDENTIFIER "2.5.4.22"
716 #define szOID_FACSIMILE_TELEPHONE_NUMBER "2.5.4.23"
717 #define szOID_X21_ADDRESS "2.5.4.24"
718 #define szOID_INTERNATIONAL_ISDN_NUMBER "2.5.4.25"
719 #define szOID_REGISTERED_ADDRESS "2.5.4.26"
720 #define szOID_DESTINATION_INDICATOR "2.5.4.27"
721 #define szOID_PREFERRED_DELIVERY_METHOD "2.5.4.28"
722 #define szOID_PRESENTATION_ADDRESS "2.5.4.29"
723 #define szOID_SUPPORTED_APPLICATION_CONTEXT "2.5.4.30"
724 #define szOID_MEMBER "2.5.4.31"
725 #define szOID_OWNER "2.5.4.32"
726 #define szOID_ROLE_OCCUPANT "2.5.4.33"
727 #define szOID_SEE_ALSO "2.5.4.34"
728 #define szOID_USER_PASSWORD "2.5.4.35"
729 #define szOID_USER_CERTIFICATE "2.5.4.36"
730 #define szOID_CA_CERTIFICATE "2.5.4.37"
731 #define szOID_AUTHORITY_REVOCATION_LIST "2.5.4.38"
732 #define szOID_CERTIFICATE_REVOCATION_LIST "2.5.4.39"
733 #define szOID_CROSS_CERTIFICATE_PAIR "2.5.4.40"
734 #define szOID_GIVEN_NAME "2.5.4.42"
735 #define szOID_INITIALS "2.5.4.43"
736 #define szOID_DN_QUALIFIER "2.5.4.46"
737 #define szOID_AUTHORITY_KEY_IDENTIFIER "2.5.29.1"
738 #define szOID_KEY_ATTRIBUTES "2.5.29.2"
739 #define szOID_CERT_POLICIES_95 "2.5.29.3"
740 #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
741 #define szOID_LEGACY_POLICY_MAPPINGS "2.5.29.5"
742 #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
743 #define szOID_ISSUER_ALT_NAME "2.5.29.8"
744 #define szOID_SUBJECT_DIR_ATTRS "2.5.29.9"
745 #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
746 #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
747 #define szOID_KEY_USAGE "2.5.29.15"
748 #define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16"
749 #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
750 #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
751 #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
752 #define szOID_CRL_NUMBER "2.5.29.20"
753 #define szOID_CRL_REASON_CODE "2.5.29.21"
754 #define szOID_REASON_CODE_HOLD "2.5.29.23"
755 #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
756 #define szOID_ISSUING_DIST_POINT "2.5.29.28"
757 #define szOID_NAME_CONSTRAINTS "2.5.29.30"
758 #define szOID_CRL_DIST_POINTS "2.5.29.31"
759 #define szOID_CERT_POLICIES "2.5.29.32"
760 #define szOID_ANY_CERT_POLICY "2.5.29.32.0"
761 #define szOID_POLICY_MAPPINGS "2.5.29.33"
762 #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
763 #define szOID_POLICY_CONSTRAINTS "2.5.29.36"
764 #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
765 #define szOID_FRESHEST_CRL "2.5.29.46"
766 #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25"
767 #define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20"
768 #define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21"
769 #define szOID_CERT_EXTENSIONS "1.3.6.1.4.1.311.2.1.14"
770 #define szOID_NEXT_UPDATE_LOCATION "1.3.6.1.4.1.311.10.2"
771 #define szOID_REMOVE_CERTIFICATE "1.3.6.1.4.1.311.10.8.1"
772 #define szOID_CROSS_CERT_DIST_POINTS "1.3.6.1.4.1.311.10.9.1"
773 #define szOID_CTL "1.3.6.1.4.1.311.10.10.1"
774 #define szOID_SORTED_CTL "1.3.6.1.4.1.311.10.10.1.1"
775 #define szOID_ANY_APPLICATION_POLICY "1.3.6.1.4.1.311.10.12.1"
776 #define szOID_RENEWAL_CERTIFICATE "1.3.6.1.4.1.311.13.1"
777 #define szOID_ENROLLMENT_NAME_VALUE_PAIR "1.3.6.1.4.1.311.13.2.1"
778 #define szOID_ENROLLMENT_CSP_PROVIDER "1.3.6.1.4.1.311.13.2.2"
779 #define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3"
780 #define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1"
781 #define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2"
782 #define szOID_AUTO_ENROLL_CTL_USAGE "1.3.6.1.4.1.311.20.1"
783 #define szOID_ENROLL_CERTTYPE_EXTENSION "1.3.6.1.4.1.311.20.2"
784 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
785 #define szOID_CERT_MANIFOLD "1.3.6.1.4.1.311.20.3"
786 #define szOID_CERTSRV_PREVIOUS_CERT_HASH "1.3.6.1.4.1.311.21.2"
787 #define szOID_CRL_VIRTUAL_BASE "1.3.6.1.4.1.311.21.3"
788 #define szOID_CRL_NEXT_PUBLISH "1.3.6.1.4.1.311.21.4"
789 #define szOID_KP_CA_EXCHANGE "1.3.6.1.4.1.311.21.5"
790 #define szOID_KP_KEY_RECOVERY_AGENT "1.3.6.1.4.1.311.21.6"
791 #define szOID_CERTIFICATE_TEMPLATE "1.3.6.1.4.1.311.21.7"
792 #define szOID_ENTERPRISE_OID_ROOT "1.3.6.1.4.1.311.21.8"
793 #define szOID_RDN_DUMMY_SIGNER "1.3.6.1.4.1.311.21.9"
794 #define szOID_APPLICATION_CERT_POLICIES "1.3.6.1.4.1.311.21.10"
795 #define szOID_APPLICATION_POLICY_MAPPINGS "1.3.6.1.4.1.311.21.11"
796 #define szOID_APPLICATION_POLICY_CONSTRAINTS "1.3.6.1.4.1.311.21.12"
797 #define szOID_ARCHIVED_KEY_ATTR "1.3.6.1.4.1.311.21.13"
798 #define szOID_CRL_SELF_CDP "1.3.6.1.4.1.311.21.14"
799 #define szOID_REQUIRE_CERT_CHAIN_POLICY "1.3.6.1.4.1.311.21.15"
800 #define szOID_ARCHIVED_KEY_CERT_HASH "1.3.6.1.4.1.311.21.16"
801 #define szOID_ISSUED_CERT_HASH "1.3.6.1.4.1.311.21.17"
802 #define szOID_DS_EMAIL_REPLICATION "1.3.6.1.4.1.311.21.19"
803 #define szOID_REQUEST_CLIENT_INFO "1.3.6.1.4.1.311.21.20"
804 #define szOID_ENCRYPTED_KEY_HASH "1.3.6.1.4.1.311.21.21"
805 #define szOID_CERTSRV_CROSSCA_VERSION "1.3.6.1.4.1.311.21.22"
806 #define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1"
807 #define szOID_PKIX "1.3.6.1.5.5.7"
808 #define szOID_PKIX_PE "1.3.6.1.5.5.7.1"
809 #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
810 #define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1"
811 #define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2"
812 #define szOID_PKIX_KP "1.3.6.1.5.5.7.3"
813 #define szOID_PKIX_KP_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
814 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
815 #define szOID_PKIX_KP_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
816 #define szOID_PKIX_KP_EMAIL_PROTECTION "1.3.6.1.5.5.7.3.4"
817 #define szOID_PKIX_KP_IPSEC_END_SYSTEM "1.3.6.1.5.5.7.3.5"
818 #define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6"
819 #define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7"
820 #define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8"
821 #define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2"
822
823 #ifndef szOID_SERIALIZED
824 #define szOID_SERIALIZED "1.3.6.1.4.1.311.10.3.3.1"
825 #endif
826
827 #ifndef szOID_NT_PRINCIPAL_NAME
828 #define szOID_NT_PRINCIPAL_NAME "1.3.6.1.4.1.311.20.2.3"
829 #endif
830
831 #ifndef szOID_CERTSRV_CA_VERSION
832 #define szOID_CERTSRV_CA_VERSION "1.3.6.1.4.1.311.21.1"
833 #endif
834
835 #ifndef szOID_PRODUCT_UPDATE
836 #define szOID_PRODUCT_UPDATE "1.3.6.1.4.1.311.31.1"
837 #endif
838
839 #define CRYPT_ENCODE_DECODE_NONE 0
840 #define X509_CERT ((LPCSTR)1)
841 #define X509_CERT_TO_BE_SIGNED ((LPCSTR)2)
842 #define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR)3)
843 #define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR)4)
844 #define X509_EXTENSIONS ((LPCSTR)5)
845 #define X509_NAME_VALUE ((LPCSTR)6)
846 #define X509_ANY_STRING X509_NAME_VALUE
847 #define X509_NAME ((LPCSTR)7)
848 #define X509_PUBLIC_KEY_INFO ((LPCSTR)8)
849 #define X509_AUTHORITY_KEY_ID ((LPCSTR)9)
850 #define X509_KEY_ATTRIBUTES ((LPCSTR)10)
851 #define X509_KEY_USAGE_RESTRICTION ((LPCSTR)11)
852 #define X509_ALTERNATE_NAME ((LPCSTR)12)
853 #define X509_BASIC_CONSTRAINTS ((LPCSTR)13)
854 #define X509_KEY_USAGE ((LPCSTR)14)
855 #define X509_BASIC_CONSTRAINTS2 ((LPCSTR)15)
856 #define X509_CERT_POLICIES ((LPCSTR)16)
857 #define PKCS_UTC_TIME ((LPCSTR)17)
858 #define PKCS_TIME_REQUEST ((LPCSTR)18)
859 #define RSA_CSP_PUBLICKEYBLOB ((LPCSTR)19)
860 #define X509_UNICODE_NAME ((LPCSTR)20)
861 #define X509_KEYGEN_REQUEST_TO_BE_SIGNED ((LPCSTR)21)
862 #define PKCS_ATTRIBUTE ((LPCSTR)22)
863 #define PKCS_CONTENT_INFO_SEQUENCE_OF_ANY ((LPCSTR)23)
864 #define X509_UNICODE_NAME_VALUE ((LPCSTR)24)
865 #define X509_UNICODE_ANY_STRING X509_UNICODE_NAME_VALUE
866 #define X509_OCTET_STRING ((LPCSTR)25)
867 #define X509_BITS ((LPCSTR)26)
868 #define X509_INTEGER ((LPCSTR)27)
869 #define X509_MULTI_BYTE_INTEGER ((LPCSTR)28)
870 #define X509_ENUMERATED ((LPCSTR)29)
871 #define X509_CRL_REASON_CODE X509_ENUMERATED
872 #define X509_CHOICE_OF_TIME ((LPCSTR)30)
873 #define X509_AUTHORITY_KEY_ID2 ((LPCSTR)31)
874 #define X509_AUTHORITY_INFO_ACCESS ((LPCSTR)32)
875 #define PKCS_CONTENT_INFO ((LPCSTR)33)
876 #define X509_SEQUENCE_OF_ANY ((LPCSTR)34)
877 #define X509_CRL_DIST_POINTS ((LPCSTR)35)
878 #define X509_ENHANCED_KEY_USAGE ((LPCSTR)36)
879 #define PKCS_CTL ((LPCSTR)37)
880 #define X509_MULTI_BYTE_UINT ((LPCSTR)38)
881 #define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT
882 #define X509_DSS_PARAMETERS ((LPCSTR)39)
883 #define X509_DSS_SIGNATURE ((LPCSTR)40)
884 #define PKCS_RC2_CBC_PARAMETERS ((LPCSTR)41)
885 #define PKCS_SMIME_CAPABILITIES ((LPCSTR)42)
886 #define PKCS_RSA_PRIVATE_KEY ((LPCSTR)43)
887 #define PKCS_PRIVATE_KEY_INFO ((LPCSTR)44)
888 #define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR)45)
889 #define X509_PKIX_POLICY_QUALIFIER_USERNOTICE ((LPCSTR)46)
890 #define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
891 #define X509_DH_PARAMETERS ((LPCSTR)47)
892 #define PKCS_ATTRIBUTES ((LPCSTR)48)
893 #define PKCS_SORTED_CTL ((LPCSTR)49)
894 #define X942_DH_PARAMETERS ((LPCSTR)50)
895 #define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR)51)
896 #define X942_OTHER_INFO ((LPCSTR)52)
897 #define X509_CERT_PAIR ((LPCSTR)53)
898 #define X509_ISSUING_DIST_POINT ((LPCSTR)54)
899 #define X509_NAME_CONSTRAINTS ((LPCSTR)55)
900 #define X509_POLICY_MAPPINGS ((LPCSTR)56)
901 #define X509_POLICY_CONSTRAINTS ((LPCSTR)57)
902 #define X509_CROSS_CERT_DIST_POINTS ((LPCSTR)58)
903 #define CMC_DATA ((LPCSTR)59)
904 #define CMC_RESPONSE ((LPCSTR)60)
905 #define CMC_STATUS ((LPCSTR)61)
906 #define CMC_ADD_EXTENSIONS ((LPCSTR)62)
907 #define CMC_ADD_ATTRIBUTES ((LPCSTR)63)
908 #define X509_CERTIFICATE_TEMPLATE ((LPCSTR)64)
909 #define PKCS7_SIGNER_INFO ((LPCSTR)500)
910 #define CMS_SIGNER_INFO ((LPCSTR)501)
911
912 /* encode/decode flags */
913 #define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
914 #define CRYPT_ENCODE_ALLOC_FLAG 0x08000
915 #define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000
916 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG \
917 CERT_RDN_ENABLE_T61_UNICODE_FLAG
918 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG \
919 CERT_RDN_ENABLE_UTF8_UNICODE_FLAG
920 #define CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG \
921 CERT_RDN_DISABLE_CHECK_TYPE_FLAG
922
923 #define CRYPT_DECODE_NOCOPY_FLAG 0x00001
924 #define CRYPT_DECODE_TO_BE_SIGNED_FLAG 0x00002
925 #define CRYPT_DECODE_SHARE_OID_STRING_FLAG 0x00004
926 #define CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
927 #define CRYPT_DECODE_ALLOC_FLAG 0x08000
928 #define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \
929 CERT_RDN_DISABLE_IE4_UTF8_FLAG
930
931 /* types for CertOpenStore dwEncodingType */
932 #define CERT_ENCODING_TYPE_MASK 0x0000ffff
933 #define CMSG_ENCODING_TYPE_MASK 0xffff0000
934 #define GET_CERT_ENCODING_TYPE(x) ((x) & CERT_ENCODING_TYPE_MASK)
935 #define GET_CMSG_ENCODING_TYPE(x) ((x) & CMSG_ENCODING_TYPE_MASK)
936
937 #define CRYPT_ASN_ENCODING 0x00000001
938 #define CRYPT_NDR_ENCODING 0x00000002
939 #define X509_ASN_ENCODING 0x00000001
940 #define X509_NDR_ENCODING 0x00000002
941 #define PKCS_7_ASN_ENCODING 0x00010000
942 #define PKCS_7_NDR_ENCODING 0x00020000
943
944 /* Installable OID function defs */
945 #define CRYPT_OID_OPEN_STORE_PROV_FUNC "CertDllOpenStoreProv"
946 #define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject"
947 #define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject"
948 #define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx"
949 #define CRYPT_OID_DECODE_OBJECT_EX_FUNC "CryptDllDecodeObjectEx"
950 #define CRYPT_OID_CREATE_COM_OBJECT_FUNC "CryptDllCreateComObject"
951 #define CRYPT_OID_VERIFY_REVOCATION_FUNC "CertDllVerifyRevocation"
952 #define CRYPT_OID_VERIFY_CTL_USAGE_FUNC "CertDllVerifyCTLUsage"
953 #define CRYPT_OID_FORMAT_OBJECT_FUNC "CryptDllFormatObject"
954 #define CRYPT_OID_FIND_OID_INFO_FUNC "CryptDllFindOIDInfo"
955 #define CRYPT_OID_FIND_LOCALIZED_NAME_FUNC "CryptDllFindLocalizedName"
956 #define CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC "CryptDllExportPublicKeyInfoEx"
957 #define CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC "CryptDllImportPublicKeyInfoEx"
958 #define CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC "CryptDllExportPrivateKeyInfoEx"
959 #define CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC "CryptDllImportPrivateKeyInfoEx"
960 #define CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC \
961 "CertDllVerifyCertificateChainPolicy"
962 #define URL_OID_GET_OBJECT_URL_FUNC "UrlDllGetObjectUrl"
963 #define TIME_VALID_OID_GET_OBJECT_FUNC "TimeValidDllGetObject"
964
965 #define HP_ALGID 1
966 #define HP_HASHVAL 2
967 #define HP_HASHSIZE 4
968 #define CRYPT_FAILED FALSE
969 #define CRYPT_SUCCEED TRUE
970 #define RCRYPT_SUCCEEDED(r) ((r)==CRYPT_SUCCEED)
971 #define RCRYPT_FAILED(r) ((r)==CRYPT_FAILED)
972 #define PP_CLIENT_HWND 1
973 #define PP_ENUMALGS 1
974 #define PP_ENUMCONTAINERS 2
975 #define PP_IMPTYPE 3
976 #define PP_NAME 4
977 #define PP_VERSION 5
978 #define PP_CONTAINER 6
979 #define PP_CHANGE_PASSWORD 7
980 #define PP_KEYSET_SEC_DESCR 8
981 #define PP_CERTCHAIN 9
982 #define PP_KEY_TYPE_SUBTYPE 10
983 #define PP_PROVTYPE 16
984 #define PP_KEYSTORAGE 17
985 #define PP_APPLI_CERT 18
986 #define PP_SYM_KEYSIZE 19
987 #define PP_SESSION_KEYSIZE 20
988 #define PP_UI_PROMPT 21
989 #define PP_ENUMALGS_EX 22
990 #define PP_ENUMMANDROOTS 25
991 #define PP_ENUMELECTROOTS 26
992 #define PP_KEYSET_TYPE 27
993 #define PP_ADMIN_PIN 31
994 #define PP_KEYEXCHANGE_PIN 32
995 #define PP_SIGNATURE_PIN 33
996 #define PP_SIG_KEYSIZE_INC 34
997 #define PP_KEYX_KEYSIZE_INC 35
998 #define PP_UNIQUE_CONTAINER 36
999 #define PP_SGC_INFO 37
1000 #define PP_USE_HARDWARE_RNG 38
1001 #define PP_KEYSPEC 39
1002 #define PP_ENUMEX_SIGNING_PROT 40
1003 #define CRYPT_FIRST 1
1004 #define CRYPT_NEXT 2
1005 #define CRYPT_IMPL_HARDWARE 1
1006 #define CRYPT_IMPL_SOFTWARE 2
1007 #define CRYPT_IMPL_MIXED 3
1008 #define CRYPT_IMPL_UNKNOWN 4
1009 #define PROV_RSA_FULL 1
1010 #define PROV_RSA_SIG 2
1011 #define PROV_DSS 3
1012 #define PROV_FORTEZZA 4
1013 #define PROV_MS_MAIL 5
1014 #define PROV_SSL 6
1015 #define PROV_STT_MER 7
1016 #define PROV_STT_ACQ 8
1017 #define PROV_STT_BRND 9
1018 #define PROV_STT_ROOT 10
1019 #define PROV_STT_ISS 11
1020 #define PROV_RSA_SCHANNEL 12
1021 #define PROV_DSS_DH 13
1022 #define PROV_EC_ECDSA_SIG 14
1023 #define PROV_EC_ECNRA_SIG 15
1024 #define PROV_EC_ECDSA_FULL 16
1025 #define PROV_EC_ECNRA_FULL 17
1026 #define PROV_DH_SCHANNEL 18
1027 #define PROV_SPYRUS_LYNKS 20
1028 #define PROV_RNG 21
1029 #define PROV_INTEL_SEC 22
1030 #define MAXUIDLEN 64
1031 #define CUR_BLOB_VERSION 2
1032 #define X509_ASN_ENCODING 1
1033 #define PKCS_7_ASN_ENCODING 65536
1034 #define CERT_V1 0
1035 #define CERT_V2 1
1036 #define CERT_V3 2
1037 #define CERT_E_CHAINING (-2146762486)
1038 #define CERT_E_CN_NO_MATCH (-2146762481)
1039 #define CERT_E_EXPIRED (-2146762495)
1040 #define CERT_E_PURPOSE (-2146762490)
1041 #define CERT_E_REVOCATION_FAILURE (-2146762482)
1042 #define CERT_E_REVOKED (-2146762484)
1043 #define CERT_E_ROLE (-2146762493)
1044 #define CERT_E_UNTRUSTEDROOT (-2146762487)
1045 #define CERT_E_UNTRUSTEDTESTROOT (-2146762483)
1046 #define CERT_E_VALIDITYPERIODNESTING (-2146762494)
1047 #define CERT_E_WRONG_USAGE (-2146762480)
1048 #define CERT_E_PATHLENCONST (-2146762492)
1049 #define CERT_E_CRITICAL (-2146762491)
1050 #define CERT_E_ISSUERCHAINING (-2146762489)
1051 #define CERT_E_MALFORMED (-2146762488)
1052 #define CRYPT_E_REVOCATION_OFFLINE (-2146885613)
1053 #define CRYPT_E_REVOKED (-2146885616)
1054 #define TRUST_E_BASIC_CONSTRAINTS (-2146869223)
1055 #define TRUST_E_CERT_SIGNATURE (-2146869244)
1056 #define TRUST_E_FAIL (-2146762485)
1057 #define CERT_TRUST_NO_ERROR 0
1058 #define CERT_TRUST_IS_NOT_TIME_VALID 1
1059 #define CERT_TRUST_IS_NOT_TIME_NESTED 2
1060 #define CERT_TRUST_IS_REVOKED 4
1061 #define CERT_TRUST_IS_NOT_SIGNATURE_VALID 8
1062 #define CERT_TRUST_IS_NOT_VALID_FOR_USAGE 16
1063 #define CERT_TRUST_IS_UNTRUSTED_ROOT 32
1064 #define CERT_TRUST_REVOCATION_STATUS_UNKNOWN 64
1065 #define CERT_TRUST_IS_CYCLIC 128
1066 #define CERT_TRUST_IS_PARTIAL_CHAIN 65536
1067 #define CERT_TRUST_CTL_IS_NOT_TIME_VALID 131072
1068 #define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 262144
1069 #define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 524288
1070 #define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 1
1071 #define CERT_TRUST_HAS_KEY_MATCH_ISSUER 2
1072 #define CERT_TRUST_HAS_NAME_MATCH_ISSUER 4
1073 #define CERT_TRUST_IS_SELF_SIGNED 8
1074 #define CERT_TRUST_IS_COMPLEX_CHAIN 65536
1075 #define CERT_CHAIN_POLICY_BASE ((LPCSTR) 1)
1076 #define CERT_CHAIN_POLICY_AUTHENTICODE ((LPCSTR) 2)
1077 #define CERT_CHAIN_POLICY_AUTHENTICODE_TS ((LPCSTR) 3)
1078 #define CERT_CHAIN_POLICY_SSL ((LPCSTR) 4)
1079 #define CERT_CHAIN_POLICY_BASIC_CONSTRAINTS ((LPCSTR) 5)
1080 #define CERT_CHAIN_POLICY_NT_AUTH ((LPCSTR) 6)
1081 #define USAGE_MATCH_TYPE_AND 0
1082 #define USAGE_MATCH_TYPE_OR 1
1083 #define CERT_SIMPLE_NAME_STR 1
1084 #define CERT_OID_NAME_STR 2
1085 #define CERT_X500_NAME_STR 3
1086 #define CERT_NAME_STR_SEMICOLON_FLAG 1073741824
1087 #define CERT_NAME_STR_CRLF_FLAG 134217728
1088 #define CERT_NAME_STR_NO_PLUS_FLAG 536870912
1089 #define CERT_NAME_STR_NO_QUOTING_FLAG 268435456
1090 #define CERT_NAME_STR_REVERSE_FLAG 33554432
1091 #define CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG 131072
1092 #define CERT_FIND_ANY 0
1093 #define CERT_FIND_CERT_ID 1048576
1094 #define CERT_FIND_CTL_USAGE 655360
1095 #define CERT_FIND_ENHKEY_USAGE 655360
1096 #define CERT_FIND_EXISTING 851968
1097 #define CERT_FIND_HASH 65536
1098 #define CERT_FIND_ISSUER_ATTR 196612
1099 #define CERT_FIND_ISSUER_NAME 131076
1100 #define CERT_FIND_ISSUER_OF 786432
1101 #define CERT_FIND_KEY_IDENTIFIER 983040
1102 #define CERT_FIND_KEY_SPEC 589824
1103 #define CERT_FIND_MD5_HASH 262144
1104 #define CERT_FIND_PROPERTY 327680
1105 #define CERT_FIND_PUBLIC_KEY 393216
1106 #define CERT_FIND_SHA1_HASH 65536
1107 #define CERT_FIND_SIGNATURE_HASH 917504
1108 #define CERT_FIND_SUBJECT_ATTR 196615
1109 #define CERT_FIND_SUBJECT_CERT 720896
1110 #define CERT_FIND_SUBJECT_NAME 131079
1111 #define CERT_FIND_SUBJECT_STR_A 458759
1112 #define CERT_FIND_SUBJECT_STR_W 524295
1113 #define CERT_FIND_ISSUER_STR_A 458756
1114 #define CERT_FIND_ISSUER_STR_W 524292
1115 #define CERT_FIND_OR_ENHKEY_USAGE_FLAG 16
1116 #define CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG 1
1117 #define CERT_FIND_NO_ENHKEY_USAGE_FLAG 8
1118 #define CERT_FIND_VALID_ENHKEY_USAGE_FLAG 32
1119 #define CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG 2
1120 #define CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG 2
1121 #define CERT_UNICODE_IS_RDN_ATTRS_FLAG 1
1122 #define CERT_CHAIN_FIND_BY_ISSUER 1
1123 #define CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG 1
1124 #define CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG 2
1125 #define CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG 32768
1126 #define CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG 4
1127 #define CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG 8
1128 #define CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG 16384
1129 #define CERT_STORE_PROV_SYSTEM 10
1130 #define CERT_SYSTEM_STORE_LOCAL_MACHINE 131072
1131 #define szOID_PKIX_KP_SERVER_AUTH "4235600"
1132 #define szOID_SERVER_GATED_CRYPTO "4235658"
1133 #define szOID_SGC_NETSCAPE "2.16.840.1.113730.4.1"
1134 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
1135 #define CRYPT_NOHASHOID 0x00000001
1136 #define CRYPT_NO_SALT 0x10
1137 #define CRYPT_PREGEN 0x40
1138 #define CRYPT_RECIPIENT 0x10
1139 #define CRYPT_INITIATOR 0x40
1140 #define CRYPT_ONLINE 0x80
1141 #define CRYPT_SF 0x100
1142 #define CRYPT_CREATE_IV 0x200
1143 #define CRYPT_KEK 0x400
1144 #define CRYPT_DATA_KEY 0x800
1145 #define CRYPT_VOLATILE 0x1000
1146 #define CRYPT_SGCKEY 0x2000
1147 #define KP_IV 0x00000001
1148 #define KP_SALT 0x00000002
1149 #define KP_PADDING 0x00000003
1150 #define KP_MODE 0x00000004
1151 #define KP_MODE_BITS 0x00000005
1152 #define KP_PERMISSIONS 0x00000006
1153 #define KP_ALGID 0x00000007
1154 #define KP_BLOCKLEN 0x00000008
1155 #define KP_KEYLEN 0x00000009
1156 #define KP_SALT_EX 0x0000000a
1157 #define KP_P 0x0000000b
1158 #define KP_G 0x0000000c
1159 #define KP_Q 0x0000000d
1160 #define KP_X 0x0000000e
1161 #define KP_Y 0x0000000f
1162 #define KP_RA 0x00000010
1163 #define KP_RB 0x00000011
1164 #define KP_INFO 0x00000012
1165 #define KP_EFFECTIVE_KEYLEN 0x00000013
1166 #define KP_SCHANNEL_ALG 0x00000014
1167 #define KP_PUB_PARAMS 0x00000027
1168 #define CRYPT_FLAG_PCT1 0x0001
1169 #define CRYPT_FLAG_SSL2 0x0002
1170 #define CRYPT_FLAG_SSL3 0x0004
1171 #define CRYPT_FLAG_TLS1 0x0008
1172 #define CRYPT_FLAG_IPSEC 0x0010
1173 #define CRYPT_FLAG_SIGNING 0x0020
1174 #define SCHANNEL_MAC_KEY 0x00000000
1175 #define SCHANNEL_ENC_KEY 0x00000001
1176 #define INTERNATIONAL_USAGE 0x00000001
1177
1178 typedef UINT ALG_ID;
1179 typedef struct _VTableProvStruc {
1180 DWORD Version;
1181 FARPROC pFuncVerifyImage;
1182 FARPROC pFuncReturnhWnd;
1183 DWORD dwProvType;
1184 BYTE *pbContextInfo;
1185 DWORD cbContextInfo;
1186 LPSTR pszProvName;
1187 } VTableProvStruc, *PVTableProvStruc;
1188 typedef ULONG HCRYPTPROV;
1189 typedef ULONG HCRYPTKEY;
1190 typedef ULONG HCRYPTHASH;
1191 typedef PVOID HCERTSTORE;
1192 typedef PVOID HCRYPTMSG;
1193 typedef PVOID HCERTCHAINENGINE;
1194 typedef struct _CRYPTOAPI_BLOB {
1195 DWORD cbData;
1196 BYTE* pbData;
1197 } CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
1198 CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB,
1199 CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
1200 CERT_NAME_BLOB, *PCERT_NAME_BLOB,
1201 CERT_RDN_VALUE_BLOB,*PCERT_RDN_VALUE_BLOB,
1202 CERT_BLOB, *PCERT_BLOB,
1203 CRL_BLOB, *PCRL_BLOB,
1204 DATA_BLOB, *PDATA_BLOB,
1205 CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB,
1206 CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB,
1207 CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB,
1208 CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
1209 CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
1210 /* not described in SDK; has the same layout as HTTPSPolicyCallbackData */
1211 typedef struct _SSL_EXTRA_CERT_CHAIN_POLICY_PARA {
1212 DWORD cbStruct;
1213 DWORD dwAuthType;
1214 DWORD fdwChecks;
1215 LPWSTR pwszServerName;
1216 } SSL_EXTRA_CERT_CHAIN_POLICY_PARA, *PSSL_EXTRA_CERT_CHAIN_POLICY_PARA,
1217 HTTPSPolicyCallbackData, *PHTTPSPolicyCallbackData;
1218 /* #if (_WIN32_WINNT>=0x500) */
1219 typedef struct _CERT_CHAIN_POLICY_PARA {
1220 DWORD cbSize;
1221 DWORD dwFlags;
1222 void* pvExtraPolicyPara;
1223 } CERT_CHAIN_POLICY_PARA, *PCERT_CHAIN_POLICY_PARA;
1224 typedef struct _CERT_CHAIN_POLICY_STATUS {
1225 DWORD cbSize;
1226 DWORD dwError;
1227 LONG lChainIndex;
1228 LONG lElementIndex;
1229 void* pvExtraPolicyStatus;
1230 } CERT_CHAIN_POLICY_STATUS, *PCERT_CHAIN_POLICY_STATUS;
1231 /* #endif */
1232 typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
1233 LPSTR pszObjId;
1234 CRYPT_OBJID_BLOB Parameters;
1235 } CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
1236 typedef struct _CRYPT_BIT_BLOB {
1237 DWORD cbData;
1238 BYTE* pbData;
1239 DWORD cUnusedBits;
1240 } CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
1241 typedef struct _CERT_PUBLIC_KEY_INFO {
1242 CRYPT_ALGORITHM_IDENTIFIER Algorithm;
1243 CRYPT_BIT_BLOB PublicKey;
1244 } CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
1245 typedef struct _CERT_EXTENSION {
1246 LPSTR pszObjId;
1247 BOOL fCritical;
1248 CRYPT_OBJID_BLOB Value;
1249 } CERT_EXTENSION, *PCERT_EXTENSION;
1250 typedef struct _CERT_INFO {
1251 DWORD dwVersion;
1252 CRYPT_INTEGER_BLOB SerialNumber;
1253 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
1254 CERT_NAME_BLOB Issuer;
1255 FILETIME NotBefore;
1256 FILETIME NotAfter;
1257 CERT_NAME_BLOB Subject;
1258 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
1259 CRYPT_BIT_BLOB IssuerUniqueId;
1260 CRYPT_BIT_BLOB SubjectUniqueId;
1261 DWORD cExtension;
1262 PCERT_EXTENSION rgExtension;
1263 } CERT_INFO, *PCERT_INFO;
1264 typedef struct _CERT_CONTEXT {
1265 DWORD dwCertEncodingType;
1266 BYTE* pbCertEncoded;
1267 DWORD cbCertEncoded;
1268 PCERT_INFO pCertInfo;
1269 HCERTSTORE hCertStore;
1270 } CERT_CONTEXT, *PCERT_CONTEXT;
1271 typedef const CERT_CONTEXT *PCCERT_CONTEXT;
1272 typedef struct _CTL_USAGE {
1273 DWORD cUsageIdentifier;
1274 LPSTR *rgpszUsageIdentifier;
1275 } CTL_USAGE, *PCTRL_USAGE,
1276 CERT_ENHKEY_USAGE, *PCERT_ENHKEY_USAGE;
1277 typedef struct _CERT_USAGE_MATCH {
1278 DWORD dwType;
1279 CERT_ENHKEY_USAGE Usage;
1280 } CERT_USAGE_MATCH, *PCERT_USAGE_MATCH;
1281 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
1282 LPSTR pszObjId;
1283 CRYPT_OBJID_BLOB Value;
1284 } CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
1285 /* #if (_WIN32_WINNT>=0x500) */
1286 typedef struct _CERT_CHAIN_PARA {
1287 DWORD cbSize;
1288 CERT_USAGE_MATCH RequestedUsage;
1289 #if CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
1290 CERT_USAGE_MATCH RequestedIssuancePolicy;
1291 DWORD dwUrlRetrievalTimeout;
1292 BOOL fCheckRevocationFreshnessTime;
1293 DWORD dwRevocationFreshnessTime;
1294 #endif
1295 } CERT_CHAIN_PARA, *PCERT_CHAIN_PARA;
1296 typedef BOOL (WINAPI *PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK)(PCCERT_CONTEXT,void*);
1297 typedef struct _CERT_CHAIN_FIND_BY_ISSUER_PARA {
1298 DWORD cbSize;
1299 LPCSTR pszUsageIdentifier;
1300 DWORD dwKeySpec;
1301 DWORD dwAcquirePrivateKeyFlags;
1302 DWORD cIssuer;
1303 CERT_NAME_BLOB* rgIssuer;
1304 PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK pfnFIndCallback;
1305 void* pvFindArg;
1306 DWORD* pdwIssuerChainIndex;
1307 DWORD* pdwIssuerElementIndex;
1308 } CERT_CHAIN_FIND_BY_ISSUER_PARA, *PCERT_CHAIN_FIND_BY_ISSUER_PARA;
1309 /* #endif */
1310
1311 typedef struct _CERT_POLICY_ID {
1312 DWORD cCertPolicyElementId;
1313 LPSTR *rgbszCertPolicyElementId;
1314 } CERT_POLICY_ID, *PCERT_POLICY_ID;
1315
1316 typedef struct _PUBLICKEYSTRUC {
1317 BYTE bType;
1318 BYTE bVersion;
1319 WORD reserved;
1320 ALG_ID aiKeyAlg;
1321 } BLOBHEADER, PUBLICKEYSTRUC;
1322
1323 typedef struct _CERT_KEY_USAGE_RESTRICTION_INFO {
1324 DWORD cCertPolicyId;
1325 PCERT_POLICY_ID rgCertPolicyId;
1326 CRYPT_BIT_BLOB RestrictedKeyUsage;
1327 } CERT_KEY_USAGE_RESTRICTION_INFO, *PCERT_KEY_USAGE_RESTRICTION_INFO;
1328
1329 typedef struct _CERT_OTHER_NAME {
1330 LPSTR pszObjId;
1331 CRYPT_OBJID_BLOB Value;
1332 } CERT_OTHER_NAME, *PCERT_OTHER_NAME;
1333
1334 typedef struct _CERT_ALT_NAME_ENTRY {
1335 DWORD dwAltNameChoice;
1336 union {
1337 PCERT_OTHER_NAME pOtherName;
1338 LPWSTR pwszRfc822Name;
1339 LPWSTR pwszDNSName;
1340 CERT_NAME_BLOB DirectoryName;
1341 LPWSTR pwszURL;
1342 CRYPT_DATA_BLOB IPAddress;
1343 LPSTR pszRegisteredID;
1344 } DUMMYUNIONNAME;
1345 } CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY;
1346
1347 #define CERT_ALT_NAME_OTHER_NAME 1
1348 #define CERT_ALT_NAME_RFC822_NAME 2
1349 #define CERT_ALT_NAME_DNS_NAME 3
1350 #define CERT_ALT_NAME_X400_ADDRESS 4
1351 #define CERT_ALT_NAME_DIRECTORY_NAME 5
1352 #define CERT_ALT_NAME_EDI_PARTY_NAME 6
1353 #define CERT_ALT_NAME_URL 7
1354 #define CERT_ALT_NAME_IP_ADDRESS 8
1355 #define CERT_ALT_NAME_REGISTERED_ID 9
1356
1357 typedef struct _CERT_ALT_NAME_INFO {
1358 DWORD cAltEntry;
1359 PCERT_ALT_NAME_ENTRY rgAltEntry;
1360 } CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO;
1361
1362 /* Encode/decode object */
1363 typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)(size_t cbsize);
1364 typedef VOID (WINAPI *PFN_CRYPT_FREE)(LPVOID pv);
1365
1366 typedef struct _CRYPT_DECODE_PARA {
1367 DWORD cbSize;
1368 PFN_CRYPT_ALLOC pfnAlloc;
1369 PFN_CRYPT_FREE pfnFree;
1370 } CRYPT_DECODE_PARA, *PCRYPT_DECODE_PARA;
1371 typedef struct _CRYPT_SEQUENCE_OF_ANY {
1372 DWORD cValue;
1373 PCRYPT_DER_BLOB rgValue;
1374 } CRYPT_SEQUENCE_OF_ANY, *PCRYPT_SEQUENCE_OF_ANY;
1375 typedef struct _CERT_TRUST_STATUS {
1376 DWORD dwErrorStatus;
1377 DWORD dwInfoStatus;
1378 } CERT_TRUST_STATUS, *PCERT_TRUST_STATUS;
1379 typedef struct _CRL_ENTRY {
1380 CRYPT_INTEGER_BLOB SerialNumber;
1381 FILETIME RevocationDate;
1382 DWORD cExtension;
1383 PCERT_EXTENSION rgExtension;
1384 } CRL_ENTRY, *PCRL_ENTRY;
1385 typedef struct _CRL_INFO {
1386 DWORD dwVersion;
1387 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
1388 CERT_NAME_BLOB Issuer;
1389 FILETIME ThisUpdate;
1390 FILETIME NextUpdate;
1391 DWORD cCRLEntry;
1392 PCRL_ENTRY rgCRLEntry;
1393 DWORD cExtension;
1394 PCERT_EXTENSION rgExtension;
1395 } CRL_INFO, *PCRL_INFO;
1396 typedef struct _CRL_CONTEXT {
1397 DWORD dwCertEncodingType;
1398 BYTE* pbCrlEncoded;
1399 DWORD cbCrlEncoded;
1400 PCRL_INFO pCrlInfo;
1401 HCERTSTORE hCertStore;
1402 } CRL_CONTEXT, *PCRL_CONTEXT;
1403 typedef const CRL_CONTEXT *PCCRL_CONTEXT;
1404 typedef struct _CERT_REVOCATION_CRL_INFO {
1405 DWORD cbSize;
1406 PCCRL_CONTEXT pBaseCRLContext;
1407 PCCRL_CONTEXT pDeltaCRLContext;
1408 PCRL_ENTRY pCrlEntry;
1409 BOOL fDeltaCrlEntry;
1410 } CERT_REVOCATION_CRL_INFO, *PCERT_REVOCATION_CRL_INFO;
1411 typedef struct _CERT_REVOCATION_INFO {
1412 DWORD cbSize;
1413 DWORD dwRevocationResult;
1414 LPCSTR pszRevocationOid;
1415 LPVOID pvOidSpecificInfo;
1416 BOOL fHasFreshnessTime;
1417 DWORD dwFreshnessTime;
1418 PCERT_REVOCATION_CRL_INFO pCrlInfo;
1419 } CERT_REVOCATION_INFO, *PCERT_REVOCATION_INFO;
1420 /* #if (_WIN32_WINNT>=0x500) */
1421 typedef struct _CERT_CHAIN_ELEMENT {
1422 DWORD cbSize;
1423 PCCERT_CONTEXT pCertContext;
1424 CERT_TRUST_STATUS TrustStatus;
1425 PCERT_REVOCATION_INFO pRevocationInfo;
1426 PCERT_ENHKEY_USAGE pIssuanceUsage;
1427 PCERT_ENHKEY_USAGE pApplicationUsage;
1428 } CERT_CHAIN_ELEMENT, *PCERT_CHAIN_ELEMENT;
1429 /* #endif */
1430 typedef struct _CRYPT_ATTRIBUTE {
1431 LPSTR pszObjId;
1432 DWORD cValue;
1433 PCRYPT_ATTR_BLOB rgValue;
1434 } CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;
1435 typedef struct _CTL_ENTRY {
1436 CRYPT_DATA_BLOB SubjectIdentifier;
1437 DWORD cAttribute;
1438 PCRYPT_ATTRIBUTE rgAttribute;
1439 } CTL_ENTRY, *PCTL_ENTRY;
1440 typedef struct _CTL_INFO {
1441 DWORD dwVersion;
1442 CTL_USAGE SubjectUsage;
1443 CRYPT_DATA_BLOB ListIdentifier;
1444 CRYPT_INTEGER_BLOB SequenceNumber;
1445 FILETIME ThisUpdate;
1446 FILETIME NextUpdate;
1447 CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm;
1448 DWORD cCTLEntry;
1449 PCTL_ENTRY rgCTLEntry;
1450 DWORD cExtension;
1451 PCERT_EXTENSION rgExtension;
1452 } CTL_INFO, *PCTL_INFO;
1453 typedef struct _CTL_CONTEXT {
1454 DWORD dwMsgAndCertEncodingType;
1455 BYTE* pbCtlEncoded;
1456 DWORD cbCtlEncoded;
1457 PCTL_INFO pCtlInfo;
1458 HCERTSTORE hCertStore;
1459 HCRYPTMSG hCryptMsg;
1460 BYTE* pbCtlContent;
1461 DWORD cbCtlContent;
1462 } CTL_CONTEXT, *PCTL_CONTEXT;
1463 typedef const CTL_CONTEXT *PCCTL_CONTEXT;
1464 typedef struct _CERT_TRUST_LIST_INFO {
1465 DWORD cbSize;
1466 PCTL_ENTRY pCtlEntry;
1467 PCCTL_CONTEXT pCtlContext;
1468 } CERT_TRUST_LIST_INFO, *PCERT_TRUST_LIST_INFO;
1469 typedef struct _CERT_SIMPLE_CHAIN {
1470 DWORD cbSize;
1471 CERT_TRUST_STATUS TrustStatus;
1472 DWORD cElement;
1473 PCERT_CHAIN_ELEMENT* rgpElement;
1474 PCERT_TRUST_LIST_INFO pTrustListInfo;
1475 BOOL fHasRevocationFreshnessTime;
1476 DWORD dwRevocationFreshnessTime;
1477 } CERT_SIMPLE_CHAIN, *PCERT_SIMPLE_CHAIN;
1478 /* #if (_WIN32_WINNT>=0x500) */
1479 typedef const struct _CERT_CHAIN_CONTEXT* PCCERT_CHAIN_CONTEXT;
1480 typedef struct _CERT_CHAIN_CONTEXT {
1481 DWORD cbSize;
1482 CERT_TRUST_STATUS TrustStatus;
1483 DWORD cChain;
1484 PCERT_SIMPLE_CHAIN* rgpChain;
1485 DWORD cLowerQualityChainContext;
1486 PCCERT_CHAIN_CONTEXT* rgpLowerQualityChainContext;
1487 BOOL fHasRevocationFreshnessTime;
1488 DWORD dwRevocationFreshnessTime;
1489 } CERT_CHAIN_CONTEXT, *PCERT_CHAIN_CONTEXT;
1490 /* #endif */
1491 typedef struct _PROV_ENUMALGS {
1492 ALG_ID aiAlgid;
1493 DWORD dwBitLen;
1494 DWORD dwNameLen;
1495 CHAR szName[20];
1496 } PROV_ENUMALGS;
1497 typedef struct _RSAPUBKEY {
1498 DWORD magic;
1499 DWORD bitlen;
1500 DWORD pubexp;
1501 } RSAPUBKEY;
1502 typedef struct _CRYPTPROTECT_PROMPTSTRUCT{
1503 DWORD cbSize;
1504 DWORD dwPromptFlags;
1505 HWND hwndApp;
1506 LPCWSTR szPrompt;
1507 } CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT;
1508
1509 typedef struct _CERT_SIGNED_CONTENT_INFO {
1510 CRYPT_DER_BLOB ToBeSigned;
1511 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
1512 CRYPT_BIT_BLOB Signature;
1513 } CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO;
1514
1515 typedef struct _CERT_RDN_ATTR {
1516 LPSTR pszObjId;
1517 DWORD dwValueType;
1518 CERT_RDN_VALUE_BLOB Value;
1519 } CERT_RDN_ATTR, *PCERT_RDN_ATTR;
1520
1521 typedef struct _CERT_RDN {
1522 DWORD cRDNAttr;
1523 PCERT_RDN_ATTR rgRDNAttr;
1524 } CERT_RDN, *PCERT_RDN;
1525
1526 typedef struct _CERT_NAME_INFO {
1527 DWORD cRDN;
1528 PCERT_RDN rgRDN;
1529 } CERT_NAME_INFO, *PCERT_NAME_INFO;
1530
1531 typedef struct _CRYPT_ENCODE_PARA {
1532 DWORD cbSize;
1533 PFN_CRYPT_ALLOC pfnAlloc;
1534 PFN_CRYPT_FREE pfnFree;
1535 } CRYPT_ENCODE_PARA, *PCRYPT_ENCODE_PARA;
1536
1537 typedef struct _CERT_SYSTEM_STORE_INFO {
1538 DWORD cbSize;
1539 } CERT_SYSTEM_STORE_INFO, *PCERT_SYSTEM_STORE_INFO;
1540
1541 typedef struct _CERT_PHYSICAL_STORE_INFO {
1542 DWORD cbSize;
1543 LPSTR pszOpenStoreProvider;
1544 DWORD dwOpenEncodingType;
1545 DWORD dwOpenFlags;
1546 CRYPT_DATA_BLOB OpenParameters;
1547 DWORD dwFlags;
1548 DWORD dwPriority;
1549 } CERT_PHYSICAL_STORE_INFO, *PCERT_PHYSICAL_STORE_INFO;
1550
1551 typedef struct _CERT_STORE_PROV_INFO {
1552 DWORD cbSize;
1553 DWORD cStoreProvFunc;
1554 void **rgpvStoreProvFunc;
1555 HCERTSTOREPROV hStoreProv;
1556 DWORD dwStoreProvFlags;
1557 HCRYPTOIDFUNCADDR hStoreProvFuncAddr2;
1558 } CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO;
1559
1560 typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)(
1561 LPCWSTR pwszStoreLocation, DWORD dwFlags, void *pvReserved, void *pvArg);
1562
1563 typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE)(const void *pvSystemStore,
1564 DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved,
1565 void *pvArg);
1566
1567 typedef BOOL (WINAPI *PFN_CERT_ENUM_PHYSICAL_STORE)(const void *pvSystemStore,
1568 DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo,
1569 void *pvReserved, void *pvArg);
1570
1571 /* Encode/decode object */
1572 typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)(size_t cbsize);
1573 typedef VOID (WINAPI *PFN_CRYPT_FREE)(LPVOID pv);
1574
1575 typedef BOOL (WINAPI *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(
1576 LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv,
1577 DWORD dwFlags, const void *pvPara, HCERTSTORE hCertStore,
1578 PCERT_STORE_PROV_INFO pStoreProvInfo);
1579
1580 typedef void (WINAPI *PFN_CERT_STORE_PROV_CLOSE)(HCERTSTOREPROV hStoreProv,
1581 DWORD dwFlags);
1582
1583 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)(HCERTSTOREPROV hStoreProv,
1584 PCCERT_CONTEXT pStoreCertContext, DWORD dwFlags,
1585 PCCERT_CONTEXT *ppProvCertContext);
1586
1587 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CERT)(HCERTSTOREPROV hStoreProv,
1588 PCCERT_CONTEXT pCertContext, DWORD dwFlags);
1589
1590 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CERT)(
1591 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwFlags);
1592
1593 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CERT_PROPERTY)(
1594 HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwPropId,
1595 DWORD dwFlags, const void *pvData);
1596
1597 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)(HCERTSTOREPROV hStoreProv,
1598 PCCRL_CONTEXT pStoreCrlContext, DWORD dwFlags,
1599 PCCRL_CONTEXT *ppProvCrlContext);
1600
1601 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CRL)(HCERTSTOREPROV hStoreProv,
1602 PCCRL_CONTEXT pCrlContext, DWORD dwFlags);
1603
1604 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CRL)(HCERTSTOREPROV hStoreProv,
1605 PCCRL_CONTEXT pCrlContext, DWORD dwFlags);
1606
1607 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CRL_PROPERTY)(
1608 HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext, DWORD dwPropId,
1609 DWORD dwFlags, const void *pvData);
1610
1611 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)(HCERTSTOREPROV hStoreProv,
1612 PCCTL_CONTEXT pStoreCtlContext, DWORD dwFlags,
1613 PCCTL_CONTEXT *ppProvCtlContext);
1614
1615 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CTL)(HCERTSTOREPROV hStoreProv,
1616 PCCTL_CONTEXT pCtlContext, DWORD dwFlags);
1617
1618 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CTL)(
1619 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwFlags);
1620
1621 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CTL_PROPERTY)(
1622 HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwPropId,
1623 DWORD dwFlags, const void *pvData);
1624
1625 typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)(HCERTSTOREPROV hStoreProv,
1626 DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara);
1627
1628 /* subject types for CryptVerifyCertificateSignatureEx */
1629 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1
1630 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2
1631 #define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3
1632
1633 /* issuer types for CryptVerifyCertificateSignatureEx */
1634 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1
1635 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2
1636 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3
1637 #define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4
1638
1639 /* crypt32.dll functions */
1640 LPVOID WINAPI CryptMemAlloc(ULONG cbSize);
1641 LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize);
1642 VOID WINAPI CryptMemFree(LPVOID pv);
1643
1644 PCRYPT_ATTRIBUTE WINAPI CertFindAttribute(LPCSTR pszObjId, DWORD cAttr, CRYPT_ATTRIBUTE rgAttr[]);
1645 PCERT_EXTENSION WINAPI CertFindExtension(LPCSTR pszObjId, DWORD cExtensions, CERT_EXTENSION rgExtensions[]);
1646 PCERT_RDN_ATTR WINAPI CertFindRDNAttr(LPCSTR pszObjId, PCERT_NAME_INFO pName);
1647
1648 BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
1649 BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
1650 BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement);
1651
1652 BOOL WINAPI CertCloseStore(HCERTSTORE,DWORD);
1653 BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE,PCCERT_CONTEXT,LPFILETIME,HCERTSTORE,PCERT_CHAIN_PARA,DWORD,LPVOID,PCCERT_CHAIN_CONTEXT*);
1654 BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR,PCCERT_CHAIN_CONTEXT,PCERT_CHAIN_POLICY_PARA,PCERT_CHAIN_POLICY_STATUS);
1655 void WINAPI CertFreeCertificateChain(PCCERT_CHAIN_CONTEXT);
1656 DWORD WINAPI CertNameToStrA(DWORD,PCERT_NAME_BLOB,DWORD,LPSTR,DWORD);
1657 DWORD WINAPI CertNameToStrW(DWORD,PCERT_NAME_BLOB,DWORD,LPWSTR,DWORD);
1658 HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV,LPCSTR);
1659 HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV,LPCWSTR);
1660 HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara);
1661 PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE,DWORD,DWORD,DWORD,const void*,PCCERT_CONTEXT);
1662 BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT);
1663 PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE,PCCERT_CONTEXT,PCCERT_CONTEXT,DWORD*);
1664 PCCERT_CHAIN_CONTEXT WINAPI CertFindChainInStore(HCERTSTORE,DWORD,DWORD,DWORD,const void*,PCCERT_CHAIN_CONTEXT);
1665 BOOL WINAPI CryptAcquireContextA(HCRYPTPROV*,LPCSTR,LPCSTR,DWORD,DWORD);
1666 BOOL WINAPI CryptAcquireContextW(HCRYPTPROV*,LPCWSTR,LPCWSTR,DWORD,DWORD);
1667 BOOL WINAPI CryptContextAddRef(HCRYPTPROV,DWORD*,DWORD);
1668 BOOL WINAPI CryptReleaseContext(HCRYPTPROV,DWORD);
1669 BOOL WINAPI CryptGenKey(HCRYPTPROV,ALG_ID,DWORD,HCRYPTKEY*);
1670 BOOL WINAPI CryptDeriveKey(HCRYPTPROV,ALG_ID,HCRYPTHASH,DWORD,HCRYPTKEY*);
1671 BOOL WINAPI CryptDestroyKey(HCRYPTKEY);
1672 #if (WINVER >= 0x0500)
1673 BOOL WINAPI CryptDuplicateHash(HCRYPTHASH,DWORD*,DWORD,HCRYPTHASH*);
1674 BOOL WINAPI CryptDuplicateKey(HCRYPTKEY,DWORD*,DWORD,HCRYPTKEY*);
1675 #endif
1676 BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority);
1677 BOOL WINAPI CryptExportKey (HCRYPTKEY hKey, HCRYPTKEY hExpKey, DWORD dwBlobType, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
1678 LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId);
1679 DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId);
1680 BOOL WINAPI CryptExportPublicKeyInfo(HCRYPTPROV hCryptProv, DWORD dwKeySpec, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
1681 BOOL WINAPI CryptExportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwKeySpec, DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags, void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
1682 BOOL WINAPI CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, HCRYPTKEY *phKey);
1683 BOOL WINAPI CryptImportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg, DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey);
1684 BOOL WINAPI CryptProtectData( DATA_BLOB* pDataIn, LPCWSTR szDataDescr, DATA_BLOB* pOptionalEntropy, PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
1685 BOOL WINAPI CryptUnprotectData( DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr, DATA_BLOB* pOptionalEntropy, PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut );
1686 BOOL WINAPI CryptVerifyCertificateSignature(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, PCERT_PUBLIC_KEY_INFO pPublicKey);
1687 BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, DWORD dwSubjectType, void *pvSubject, DWORD dwIssuerType, void *pvIssuer, DWORD dwFlags, void *pvReserved);
1688 BOOL WINAPI CryptSetKeyParam(HCRYPTKEY,DWORD,PBYTE,DWORD);
1689 BOOL WINAPI CryptGetKeyParam(HCRYPTKEY,DWORD,PBYTE,PDWORD,DWORD);
1690 BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo);
1691 BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo);
1692 BOOL WINAPI CryptSetHashParam(HCRYPTHASH,DWORD,PBYTE,DWORD);
1693 BOOL WINAPI CryptGetHashParam(HCRYPTHASH,DWORD,PBYTE,PDWORD,DWORD);
1694 BOOL WINAPI CryptSetProvParam(HCRYPTPROV,DWORD,PBYTE,DWORD);
1695 BOOL WINAPI CryptGetProvParam(HCRYPTPROV,DWORD,PBYTE,PDWORD,DWORD);
1696 BOOL WINAPI CryptGenRandom(HCRYPTPROV,DWORD,PBYTE);
1697 BOOL WINAPI CryptGetUserKey(HCRYPTPROV,DWORD,HCRYPTKEY*);
1698 BOOL WINAPI CryptExportKey(HCRYPTKEY,HCRYPTKEY,DWORD,DWORD,PBYTE,PDWORD);
1699 BOOL WINAPI CryptImportKey(HCRYPTPROV,PBYTE,DWORD,HCRYPTKEY,DWORD,HCRYPTKEY*);
1700 BOOL WINAPI CryptEncrypt(HCRYPTKEY,HCRYPTHASH,BOOL,DWORD,PBYTE,PDWORD,DWORD);
1701 BOOL WINAPI CryptDecrypt(HCRYPTKEY,HCRYPTHASH,BOOL,DWORD,PBYTE,PDWORD);
1702 BOOL WINAPI CryptCreateHash(HCRYPTPROV,ALG_ID,HCRYPTKEY,DWORD,HCRYPTHASH*);
1703 BOOL WINAPI CryptHashData (HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
1704 BOOL WINAPI CryptHashSessionKey(HCRYPTHASH,HCRYPTKEY,DWORD);
1705 BOOL WINAPI CryptGetHashValue(HCRYPTHASH,DWORD,PBYTE,PDWORD);
1706 BOOL WINAPI CryptDestroyHash(HCRYPTHASH);
1707 BOOL WINAPI CryptSignHashA(HCRYPTHASH,DWORD,LPCSTR,DWORD,PBYTE,PDWORD);
1708 BOOL WINAPI CryptSignHashW(HCRYPTHASH,DWORD,LPCWSTR,DWORD,PBYTE,PDWORD);
1709 BOOL WINAPI CryptVerifySignatureA(HCRYPTHASH,PBYTE,DWORD,HCRYPTKEY,LPCSTR,DWORD);
1710 BOOL WINAPI CryptVerifySignatureW(HCRYPTHASH,PBYTE,DWORD,HCRYPTKEY,LPCWSTR,DWORD);
1711 BOOL WINAPI CryptSetProviderA(LPCSTR,DWORD);
1712 BOOL WINAPI CryptSetProviderW(LPCWSTR,DWORD);
1713 BOOL WINAPI CryptSetProviderExA(LPCSTR,DWORD,DWORD*,DWORD);
1714 BOOL WINAPI CryptSetProviderExW(LPCWSTR,DWORD,DWORD*,DWORD);
1715 #ifdef UNICODE
1716 #define CertNameToStr CertNameToStrW
1717 #define CryptAcquireContext CryptAcquireContextW
1718 #define CryptSignHash CryptSignHashW
1719 #define CryptVerifySignature CryptVerifySignatureW
1720 #define CryptSetProvider CryptSetProviderW
1721 #define CertOpenSystemStore CertOpenSystemStoreW
1722 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_W
1723 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_W
1724 #define MS_DEF_PROV MS_DEF_PROV_W
1725 #define MS_ENHANCED_PROV MS_ENHANCED_PROV_W
1726 #define MS_STRONG_PROV MS_STRONG_PROV_W
1727 #define MS_DEF_RSA_SIG_PROV MS_DEF_RSA_SIG_PROV_W
1728 #define MS_DEF_RSA_SCHANNEL_PROV MS_DEF_RSA_SCHANNEL_PROV_W
1729 #define MS_DEF_DSS_PROV MS_DEF_DSS_PROV_W
1730 #define MS_DEF_DSS_DH_PROV MS_DEF_DSS_DH_PROV_W
1731 #define MS_ENH_DSS_DH_PROV MS_ENH_DSS_DH_PROV_W
1732 #define MS_DEF_DH_SCHANNEL_PROV MS_DEF_DH_SCHANNEL_PROV_W
1733 #define MS_SCARD_PROV MS_SCARD_PROV_W
1734 #else
1735 #define CertNameToStr CertNameToStrA
1736 #define CryptAcquireContext CryptAcquireContextA
1737 #define CryptSignHash CryptSignHashA
1738 #define CryptVerifySignature CryptVerifySignatureA
1739 #define CryptSetProvider CryptSetProviderA
1740 #define CertOpenSystemStore CertOpenSystemStoreA
1741 #define CERT_FIND_SUBJECT_STR CERT_FIND_SUBJECT_STR_A
1742 #define CERT_FIND_ISSUER_STR CERT_FIND_ISSUER_STR_A
1743 #define MS_DEF_PROV MS_DEF_PROV_A
1744 #define MS_ENHANCED_PROV MS_ENHANCED_PROV_A
1745 #define MS_STRONG_PROV MS_STRONG_PROV_A
1746 #define MS_DEF_RSA_SIG_PROV MS_DEF_RSA_SIG_PROV_A
1747 #define MS_DEF_RSA_SCHANNEL_PROV MS_DEF_RSA_SCHANNEL_PROV_A
1748 #define MS_DEF_DSS_PROV MS_DEF_DSS_PROV_A
1749 #define MS_DEF_DSS_DH_PROV MS_DEF_DSS_DH_PROV_A
1750 #define MS_ENH_DSS_DH_PROV MS_ENH_DSS_DH_PROV_A
1751 #define MS_DEF_DH_SCHANNEL_PROV MS_DEF_DH_SCHANNEL_PROV_A
1752 #define MS_SCARD_PROV MS_SCARD_PROV_A
1753 #endif
1754 #ifdef __cplusplus
1755 }
1756 #endif
1757 #endif /* _WINCRYPT_H */