Changed the version resource to be created in the common way.
[wine/multimedia.git] / include / wincrypt.h
blob07829535fd3802684a0646171b130777e2cf8fda
1 /*
2 * Copyright (C) 2002 Travis Michielsen
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_WINCRYPT_H
20 #define __WINE_WINCRYPT_H
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 /* some typedefs for function parameters */
27 typedef unsigned int ALG_ID;
28 typedef unsigned long HCRYPTPROV;
29 typedef unsigned long HCRYPTKEY;
30 typedef unsigned long HCRYPTHASH;
31 typedef void *HCERTSTORE;
33 /* CSP Structs */
35 typedef struct _CRYPTOAPI_BLOB {
36 DWORD cbData;
37 BYTE* pbData;
38 } CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
39 CRYPT_UINT_BLOB, *PCRYPT_UINT_BLOB,
40 CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
41 CERT_NAME_BLOB, *PCERT_NAME_BLOB,
42 CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
43 CERT_BLOB, *PCERT_BLOB,
44 CRL_BLOB, *PCRL_BLOB,
45 DATA_BLOB, *PDATA_BLOB,
46 CRYPT_DATA_BLOB, *PCRYPT_DATA_BLOB,
47 CRYPT_HASH_BLOB, *PCRYPT_HASH_BLOB,
48 CRYPT_DIGEST_BLOB, *PCRYPT_DIGEST_BLOB,
49 CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
50 CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
52 typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
53 LPSTR pszObjId;
54 CRYPT_OBJID_BLOB Parameters;
55 } CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
57 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
58 LPSTR pszObjId;
59 CRYPT_OBJID_BLOB Value;
60 } CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
62 typedef struct _PUBLICKEYSTRUC {
63 BYTE bType;
64 BYTE bVersion;
65 WORD reserved;
66 ALG_ID aiKeyAlg;
67 } BLOBHEADER, PUBLICKEYSTRUC;
69 typedef struct _CRYPT_BIT_BLOB {
70 DWORD cbData;
71 BYTE *pbData;
72 DWORD cUnusedBits;
73 } CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
75 typedef struct _CERT_PUBLIC_KEY_INFO {
76 CRYPT_ALGORITHM_IDENTIFIER Algorithm;
77 CRYPT_BIT_BLOB PublicKey;
78 } CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
80 typedef struct _CERT_EXTENSION {
81 LPSTR pszObjId;
82 BOOL fCritical;
83 CRYPT_OBJID_BLOB Value;
84 } CERT_EXTENSION, *PCERT_EXTENSION;
86 typedef struct _CERT_INFO {
87 DWORD dwVersion;
88 CRYPT_INTEGER_BLOB SerialNumber;
89 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
90 CERT_NAME_BLOB Issuer;
91 FILETIME NotBefore;
92 FILETIME NotAfter;
93 CERT_NAME_BLOB Subject;
94 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
95 CRYPT_BIT_BLOB IssuerUniqueId;
96 CRYPT_BIT_BLOB SubjectUniqueId;
97 DWORD cExtension;
98 PCERT_EXTENSION rgExtension;
99 } CERT_INFO, *PCERT_INFO;
101 typedef struct _CERT_CONTEXT {
102 DWORD dwCertEncodingType;
103 BYTE *pbCertEncoded;
104 DWORD cbCertEncoded;
105 PCERT_INFO pCertInfo;
106 HCERTSTORE hCertStore;
107 } CERT_CONTEXT, *PCERT_CONTEXT;
108 typedef const CERT_CONTEXT *PCCERT_CONTEXT;
110 typedef struct _VTableProvStruc {
111 DWORD Version;
112 FARPROC pFuncVerifyImage;
113 FARPROC pFuncReturnhWnd;
114 DWORD dwProvType;
115 BYTE *pbContextInfo;
116 DWORD cbContextInfo;
117 LPSTR pszProvName;
118 } VTableProvStruc, *PVTableProvStruc;
120 /* Algorithm IDs */
122 #define GET_ALG_CLASS(x) (x & (7 << 13))
123 #define GET_ALG_TYPE(x) (x & (15 << 9))
124 #define GET_ALG_SID(x) (x & (511))
126 /* Algorithm Classes */
127 #define ALG_CLASS_ANY (0)
128 #define ALG_CLASS_SIGNATURE (1 << 13)
129 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
130 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
131 #define ALG_CLASS_HASH (4 << 13)
132 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
133 /* Algorithm types */
134 #define ALG_TYPE_ANY (0)
135 #define ALG_TYPE_DSS (1 << 9)
136 #define ALG_TYPE_RSA (2 << 9)
137 #define ALG_TYPE_BLOCK (3 << 9)
138 #define ALG_TYPE_STREAM (4 << 9)
140 /* SIDs */
141 #define ALG_SID_ANY (0)
142 /* RSA SIDs */
143 #define ALG_SID_RSA_ANY 0
144 #define ALG_SID_RSA_PKCS 1
145 #define ALG_SID_RSA_MSATWORK 2
146 #define ALG_SID_RSA_ENTRUST 3
147 #define ALG_SID_RSA_PGP 4
148 /* DSS SIDs */
149 #define ALG_SID_DSS_ANY 0
150 #define ALG_SID_DSS_PKCS 1
151 #define ALG_SID_DSS_DMS 2
153 /* DES SIDs */
154 #define ALG_SID_DES 1
155 #define ALG_SID_3DES 3
156 #define ALG_SID_DESX 4
157 #define ALG_SID_IDEA 5
158 #define ALG_SID_CAST 6
159 #define ALG_SID_SAFERSK64 7
160 #define ALD_SID_SAFERSK128 8
161 /* RC2 SIDs */
162 #define ALG_SID_RC4 1
163 #define ALG_SID_RC2 2
164 #define ALG_SID_SEAL 2
165 /* Hash SIDs */
166 #define ALG_SID_MD2 1
167 #define ALG_SID_MD4 2
168 #define ALG_SID_MD5 3
169 #define ALG_SID_SHA 4
170 #define ALG_SID_MAC 5
171 #define ALG_SID_RIPEMD 6
172 #define ALG_SID_RIPEMD160 7
173 #define ALG_SID_SSL3SHAMD5 8
175 /* Algorithm Definitions */
176 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
177 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
178 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
179 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
180 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
181 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
182 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
183 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
184 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
185 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
186 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
187 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
189 /* Provider names */
190 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
191 #if defined(__GNUC__)
192 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
193 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
194 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
195 #elif defined(_MSC_VER)
196 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
197 #else
198 static const WCHAR MS_DEF_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
199 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
200 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
201 #endif
202 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
204 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
205 #if defined(__GNUC__)
206 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
207 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
208 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
209 #elif defined(_MSC_VER)
210 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
211 #else
212 static const WCHAR MS_ENHANCED_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
213 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
214 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
215 #endif
216 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
218 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
219 #if defined(__GNUC__)
220 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
221 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
222 'P','r','o','v','i','d','e','r',0 }
223 #elif defined(_MSC_VER)
224 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
225 #else
226 static const WCHAR MS_STRONG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
227 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
228 'P','r','o','v','i','d','e','r',0 };
229 #endif
230 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
232 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
233 #if defined(__GNUC__)
234 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
235 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
236 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
237 #elif defined(_MSC_VER)
238 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
239 #else
240 static const WCHAR MS_DEF_RSA_SIG_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
241 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
242 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
243 #endif
244 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
246 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
247 #if defined(__GNUC__)
248 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
249 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
250 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
251 #elif defined(_MSC_VER)
252 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
253 #else
254 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
255 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
256 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
257 #endif
258 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
260 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
261 #if defined(__GNUC__)
262 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
263 'B','a','s','e',' ','D','S','S',' ', \
264 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
265 #elif defined(_MSC_VER)
266 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
267 #else
268 static const WCHAR MS_DEF_DSS_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
269 'B','a','s','e',' ','D','S','S',' ',
270 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
271 #endif
272 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
274 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
275 #if defined(__GNUC__)
276 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
277 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
278 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
279 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
280 #elif defined(_MSC_VER)
281 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
282 #else
283 static const WCHAR MS_DEF_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
284 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
285 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
286 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
287 #endif
288 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
290 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
291 #if defined(__GNUC__)
292 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
293 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
294 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
295 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
296 #elif defined(_MSC_VER)
297 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
298 #else
299 static const WCHAR MS_ENH_DSS_DH_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
300 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
301 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
302 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
303 #endif
304 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
306 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
307 #if defined(__GNUC__)
308 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
309 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
310 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
311 #elif defined(_MSC_VER)
312 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
313 #else
314 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
315 'D','H',' ','S','C','h','a','n','n','e','l',' ',
316 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
317 #endif
318 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
320 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
321 #if defined(__GNUC__)
322 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
323 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
324 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
325 #elif defined(_MSC_VER)
326 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
327 #else
328 static const WCHAR MS_SCARD_PROV_W[] = { 'M','i','c','r','o','s','o','f','t',' ',
329 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
330 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
331 #endif
332 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
334 /* Key Specs*/
335 #define AT_KEYEXCHANGE 1
336 #define AT_SIGNATURE 2
338 /* Provider Types */
339 #define PROV_RSA_FULL 1
340 #define PROV_RSA_SIG 2
341 #define PROV_DSS 3
342 #define PROV_FORTEZZA 4
343 #define PROV_MS_EXCHANGE 5
344 #define PROV_SSL 6
345 #define PROV_RSA_SCHANNEL 12
346 #define PROV_DSS_DH 13
347 #define PROV_EC_ECDSA_SIG 14
348 #define PROV_EC_ECNRA_SIG 15
349 #define PROV_EC_ECDSA_FULL 16
350 #define PROV_EC_ECNRA_FULL 17
351 #define PROV_DH_SCHANNEL 18
352 #define PROV_SPYRUS_LYNKS 20
353 #define PROV_RNG 21
354 #define PROV_INTEL_SEC 22
355 #define PROV_REPLACE_OWF 23
356 #define PROV_RSA_AES 24
358 /* FLAGS Section */
360 /* Provider Parameters */
361 #define PP_ENUMALGS 1
362 #define PP_ENUMCONTAINERS 2
363 #define PP_IMPTYPE 3
364 #define PP_NAME 4
365 #define PP_VERSION 5
366 #define PP_CONTAINER 6
368 #define CRYPT_FIRST 1
369 #define CRYPT_NEXT 2
371 #define CRYPT_IMPL_HARDWARE 1
372 #define CRYPT_IMPL_SOFTWARE 2
373 #define CRYPT_IMPL_MIXED 3
374 #define CRYPT_IMPL_UNKNOWN 4
376 /* CryptAcquireContext */
377 #define CRYPT_VERIFYCONTEXT 0xF0000000
378 #define CRYPT_NEWKEYSET 0x00000008
379 #define CRYPT_MACHINE_KEYSET 0x00000000
380 #define CRYPT_DELETEKEYSET 0x00000010
381 #define CRYPT_SILENT 0x00000000
383 /* Crypt{Get|Set}Provider */
384 #define CRYPT_MACHINE_DEFAULT 0x00000001
385 #define CRYPT_USER_DEFAULT 0x00000002
386 #define CRYPT_DELETE_DEFAULT 0x00000004
388 /* Crypt{Get/Set}ProvParam */
389 #define PP_CLIENT_HWND 1
390 #define PP_ENUMALGS 1
391 #define PP_ENUMCONTAINERS 2
392 #define PP_IMPTYPE 3
393 #define PP_NAME 4
394 #define PP_VERSION 5
395 #define PP_CONTAINER 6
396 #define PP_CHANGE_PASSWORD 7
397 #define PP_KEYSET_SEC_DESCR 8
398 #define PP_KEY_TYPE_SUBTYPE 10
399 #define PP_CONTEXT_INFO 11
400 #define PP_KEYEXCHANGE_KEYSIZE 12
401 #define PP_SIGNATURE_KEYSIZE 13
402 #define PP_KEYEXCHANGE_ALG 14
403 #define PP_SIGNATURE_ALG 15
404 #define PP_PROVTYPE 16
405 #define PP_KEYSTORAGE 17
406 #define PP_SYM_KEYSIZE 19
407 #define PP_SESSION_KEYSIZE 20
408 #define PP_UI_PROMPT 21
409 #define PP_ENUMALGS_EX 22
410 #define PP_DELETEKEY 24
411 #define PP_ENUMMANDROOTS 25
412 #define PP_ENUMELECTROOTS 26
413 #define PP_KEYSET_TYPE 27
414 #define PP_ADMIN_PIN 31
415 #define PP_KEYEXCHANGE_PIN 32
416 #define PP_SIGNATURE_PIN 33
417 #define PP_SIG_KEYSIZE_INC 34
418 #define PP_KEYX_KEYSIZE_INC 35
419 #define PP_UNIQUE_CONTAINER 36
420 #define PP_SGC_INFO 37
421 #define PP_USE_HARDWARE_RNG 38
422 #define PP_KEYSPEC 39
423 #define PP_ENUMEX_SIGNING_PROT 40
425 /* CryptSignHash/CryptVerifySignature */
426 #define CRYPT_NOHASHOID 0x00000001
427 #define CRYPT_TYPE2_FORMAT 0x00000002
428 #define CRYPT_X931_FORMAT 0x00000004
430 /* Crypt*Key */
431 #define CRYPT_EXPORTABLE 0x00000001
432 #define CRYPT_USER_PROTECTED 0x00000002
433 #define CRYPT_CREATE_SALT 0x00000004
434 #define CRYPT_UPDATE_KEY 0x00000008
435 #define CRYPT_NO_SALT 0x00000010
436 #define CRYPT_PREGEN 0x00000040
437 #define CRYPT_ARCHIVABLE 0x00004000
438 #define CRYPT_SSL2_FALLBACK 0x00000002
439 #define CRYPT_DESTROYKEY 0x00000004
440 #define CRYPT_OAEP 0x00000040
442 /* Blob Types */
443 #define SIMPLEBLOB 0x1
444 #define PUBLICKEYBLOB 0x6
445 #define PRIVATEKEYBLOB 0x7
446 #define PLAINTEXTKEYBLOB 0x8
447 #define OPAQUEKEYBLOB 0x9
448 #define PUBLICKEYBLOBEX 0xA
449 #define SYMMETRICWRAPKEYBLOB 0xB
451 /* function declarations */
452 /* advapi32.dll */
453 BOOL WINAPI CryptAcquireContextA(HCRYPTPROV *phProv, LPCSTR pszContainer,
454 LPCSTR pszProvider, DWORD dwProvType,
455 DWORD dwFlags);
456 BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
457 LPCWSTR pszProvider, DWORD dwProvType, DWORD dwFlags);
458 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
459 BOOL WINAPI CryptGenRandom (HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer);
460 BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFlags);
461 BOOL WINAPI CryptCreateHash (HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey,
462 DWORD dwFlags, HCRYPTHASH *phHash);
463 BOOL WINAPI CryptDecrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
464 DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
465 BOOL WINAPI CryptDeriveKey (HCRYPTPROV hProv, ALG_ID Algid, HCRYPTHASH hBaseData,
466 DWORD dwFlags, HCRYPTKEY *phKey);
467 BOOL WINAPI CryptDestroyHash (HCRYPTHASH hHash);
468 BOOL WINAPI CryptDestroyKey (HCRYPTKEY hKey);
469 BOOL WINAPI CryptDuplicateKey (HCRYPTKEY hKey, DWORD *pdwReserved, DWORD dwFlags, HCRYPTKEY *phKey);
470 BOOL WINAPI CryptDuplicateHash (HCRYPTHASH hHash, DWORD *pdwReserved,
471 DWORD dwFlags, HCRYPTHASH *phHash);
472 BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
473 DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen, DWORD dwBufLen);
474 BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
475 DWORD dwFlags, DWORD *pdwProvType, LPSTR pszProvName, DWORD *pcbProvName);
476 BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved,
477 DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszProvName, DWORD *pcbProvName);
478 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
479 BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
480 DWORD dwFlags, DWORD *pdwProvType, LPSTR pszTypeName, DWORD *pcbTypeName);
481 BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
482 DWORD dwFlags, DWORD *pdwProvType, LPWSTR pszTypeName, DWORD *pcbTypeName);
483 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
484 BOOL WINAPI CryptExportKey (HCRYPTKEY hKey, HCRYPTKEY hExpKey, DWORD dwBlobType,
485 DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
486 BOOL WINAPI CryptGenKey (HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKEY *phKey);
487 BOOL WINAPI CryptGetKeyParam (HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData,
488 DWORD *pdwDataLen, DWORD dwFlags);
489 BOOL WINAPI CryptGetHashParam (HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData,
490 DWORD *pdwDataLen, DWORD dwFlags);
491 BOOL WINAPI CryptGetProvParam (HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData,
492 DWORD *pdwDataLen, DWORD dwFlags);
493 BOOL WINAPI CryptGetDefaultProviderA (DWORD dwProvType, DWORD *pdwReserved,
494 DWORD dwFlags, LPSTR pszProvName, DWORD *pcbProvName);
495 BOOL WINAPI CryptGetDefaultProviderW (DWORD dwProvType, DWORD *pdwReserved,
496 DWORD dwFlags, LPWSTR pszProvName, DWORD *pcbProvName);
497 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
498 BOOL WINAPI CryptGetUserKey (HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUserKey);
499 BOOL WINAPI CryptHashData (HCRYPTHASH hHash, BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
500 BOOL WINAPI CryptHashSessionKey (HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags);
501 BOOL WINAPI CryptImportKey (HCRYPTPROV hProv, BYTE *pbData, DWORD dwDataLen,
502 HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey);
503 BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags);
504 BOOL WINAPI CryptSignHashA (HCRYPTHASH hHash, DWORD dwKeySpec, LPCSTR sDescription,
505 DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen);
506 BOOL WINAPI CryptSignHashW (HCRYPTHASH hHash, DWORD dwKeySpec, LPCWSTR sDescription,
507 DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen);
508 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
509 BOOL WINAPI CryptSetHashParam (HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD dwFlags);
510 BOOL WINAPI CryptSetKeyParam (HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD dwFlags);
511 BOOL WINAPI CryptSetProviderA (LPCSTR pszProvName, DWORD dwProvType);
512 BOOL WINAPI CryptSetProviderW (LPCWSTR pszProvName, DWORD dwProvType);
513 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
514 BOOL WINAPI CryptSetProviderExA (LPCSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags);
515 BOOL WINAPI CryptSetProviderExW (LPCWSTR pszProvName, DWORD dwProvType, DWORD *pdwReserved, DWORD dwFlags);
516 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
517 BOOL WINAPI CryptSetProvParam (HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD dwFlags);
518 BOOL WINAPI CryptVerifySignatureA (HCRYPTHASH hHash, BYTE *pbSignature, DWORD dwSigLen,
519 HCRYPTKEY hPubKey, LPCSTR sDescription, DWORD dwFlags);
520 BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH hHash, BYTE *pbSignature, DWORD dwSigLen,
521 HCRYPTKEY hPubKey, LPCWSTR sDescription, DWORD dwFlags);
522 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
524 #ifdef __cplusplus
526 #endif
528 #endif