2 * Copyright (C) 2002 Travis Michielsen
3 * Copyright (C) 2004-2005 Juan Lang
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef __WINE_WINCRYPT_H
21 #define __WINE_WINCRYPT_H
27 /* some typedefs for function parameters */
28 typedef unsigned int ALG_ID
;
29 typedef unsigned long HCRYPTPROV
;
30 typedef unsigned long HCRYPTKEY
;
31 typedef unsigned long HCRYPTHASH
;
32 typedef void *HCERTSTORE
;
33 typedef void *HCRYPTMSG
;
37 typedef struct _PROV_ENUMALGS
{
44 typedef struct _PROV_ENUMALGS_EX
{
56 #define SCHANNEL_MAC_KEY 0
57 #define SCHANNEL_ENC_KEY 1
59 typedef struct _SCHANNEL_ALG
{
65 } SCHANNEL_ALG
, *PSCHANNEL_ALG
;
67 typedef struct _HMAC_INFO
{
73 } HMAC_INFO
, *PHMAC_INFO
;
75 typedef struct _CRYPTOAPI_BLOB
{
78 } CRYPT_INTEGER_BLOB
, *PCRYPT_INTEGER_BLOB
,
79 CRYPT_UINT_BLOB
, *PCRYPT_UINT_BLOB
,
80 CRYPT_OBJID_BLOB
, *PCRYPT_OBJID_BLOB
,
81 CERT_NAME_BLOB
, *PCERT_NAME_BLOB
,
82 CERT_RDN_VALUE_BLOB
, *PCERT_RDN_VALUE_BLOB
,
83 CERT_BLOB
, *PCERT_BLOB
,
85 DATA_BLOB
, *PDATA_BLOB
,
86 CRYPT_DATA_BLOB
, *PCRYPT_DATA_BLOB
,
87 CRYPT_HASH_BLOB
, *PCRYPT_HASH_BLOB
,
88 CRYPT_DIGEST_BLOB
, *PCRYPT_DIGEST_BLOB
,
89 CRYPT_DER_BLOB
, *PCRYPT_DER_BLOB
,
90 CRYPT_ATTR_BLOB
, *PCRYPT_ATTR_BLOB
;
92 typedef struct _CRYPTPROTECT_PROMPTSTRUCT
{
97 } CRYPTPROTECT_PROMPTSTRUCT
, *PCRYPTPROTECT_PROMPTSTRUCT
;
99 typedef struct _CRYPT_ALGORITHM_IDENTIFIER
{
101 CRYPT_OBJID_BLOB Parameters
;
102 } CRYPT_ALGORITHM_IDENTIFIER
, *PCRYPT_ALGORITHM_IDENTIFIER
;
104 typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE
{
106 CRYPT_OBJID_BLOB Value
;
107 } CRYPT_ATTRIBUTE_TYPE_VALUE
, *PCRYPT_ATTRIBUTE_TYPE_VALUE
;
109 typedef struct _PUBLICKEYSTRUC
{
114 } BLOBHEADER
, PUBLICKEYSTRUC
;
116 typedef struct _RSAPUBKEY
{
122 typedef struct _CRYPT_BIT_BLOB
{
126 } CRYPT_BIT_BLOB
, *PCRYPT_BIT_BLOB
;
128 typedef struct _CERT_PUBLIC_KEY_INFO
{
129 CRYPT_ALGORITHM_IDENTIFIER Algorithm
;
130 CRYPT_BIT_BLOB PublicKey
;
131 } CERT_PUBLIC_KEY_INFO
, *PCERT_PUBLIC_KEY_INFO
;
133 typedef struct _CERT_EXTENSION
{
136 CRYPT_OBJID_BLOB Value
;
137 } CERT_EXTENSION
, *PCERT_EXTENSION
;
139 typedef struct _CERT_EXTENSIONS
{
141 PCERT_EXTENSION rgExtension
;
142 } CERT_EXTENSIONS
, *PCERT_EXTENSIONS
;
144 typedef struct _CERT_INFO
{
146 CRYPT_INTEGER_BLOB SerialNumber
;
147 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
148 CERT_NAME_BLOB Issuer
;
151 CERT_NAME_BLOB Subject
;
152 CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo
;
153 CRYPT_BIT_BLOB IssuerUniqueId
;
154 CRYPT_BIT_BLOB SubjectUniqueId
;
156 PCERT_EXTENSION rgExtension
;
157 } CERT_INFO
, *PCERT_INFO
;
159 typedef struct _CERT_RDN_ATTR
{
162 CERT_RDN_VALUE_BLOB Value
;
163 } CERT_RDN_ATTR
, *PCERT_RDN_ATTR
;
165 typedef struct _CERT_RDN
{
167 PCERT_RDN_ATTR rgRDNAttr
;
168 } CERT_RDN
, *PCERT_RDN
;
170 typedef struct _CERT_NAME_INFO
{
173 } CERT_NAME_INFO
, *PCERT_NAME_INFO
;
175 typedef struct _CERT_NAME_VALUE
{
177 CERT_RDN_VALUE_BLOB Value
;
178 } CERT_NAME_VALUE
, *PCERT_NAME_VALUE
;
180 typedef struct _CERT_ENCRYPTED_PRIVATE_KEY_INFO
{
181 CRYPT_ALGORITHM_IDENTIFIER EncryptionAlgorithm
;
182 CRYPT_DATA_BLOB EncryptedPrivateKey
;
183 } CERT_ENCRYPTED_PRIVATE_KEY_INFO
, *PCERT_ENCRYPTED_PRIVATE_KEY_INFO
;
185 typedef struct _CERT_AUTHORITY_KEY_ID_INFO
{
186 CRYPT_DATA_BLOB KeyId
;
187 CERT_NAME_BLOB CertIssuer
;
188 CRYPT_INTEGER_BLOB CertSerialNumber
;
189 } CERT_AUTHORITY_KEY_ID_INFO
, *PCERT_AUTHORITY_KEY_ID_INFO
;
191 typedef struct _CERT_PRIVATE_KEY_VALIDITY
{
194 } CERT_PRIVATE_KEY_VALIDITY
, *PCERT_PRIVATE_KEY_VALIDITY
;
196 typedef struct _CERT_KEY_ATTRIBUTES_INFO
{
197 CRYPT_DATA_BLOB KeyId
;
198 CRYPT_BIT_BLOB IntendedKeyUsage
;
199 PCERT_PRIVATE_KEY_VALIDITY pPrivateKeyUsagePeriod
;
200 } CERT_KEY_ATTRIBUTES_INFO
, *PCERT_KEY_ATTRIBUTES_INFO
;
203 #define CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80
204 #define CERT_NON_REPUDIATION_KEY_USAGE 0x40
205 #define CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20
206 #define CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10
207 #define CERT_KEY_AGREEMENT_KEY_USAGE 0x80
208 #define CERT_KEY_CERT_SIGN_KEY_USAGE 0x40
209 #define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x20
210 #define CERT_CRL_SIGN_KEY_USAGE 0x10
211 #define CERT_ENCIPHER_ONLY_KEY_USAGE 0x01
213 #define CERT_DECIPHER_ONLY_KEY_USAGE 0x80
215 typedef struct _CERT_POLICY_ID
{
216 DWORD cCertPolicyElementId
;
217 LPSTR
*rgbszCertPolicyElementId
;
218 } CERT_POLICY_ID
, *PCERT_POLICY_ID
;
220 typedef struct _CERT_KEY_USAGE_RESTRICTION_INFO
{
222 PCERT_POLICY_ID rgCertPolicyId
;
223 CRYPT_BIT_BLOB RestrictedKeyUsage
;
224 } CERT_KEY_USAGE_RESTRICTION_INFO
, *PCERT_KEY_USAGE_RESTRICTION_INFO
;
226 typedef struct _CERT_OTHER_NAME
{
228 CRYPT_OBJID_BLOB Value
;
229 } CERT_OTHER_NAME
, *PCERT_OTHER_NAME
;
231 typedef struct _CERT_ALT_NAME_ENTRY
{
232 DWORD dwAltNameChoice
;
234 PCERT_OTHER_NAME pOtherName
;
235 LPWSTR pwszRfc822Name
;
237 CERT_NAME_BLOB DirectoryName
;
239 CRYPT_DATA_BLOB IPaddress
;
240 LPSTR pszRegisteredID
;
242 } CERT_ALT_NAME_ENTRY
, *PCERT_ALT_NAME_ENTRY
;
244 #define CERT_ALT_NAME_OTHER_NAME 1
245 #define CERT_ALT_NAME_RFC822_NAME 2
246 #define CERT_ALT_NAME_DNS_NAME 3
247 #define CERT_ALT_NAME_X400_ADDRESS 4
248 #define CERT_ALT_NAME_DIRECTORY_NAME 5
249 #define CERT_ALT_NAME_EDI_PARTY_NAME 6
250 #define CERT_ALT_NAME_URL 7
251 #define CERT_ALT_NAME_IP_ADDRESS 8
252 #define CERT_ALT_NAME_REGISTERED_ID 9
254 typedef struct _CERT_ALT_NAME_INFO
{
256 PCERT_ALT_NAME_ENTRY rgAltEntry
;
257 } CERT_ALT_NAME_INFO
, *PCERT_ALT_NAME_INFO
;
259 #define CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK 0xff
260 #define CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT 16
261 #define CERT_ALT_NAME_VALUE_ERR_INDEX_MASK 0x0000ffff
262 #define CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT 0
263 #define GET_CERT_ALT_NAME_ENTRY_ERR_INDEX(x) \
264 (((x) >> CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT) & \
265 CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK)
266 #define GET_CERT_ALT_NAME_VALUE_ERR_INDEX(x) \
267 ((x) & CERT_ALT_NAME_VALUE_ERR_INDEX_MASK)
269 typedef struct _CERT_BASIC_CONSTRAINTS_INFO
{
270 CRYPT_BIT_BLOB SubjectType
;
271 BOOL fPathLenConstraint
;
272 DWORD dwPathLenConstraint
;
273 DWORD cSubtreesConstraint
;
274 CERT_NAME_BLOB
*rgSubtreesConstraint
;
275 } CERT_BASIC_CONSTRAINTS_INFO
, *PCERT_BASIC_CONSTRAINTS_INFO
;
277 #define CERT_CA_SUBJECT_FLAG 0x80
278 #define CERT_END_ENTITY_SUBJECT_FLAG 0x40
280 typedef struct _CERT_BASIC_CONSTRAINTS2_INFO
{
282 BOOL fPathLenConstraint
;
283 DWORD dwPathLenConstraint
;
284 } CERT_BASIC_CONSTRAINTS2_INFO
, *PCERT_BASIC_CONSTRAINTS2_INFO
;
286 typedef struct _CERT_CONTEXT
{
287 DWORD dwCertEncodingType
;
290 PCERT_INFO pCertInfo
;
291 HCERTSTORE hCertStore
;
292 } CERT_CONTEXT
, *PCERT_CONTEXT
;
293 typedef const CERT_CONTEXT
*PCCERT_CONTEXT
;
295 typedef struct _CRL_ENTRY
{
296 CRYPT_INTEGER_BLOB SerialNumber
;
297 FILETIME RevocationDate
;
299 PCERT_EXTENSION rgExtension
;
300 } CRL_ENTRY
, *PCRL_ENTRY
;
302 typedef struct _CRL_INFO
{
304 CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm
;
305 CERT_NAME_BLOB Issuer
;
309 PCRL_ENTRY rgCRLEntry
;
311 PCERT_EXTENSION rgExtension
;
312 } CRL_INFO
, *PCRL_INFO
;
314 typedef struct _CRL_CONTEXT
{
315 DWORD dwCertEncodingType
;
319 HCERTSTORE hCertStore
;
320 } CRL_CONTEXT
, *PCRL_CONTEXT
;
321 typedef const CRL_CONTEXT
*PCCRL_CONTEXT
;
323 typedef struct _VTableProvStruc
{
325 FARPROC pFuncVerifyImage
;
326 FARPROC pFuncReturnhWnd
;
331 } VTableProvStruc
, *PVTableProvStruc
;
333 typedef struct _CRYPT_ATTRIBUTE
{
336 CRYPT_DATA_BLOB rgValue
;
337 } CRYPT_ATTRIBUTE
, *PCRYPT_ATTRIBUTE
;
339 typedef struct _CRYPT_ATTRIBUTES
{
341 PCRYPT_ATTRIBUTE rgAttr
;
342 } CRYPT_ATTRIBUTES
, *PCRYPT_ATTRIBUTES
;
344 typedef struct _CERT_PRIVATE_KEY_INFO
{
346 CRYPT_ALGORITHM_IDENTIFIER Algorithm
;
347 CRYPT_DER_BLOB PrivateKey
;
348 PCRYPT_ATTRIBUTES pAttributes
;
349 } CERT_PRIVATE_KEY_INFO
, *PCERT_PRIVATE_KEY_INFO
;
351 typedef struct _CTL_USAGE
{
352 DWORD cUsageIdentifier
;
353 LPSTR
*rgpszUsageIdentifier
;
354 } CTL_USAGE
, *PCTL_USAGE
, CERT_ENHKEY_USAGE
, *PCERT_ENHKEY_USAGE
;
356 typedef struct _CTL_ENTRY
{
357 CRYPT_DATA_BLOB SubjectIdentifier
;
359 PCRYPT_ATTRIBUTE rgAttribute
;
360 } CTL_ENTRY
, *PCTL_ENTRY
;
362 typedef struct _CTL_INFO
{
364 CTL_USAGE SubjectUsage
;
365 CRYPT_DATA_BLOB ListIdentifier
;
366 CRYPT_INTEGER_BLOB SequenceNumber
;
369 CRYPT_ALGORITHM_IDENTIFIER SubjectAlgorithm
;
371 PCTL_ENTRY rgCTLEntry
;
373 PCERT_EXTENSION rgExtension
;
374 } CTL_INFO
, *PCTL_INFO
;
376 typedef struct _CTL_CONTEXT
{
377 DWORD dwMsgAndCertEncodingType
;
381 HCERTSTORE hCertStore
;
385 } CTL_CONTEXT
, *PCTL_CONTEXT
;
386 typedef const CTL_CONTEXT
*PCCTL_CONTEXT
;
388 typedef struct _CMSG_SIGNER_INFO
{
390 CERT_NAME_BLOB Issuer
;
391 CRYPT_INTEGER_BLOB SerialNumber
;
392 CRYPT_ALGORITHM_IDENTIFIER HashAlgorithm
;
393 CRYPT_ALGORITHM_IDENTIFIER HashEncryptionAlgorithm
;
394 CRYPT_DATA_BLOB EncryptedHash
;
395 CRYPT_ATTRIBUTES AuthAttrs
;
396 CRYPT_ATTRIBUTES UnauthAttrs
;
397 } CMSG_SIGNER_INFO
, *PCMSG_SIGNER_INFO
;
399 typedef struct _CERT_REVOCATION_CRL_INFO
{
401 PCCRL_CONTEXT pBaseCrlContext
;
402 PCCRL_CONTEXT pDeltaCrlContext
;
403 PCRL_ENTRY pCrlEntry
;
405 } CERT_REVOCATION_CRL_INFO
, *PCERT_REVOCATION_CRL_INFO
;
407 typedef struct _CERT_REVOCATION_INFO
{
409 DWORD dwRevocationResult
;
410 LPCSTR pszRevocationOid
;
411 LPVOID pvOidSpecificInfo
;
412 BOOL fHasFreshnessTime
;
413 DWORD dwFreshnessTime
;
414 PCERT_REVOCATION_CRL_INFO pCrlInfo
;
415 } CERT_REVOCATION_INFO
, *PCERT_REVOCATION_INFO
;
417 typedef struct _CERT_TRUST_LIST_INFO
{
419 PCTL_ENTRY pCtlEntry
;
420 PCCTL_CONTEXT pCtlContext
;
421 } CERT_TRUST_LIST_INFO
, *PCERT_TRUST_LIST_INFO
;
423 typedef struct _CERT_TRUST_STATUS
{
426 } CERT_TRUST_STATUS
, *PCERT_TRUST_STATUS
;
428 typedef struct _CERT_CHAIN_ELEMENT
{
430 PCCERT_CONTEXT pCertContext
;
431 CERT_TRUST_STATUS TrustStatus
;
432 PCERT_REVOCATION_INFO pRevocationInfo
;
433 PCERT_ENHKEY_USAGE pIssuanceUsage
;
434 PCERT_ENHKEY_USAGE pApplicationUsage
;
435 LPCWSTR pwszExtendedErrorInfo
;
436 } CERT_CHAIN_ELEMENT
, *PCERT_CHAIN_ELEMENT
;
438 typedef struct _CERT_SIMPLE_CHAIN
{
440 CERT_TRUST_STATUS TrustStatus
;
442 PCERT_CHAIN_ELEMENT
*rgpElement
;
443 PCERT_TRUST_LIST_INFO pTrustListInfo
;
444 BOOL fHasRevocationFreshnessTime
;
445 DWORD dwRevocationFreshnessTime
;
446 } CERT_SIMPLE_CHAIN
, *PCERT_SIMPLE_CHAIN
;
448 typedef struct _CERT_CHAIN_CONTEXT CERT_CHAIN_CONTEXT
, *PCERT_CHAIN_CONTEXT
;
449 typedef const CERT_CHAIN_CONTEXT
*PCCERT_CHAIN_CONTEXT
;
451 struct _CERT_CHAIN_CONTEXT
{
453 CERT_TRUST_STATUS TrustStatus
;
455 PCERT_SIMPLE_CHAIN
*rgpChain
;
456 DWORD cLowerQualityChainContext
;
457 PCCERT_CHAIN_CONTEXT
*rgbLowerQualityChainContext
;
458 BOOL fHasRevocationFreshnessTime
;
459 DWORD dwRevocationFreshnessTime
;
462 typedef struct _CERT_CHAIN_POLICY_PARA
{
465 void *pvExtraPolicyPara
;
466 } CERT_CHAIN_POLICY_PARA
, *PCERT_CHAIN_POLICY_PARA
;
468 typedef struct _CERT_CHAIN_POLICY_STATUS
{
473 void *pvExtraPolicyStatus
;
474 } CERT_CHAIN_POLICY_STATUS
, *PCERT_CHAIN_POLICY_STATUS
;
476 typedef struct _CERT_SYSTEM_STORE_INFO
{
478 } CERT_SYSTEM_STORE_INFO
, *PCERT_SYSTEM_STORE_INFO
;
480 typedef struct _CERT_PHYSICAL_STORE_INFO
{
482 LPSTR pszOpenStoreProvider
;
483 DWORD dwOpenEncodingType
;
485 CRYPT_DATA_BLOB OpenParameters
;
488 } CERT_PHYSICAL_STORE_INFO
, *PCERT_PHYSICAL_STORE_INFO
;
490 typedef struct _CERT_SYSTEM_STORE_RELOCATE_PARA
{
497 LPCSTR pszSystemStore
;
498 LPCWSTR pwszSystemStore
;
500 } CERT_SYSTEM_STORE_RELOCATE_PARA
, *PCERT_SYSTEM_STORE_RELOCATE_PARA
;
502 typedef BOOL (WINAPI
*PFN_CERT_ENUM_SYSTEM_STORE_LOCATION
)(
503 LPCWSTR pwszStoreLocation
, DWORD dwFlags
, void *pvReserved
, void *pvArg
);
505 typedef BOOL (WINAPI
*PFN_CERT_ENUM_SYSTEM_STORE
)(const void *pvSystemStore
,
506 DWORD dwFlags
, PCERT_SYSTEM_STORE_INFO pStoreInfo
, void *pvReserved
,
509 typedef BOOL (WINAPI
*PFN_CERT_ENUM_PHYSICAL_STORE
)(const void *pvSystemStore
,
510 DWORD dwFlags
, LPCWSTR pwszStoreName
, PCERT_PHYSICAL_STORE_INFO pStoreInfo
,
511 void *pvReserved
, void *pvArg
);
513 /* Encode/decode object */
514 typedef LPVOID (WINAPI
*PFN_CRYPT_ALLOC
)(size_t cbsize
);
515 typedef VOID (WINAPI
*PFN_CRYPT_FREE
)(LPVOID pv
);
517 typedef struct _CRYPT_ENCODE_PARA
{
519 PFN_CRYPT_ALLOC pfnAlloc
;
520 PFN_CRYPT_FREE pfnFree
;
521 } CRYPT_ENCODE_PARA
, *PCRYPT_ENCODE_PARA
;
523 typedef struct _CRYPT_DECODE_PARA
{
525 PFN_CRYPT_ALLOC pfnAlloc
;
526 PFN_CRYPT_FREE pfnFree
;
527 } CRYPT_DECODE_PARA
, *PCRYPT_DECODE_PARA
;
531 #define GET_ALG_CLASS(x) (x & (7 << 13))
532 #define GET_ALG_TYPE(x) (x & (15 << 9))
533 #define GET_ALG_SID(x) (x & (511))
535 /* Algorithm Classes */
536 #define ALG_CLASS_ANY (0)
537 #define ALG_CLASS_SIGNATURE (1 << 13)
538 #define ALG_CLASS_MSG_ENCRYPT (2 << 13)
539 #define ALG_CLASS_DATA_ENCRYPT (3 << 13)
540 #define ALG_CLASS_HASH (4 << 13)
541 #define ALG_CLASS_KEY_EXCHANGE (5 << 13)
542 /* Algorithm types */
543 #define ALG_TYPE_ANY (0)
544 #define ALG_TYPE_DSS (1 << 9)
545 #define ALG_TYPE_RSA (2 << 9)
546 #define ALG_TYPE_BLOCK (3 << 9)
547 #define ALG_TYPE_STREAM (4 << 9)
548 #define ALG_TYPE_DH (5 << 9)
549 #define ALG_TYPE_SECURECHANNEL (6 << 9)
552 #define ALG_SID_ANY (0)
554 #define ALG_SID_RSA_ANY 0
555 #define ALG_SID_RSA_PKCS 1
556 #define ALG_SID_RSA_MSATWORK 2
557 #define ALG_SID_RSA_ENTRUST 3
558 #define ALG_SID_RSA_PGP 4
560 #define ALG_SID_DSS_ANY 0
561 #define ALG_SID_DSS_PKCS 1
562 #define ALG_SID_DSS_DMS 2
565 #define ALG_SID_DES 1
566 #define ALG_SID_3DES 3
567 #define ALG_SID_DESX 4
568 #define ALG_SID_IDEA 5
569 #define ALG_SID_CAST 6
570 #define ALG_SID_SAFERSK64 7
571 #define ALG_SID_SAFERSK128 8
572 #define ALG_SID_3DES_112 9
573 /* Diffie-Hellmans SIDs */
574 #define ALG_SID_DH_SANDF 1
575 #define ALG_SID_DH_EPHEM 2
576 #define ALG_SID_AGREED_KEY_ANY 3
577 #define ALG_SID_KEA 4
579 #define ALG_SID_RC4 1
580 #define ALG_SID_RC2 2
581 #define ALG_SID_SEAL 2
583 #define ALG_SID_MD2 1
584 #define ALG_SID_MD4 2
585 #define ALG_SID_MD5 3
586 #define ALG_SID_SHA 4
587 #define ALG_SID_MAC 5
588 #define ALG_SID_RIPEMD 6
589 #define ALG_SID_RIPEMD160 7
590 #define ALG_SID_SSL3SHAMD5 8
591 #define ALG_SID_HMAC 9
592 #define ALG_SID_TLS1PRF 10
594 #define ALG_SID_SSL3_MASTER 1
595 #define ALG_SID_SCHANNEL_MASTER_HASH 2
596 #define ALG_SID_SCHANNEL_MAC_KEY 3
597 #define ALG_SID_PCT1_MASTER 4
598 #define ALG_SID_SSL2_MASTER 5
599 #define ALG_SID_TLS1_MASTER 6
600 #define ALG_SID_SCHANNEL_ENC_KEY 7
602 /* Algorithm Definitions */
603 #define CALG_MD2 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
604 #define CALG_MD4 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
605 #define CALG_MD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
606 #define CALG_SHA (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
607 #define CALG_MAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
608 #define CALG_SSL3_SHAMD5 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
609 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
610 #define CALG_TLS1PRF (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
611 #define CALG_RSA_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
612 #define CALG_DSS_SIGN (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
613 #define CALG_DH_SF (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF)
614 #define CALG_DH_EPHEM (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM)
615 #define CALG_RSA_KEYX (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
616 #define CALG_DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES)
617 #define CALG_RC2 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2)
618 #define CALG_3DES (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES)
619 #define CALG_3DES_112 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112)
620 #define CALG_RC4 (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4)
621 #define CALG_SEAL (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL)
622 #define CALG_SSL3_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL3_MASTER)
623 #define CALG_SCHANNEL_MASTER_HASH (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MASTER_HASH)
624 #define CALG_SCHANNEL_MAC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_MAC_KEY)
625 #define CALG_SCHANNEL_ENC_KEY (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SCHANNEL_ENC_KEY)
626 #define CALG_PCT1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_PCT1_MASTER)
627 #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER)
628 #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER)
631 #define CRYPT_FLAG_PCT1 0x0001
632 #define CRYPT_FLAG_SSL2 0x0002
633 #define CRYPT_FLAG_SSL3 0x0004
634 #define CRYPT_FLAG_TLS1 0x0008
635 #define CRYPT_FLAG_IPSEC 0x0010
636 #define CRYPT_FLAG_SIGNING 0x0020
639 #define MS_DEF_PROV_A "Microsoft Base Cryptographic Provider v1.0"
640 #if defined(__GNUC__)
641 # define MS_DEF_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
642 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
643 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
644 #elif defined(_MSC_VER)
645 # define MS_DEF_PROV_W L"Microsoft Base Cryptographic Provider v1.0"
647 static const WCHAR MS_DEF_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
648 'B','a','s','e',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
649 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
651 #define MS_DEF_PROV WINELIB_NAME_AW(MS_DEF_PROV_)
653 #define MS_ENHANCED_PROV_A "Microsoft Enhanced Cryptographic Provider v1.0"
654 #if defined(__GNUC__)
655 # define MS_ENHANCED_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
656 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
657 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 }
658 #elif defined(_MSC_VER)
659 # define MS_ENHANCED_PROV_W L"Microsoft Enhanced Cryptographic Provider v1.0"
661 static const WCHAR MS_ENHANCED_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
662 'E','n','h','a','n','c','e','d',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
663 'P','r','o','v','i','d','e','r',' ','v','1','.','0',0 };
665 #define MS_ENHANCED_PROV WINELIB_NAME_AW(MS_ENHANCED_PROV_)
667 #define MS_STRONG_PROV_A "Microsoft Strong Cryptographic Provider"
668 #if defined(__GNUC__)
669 # define MS_STRONG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
670 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ', \
671 'P','r','o','v','i','d','e','r',0 }
672 #elif defined(_MSC_VER)
673 # define MS_STRONG_PROV_W L"Microsoft Strong Cryptographic Provider"
675 static const WCHAR MS_STRONG_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
676 'S','t','r','o','n','g',' ','C','r','y','p','t','o','g','r','a','p','h','i','c',' ',
677 'P','r','o','v','i','d','e','r',0 };
679 #define MS_STRONG_PROV WINELIB_NAME_AW(MS_STRONG_PROV_)
681 #define MS_DEF_RSA_SIG_PROV_A "Microsoft RSA Signature Cryptographic Provider"
682 #if defined(__GNUC__)
683 # define MS_DEF_RSA_SIG_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
684 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ', \
685 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
686 #elif defined(_MSC_VER)
687 # define MS_DEF_RSA_SIG_PROV_W L"Microsoft RSA Signature Cryptographic Provider"
689 static const WCHAR MS_DEF_RSA_SIG_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
690 'R','S','A',' ','S','i','g','n','a','t','u','r','e',' ',
691 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
693 #define MS_DEF_RSA_SIG_PROV WINELIB_NAME_AW(MS_DEF_RSA_SIG_PROV_)
695 #define MS_DEF_RSA_SCHANNEL_PROV_A "Microsoft RSA SChannel Cryptographic Provider"
696 #if defined(__GNUC__)
697 # define MS_DEF_RSA_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
698 'R','S','A',' ','S','C','h','a','n','n','e','l',' ', \
699 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
700 #elif defined(_MSC_VER)
701 # define MS_DEF_RSA_SCHANNEL_PROV_W L"Microsoft RSA SChannel Cryptographic Provider"
703 static const WCHAR MS_DEF_RSA_SCHANNEL_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
704 'R','S','A',' ','S','C','h','a','n','n','e','l',' ',
705 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
707 #define MS_DEF_RSA_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_RSA_SCHANNEL_PROV_)
709 #define MS_DEF_DSS_PROV_A "Microsoft Base DSS Cryptographic Provider"
710 #if defined(__GNUC__)
711 # define MS_DEF_DSS_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
712 'B','a','s','e',' ','D','S','S',' ', \
713 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
714 #elif defined(_MSC_VER)
715 # define MS_DEF_DSS_PROV_W L"Microsoft Base DSS Cryptographic Provider"
717 static const WCHAR MS_DEF_DSS_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
718 'B','a','s','e',' ','D','S','S',' ',
719 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
721 #define MS_DEF_DSS_PROV WINELIB_NAME_AW(MS_DEF_DSS_PROV_)
723 #define MS_DEF_DSS_DH_PROV_A "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
724 #if defined(__GNUC__)
725 # define MS_DEF_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
726 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ', \
727 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
728 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
729 #elif defined(_MSC_VER)
730 # define MS_DEF_DSS_DH_PROV_W L"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
732 static const WCHAR MS_DEF_DSS_DH_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
733 'B','a','s','e',' ','D','S','S',' ','a','n','d',' ',
734 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
735 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
737 #define MS_DEF_DSS_DH_PROV WINELIB_NAME_AW(MS_DEF_DSS_DH_PROV_)
739 #define MS_ENH_DSS_DH_PROV_A "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
740 #if defined(__GNUC__)
741 # define MS_ENH_DSS_DH_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
742 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ', \
743 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ', \
744 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
745 #elif defined(_MSC_VER)
746 # define MS_ENH_DSS_DH_PROV_W L"Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
748 static const WCHAR MS_ENH_DSS_DH_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
749 'E','n','h','a','n','c','e','d',' ','D','S','S',' ','a','n','d',' ',
750 'D','i','f','f','i','e','-','H','e','l','l','m','a','n',' ',
751 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
753 #define MS_ENH_DSS_DH_PROV WINELIB_NAME_AW(MS_ENH_DSS_DH_PROV_)
755 #define MS_DEF_DH_SCHANNEL_PROV_A "Microsoft DH SChannel Cryptographic Provider"
756 #if defined(__GNUC__)
757 # define MS_DEF_DH_SCHANNEL_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
758 'D','H',' ','S','C','h','a','n','n','e','l',' ', \
759 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
760 #elif defined(_MSC_VER)
761 # define MS_DEF_DH_SCHANNEL_PROV_W L"Microsoft DH SChannel Cryptographic Provider"
763 static const WCHAR MS_DEF_DH_SCHANNEL_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
764 'D','H',' ','S','C','h','a','n','n','e','l',' ',
765 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
767 #define MS_DEF_DH_SCHANNEL_PROV WINELIB_NAME_AW(MS_DEF_DH_SCHANNEL_PROV_)
769 #define MS_SCARD_PROV_A "Microsoft Base Smart Card Cryptographic Provider"
770 #if defined(__GNUC__)
771 # define MS_SCARD_PROV_W (const WCHAR []){ 'M','i','c','r','o','s','o','f','t',' ', \
772 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ', \
773 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 }
774 #elif defined(_MSC_VER)
775 # define MS_SCARD_PROV_W L"Microsoft Base Smart Card Cryptographic Provider"
777 static const WCHAR MS_SCARD_PROV_W
[] = { 'M','i','c','r','o','s','o','f','t',' ',
778 'B','a','s','e',' ','S','m','a','r','t',' ','C','a','r','d',' ',
779 'C','r','y','p','t','o','g','r','a','p','h','i','c',' ','P','r','o','v','i','d','e','r',0 };
781 #define MS_SCARD_PROV WINELIB_NAME_AW(MS_SCARD_PROV_)
784 #define AT_KEYEXCHANGE 1
785 #define AT_SIGNATURE 2
788 #define PROV_RSA_FULL 1
789 #define PROV_RSA_SIG 2
791 #define PROV_FORTEZZA 4
792 #define PROV_MS_EXCHANGE 5
794 #define PROV_RSA_SCHANNEL 12
795 #define PROV_DSS_DH 13
796 #define PROV_EC_ECDSA_SIG 14
797 #define PROV_EC_ECNRA_SIG 15
798 #define PROV_EC_ECDSA_FULL 16
799 #define PROV_EC_ECNRA_FULL 17
800 #define PROV_DH_SCHANNEL 18
801 #define PROV_SPYRUS_LYNKS 20
803 #define PROV_INTEL_SEC 22
804 #define PROV_REPLACE_OWF 23
805 #define PROV_RSA_AES 24
809 /* Provider Parameters */
810 #define PP_ENUMALGS 1
811 #define PP_ENUMCONTAINERS 2
815 #define PP_CONTAINER 6
817 #define CRYPT_FIRST 1
820 #define CRYPT_IMPL_HARDWARE 1
821 #define CRYPT_IMPL_SOFTWARE 2
822 #define CRYPT_IMPL_MIXED 3
823 #define CRYPT_IMPL_UNKNOWN 4
825 /* CryptAcquireContext */
826 #define CRYPT_VERIFYCONTEXT 0xF0000000
827 #define CRYPT_NEWKEYSET 0x00000008
828 #define CRYPT_DELETEKEYSET 0x00000010
829 #define CRYPT_MACHINE_KEYSET 0x00000020
830 #define CRYPT_SILENT 0x00000040
832 /* Crypt{Get|Set}Provider */
833 #define CRYPT_MACHINE_DEFAULT 0x00000001
834 #define CRYPT_USER_DEFAULT 0x00000002
835 #define CRYPT_DELETE_DEFAULT 0x00000004
837 /* Crypt{Get/Set}ProvParam */
838 #define PP_CLIENT_HWND 1
839 #define PP_ENUMALGS 1
840 #define PP_ENUMCONTAINERS 2
844 #define PP_CONTAINER 6
845 #define PP_CHANGE_PASSWORD 7
846 #define PP_KEYSET_SEC_DESCR 8
847 #define PP_KEY_TYPE_SUBTYPE 10
848 #define PP_CONTEXT_INFO 11
849 #define PP_KEYEXCHANGE_KEYSIZE 12
850 #define PP_SIGNATURE_KEYSIZE 13
851 #define PP_KEYEXCHANGE_ALG 14
852 #define PP_SIGNATURE_ALG 15
853 #define PP_PROVTYPE 16
854 #define PP_KEYSTORAGE 17
855 #define PP_SYM_KEYSIZE 19
856 #define PP_SESSION_KEYSIZE 20
857 #define PP_UI_PROMPT 21
858 #define PP_ENUMALGS_EX 22
859 #define PP_DELETEKEY 24
860 #define PP_ENUMMANDROOTS 25
861 #define PP_ENUMELECTROOTS 26
862 #define PP_KEYSET_TYPE 27
863 #define PP_ADMIN_PIN 31
864 #define PP_KEYEXCHANGE_PIN 32
865 #define PP_SIGNATURE_PIN 33
866 #define PP_SIG_KEYSIZE_INC 34
867 #define PP_KEYX_KEYSIZE_INC 35
868 #define PP_UNIQUE_CONTAINER 36
869 #define PP_SGC_INFO 37
870 #define PP_USE_HARDWARE_RNG 38
871 #define PP_KEYSPEC 39
872 #define PP_ENUMEX_SIGNING_PROT 40
874 /* Crypt{Get/Set}KeyParam */
879 #define KP_MODE_BITS 5
880 #define KP_PERMISSIONS 6
882 #define KP_BLOCKLEN 8
884 #define KP_SALT_EX 10
893 #define KP_EFFECTIVE_KEYLEN 19
894 #define KP_SCHANNEL_ALG 20
895 #define KP_CLIENT_RANDOM 21
896 #define KP_SERVER_RANDOM 22
898 #define KP_PRECOMP_MD5 24
899 #define KP_PRECOMP_SHA 25
900 #define KP_CERTIFICATE 26
901 #define KP_CLEAR_KEY 27
902 #define KP_PUB_EX_LEN 28
903 #define KP_PUB_EX_VAL 29
905 #define KP_ADMIN_PIN 31
906 #define KP_KEYEXCHANGE_PIN 32
907 #define KP_SIGNATURE_PIN 33
908 #define KP_PREHASH 34
910 /* CryptSignHash/CryptVerifySignature */
911 #define CRYPT_NOHASHOID 0x00000001
912 #define CRYPT_TYPE2_FORMAT 0x00000002
913 #define CRYPT_X931_FORMAT 0x00000004
915 /* Crypt{Get,Set}HashParam */
916 #define HP_ALGID 0x0001
917 #define HP_HASHVAL 0x0002
918 #define HP_HASHSIZE 0x0004
919 #define HP_HMAC_INFO 0x0005
920 #define HP_TLS1PRF_LABEL 0x0006
921 #define HP_TLS1PRF_SEED 0x0007
923 /* Crypt{Get,Set}KeyParam */
924 #define CRYPT_MODE_CBC 1
925 #define CRYPT_MODE_ECB 2
926 #define CRYPT_MODE_OFB 3
927 #define CRYPT_MODE_CFB 4
929 #define CRYPT_ENCRYPT 0x0001
930 #define CRYPT_DECRYPT 0x0002
931 #define CRYPT_EXPORT 0x0004
932 #define CRYPT_READ 0x0008
933 #define CRYPT_WRITE 0x0010
934 #define CRYPT_MAC 0x0020
937 #define CRYPT_EXPORTABLE 0x00000001
938 #define CRYPT_USER_PROTECTED 0x00000002
939 #define CRYPT_CREATE_SALT 0x00000004
940 #define CRYPT_UPDATE_KEY 0x00000008
941 #define CRYPT_NO_SALT 0x00000010
942 #define CRYPT_PREGEN 0x00000040
943 #define CRYPT_SERVER 0x00000400
944 #define CRYPT_ARCHIVABLE 0x00004000
947 #define CRYPT_SSL2_FALLBACK 0x00000002
948 #define CRYPT_DESTROYKEY 0x00000004
949 #define CRYPT_OAEP 0x00000040
951 /* CryptHashSessionKey */
952 #define CRYPT_LITTLE_ENDIAN 0x00000001
954 /* Crypt{Protect,Unprotect}Data PROMPTSTRUCT flags */
955 #define CRYPTPROTECT_PROMPT_ON_PROTECT 0x0001
956 #define CRYPTPROTECT_PROMPT_ON_UNPROTECT 0x0002
957 /* Crypt{Protect,Unprotect}Data flags */
958 #define CRYPTPROTECT_UI_FORBIDDEN 0x0001
959 #define CRYPTPROTECT_LOCAL_MACHINE 0x0004
960 #define CRYPTPROTECT_AUDIT 0x0010
961 #define CRYPTPROTECT_VERIFY_PROTECTION 0x0040
964 #define SIMPLEBLOB 0x1
965 #define PUBLICKEYBLOB 0x6
966 #define PRIVATEKEYBLOB 0x7
967 #define PLAINTEXTKEYBLOB 0x8
968 #define OPAQUEKEYBLOB 0x9
969 #define PUBLICKEYBLOBEX 0xA
970 #define SYMMETRICWRAPKEYBLOB 0xB
972 #define CUR_BLOB_VERSION 2
974 /* cert store provider types */
975 #define CERT_STORE_PROV_MSG ((LPCSTR)1)
976 #define CERT_STORE_PROV_MEMORY ((LPCSTR)2)
977 #define CERT_STORE_PROV_FILE ((LPCSTR)3)
978 #define CERT_STORE_PROV_REG ((LPCSTR)4)
979 #define CERT_STORE_PROV_PKCS7 ((LPCSTR)5)
980 #define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6)
981 #define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7)
982 #define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8)
983 #define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9)
984 #define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10)
985 #define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W
986 #define CERT_STORE_PROV_COLLECTION ((LPCSTR)11)
987 #define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12)
988 #define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13)
989 #define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W
990 #define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14)
991 #define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W
992 #define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15)
993 #define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W
994 #define CERT_STORE_PROV_LDAP_W ((LPCSTR)16)
995 #define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W
997 #define sz_CERT_STORE_PROV_MEMORY "Memory"
998 #define sz_CERT_STORE_PROV_FILENAME_W "File"
999 #define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W
1000 #define sz_CERT_STORE_PROV_SYSTEM_W "System"
1001 #define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W
1002 #define sz_CERT_STORE_PROV_PKCS7 "PKCS7"
1003 #define sz_CERT_STORE_PROV_SERIALIZED "Serialized"
1004 #define sz_CERT_STORE_PROV_COLLECTION "Collection"
1005 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry"
1006 #define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
1007 #define sz_CERT_STORE_PROV_PHYSICAL_W "Physical"
1008 #define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W
1009 #define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard"
1010 #define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W
1011 #define sz_CERT_STORE_PROV_LDAP_W "Ldap"
1012 #define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W
1014 /* types for CertOpenStore dwEncodingType */
1015 #define CERT_ENCODING_TYPE_MASK 0x0000ffff
1016 #define CMSG_ENCODING_TYPE_MASK 0xffff0000
1017 #define GET_CERT_ENCODING_TYPE(x) ((x) & CERT_ENCODING_TYPE_MASK)
1018 #define GET_CMSG_ENCODING_TYPE(x) ((x) & CMSG_ENCODING_TYPE_MASK)
1020 #define CRYPT_ASN_ENCODING 0x00000001
1021 #define CRYPT_NDR_ENCODING 0x00000002
1022 #define X509_ASN_ENCODING 0x00000001
1023 #define X509_NDR_ENCODING 0x00000002
1024 #define PKCS_7_ASN_ENCODING 0x00010000
1025 #define PKCS_7_NDR_ENCODING 0x00020000
1027 /* system store locations */
1028 #define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000
1029 #define CERT_SYSTEM_STORE_LOCATION_SHIFT 16
1031 /* system store location ids */
1033 #define CERT_SYSTEM_STORE_CURRENT_USER_ID 1
1035 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2
1036 /* hklm\Software\Microsoft\Cryptography\Services */
1037 #define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4
1038 #define CERT_SYSTEM_STORE_SERVICES_ID 5
1040 #define CERT_SYSTEM_STORE_USERS_ID 6
1041 /* hkcu\Software\Microsoft\Policies\Microsoft\SystemCertificates */
1042 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7
1043 /* hklm\Software\Microsoft\Policies\Microsoft\SystemCertificates */
1044 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8
1045 /* hklm\Software\Microsoft\EnterpriseCertificates */
1046 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9
1048 /* system store location values */
1049 #define CERT_SYSTEM_STORE_CURRENT_USER \
1050 (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1051 #define CERT_SYSTEM_STORE_LOCAL_MACHINE \
1052 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1053 #define CERT_SYSTEM_STORE_CURRENT_SERVICE \
1054 (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1055 #define CERT_SYSTEM_STORE_SERVICE \
1056 (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1057 #define CERT_SYSTEM_STORE_USERS \
1058 (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1059 #define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \
1060 (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1061 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \
1062 (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1063 #define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \
1064 (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
1066 /* flags for CertOpenStore dwFlags */
1067 #define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001
1068 #define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002
1069 #define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004
1070 #define CERT_STORE_DELETE_FLAG 0x00000010
1071 #define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020
1072 #define CERT_STORE_SHARE_STORE_FLAG 0x00000040
1073 #define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080
1074 #define CERT_STORE_MANIFOLD_FLAG 0x00000100
1075 #define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200
1076 #define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400
1077 #define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800
1078 #define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000
1079 #define CERT_STORE_CREATE_NEW_FLAG 0x00002000
1080 #define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000
1081 #define CERT_STORE_READONLY_FLAG 0x00008000
1083 /* physical store dwFlags, also used by CertAddStoreToCollection as
1086 #define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1
1087 #define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2
1088 #define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4
1089 #define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8
1091 /* dwFlag values for CertEnumPhysicalStore callback */
1092 #define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1
1094 /* predefined store names */
1095 #if defined(__GNUC__)
1096 # define CERT_PHYSICAL_STORE_DEFAULT_NAME (const WCHAR[])\
1097 {'.','D','e','f','a','u','l','t','0'}
1098 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME (const WCHAR[])\
1099 {'.','G','r','o','u','p','P','o','l','i','c','y',0}
1100 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME (const WCHAR[])\
1101 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0}
1102 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME (const WCHAR[])\
1103 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0}
1104 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME (const WCHAR[])\
1105 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',\
1106 'P','o','l','i','c','y',0}
1107 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME (const WCHAR[])\
1108 {'.','E','n','t','e','r','p','r','i','s','e',0}
1109 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME (const WCHAR[])\
1110 {'.','A','u','t','h','R','o','o','t',0}
1111 #elif defined(_MSC_VER)
1112 # define CERT_PHYSICAL_STORE_DEFAULT_NAME \
1114 # define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \
1116 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \
1118 # define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \
1120 # define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \
1121 L".LocalMachineGroupPolicy"
1122 # define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \
1124 # define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \
1127 static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME
[] =
1128 {'.','D','e','f','a','u','l','t','0'};
1129 static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME
[] =
1130 {'.','G','r','o','u','p','P','o','l','i','c','y',0};
1131 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME
[] =
1132 {'.','L','o','c','a','l','M','a','c','h','i','n','e',0};
1133 static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME
[] =
1134 {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0};
1135 static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME
[] =
1136 {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p',
1137 'P','o','l','i','c','y',0};
1138 static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME
[] =
1139 {'.','E','n','t','e','r','p','r','i','s','e',0};
1140 static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME
[] =
1141 {'.','A','u','t','h','R','o','o','t',0};
1144 /* cert system store flags */
1145 #define CERT_SYSTEM_STORE_MASK 0xffff0000
1146 #define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000
1148 /* CertFindChainInStore dwFindType types */
1149 #define CERT_CHAIN_FIND_BY_ISSUER 1
1151 /* CERT_RDN attribute dwValueType types */
1152 #define CERT_RDN_TYPE_MASK 0x000000ff
1153 #define CERT_RDN_ANY_TYPE 0
1154 #define CERT_RDN_ENCODED_BLOB 1
1155 #define CERT_RDN_OCTET_STRING 2
1156 #define CERT_RDN_NUMERIC_STRING 3
1157 #define CERT_RDN_PRINTABLE_STRING 4
1158 #define CERT_RDN_TELETEX_STRING 5
1159 #define CERT_RDN_T61_STRING 5
1160 #define CERT_RDN_VIDEOTEX_STRING 6
1161 #define CERT_RDN_IA5_STRING 7
1162 #define CERT_RDN_GRAPHIC_STRING 8
1163 #define CERT_RDN_VISIBLE_STRING 9
1164 #define CERT_RDN_ISO646_STRING 9
1165 #define CERT_RDN_GENERAL_STRING 10
1166 #define CERT_RDN_UNIVERSAL_STRING 11
1167 #define CERT_RDN_INT4_STRING 11
1168 #define CERT_RDN_BMP_STRING 12
1169 #define CERT_RDN_UNICODE_STRING 12
1170 #define CERT_RDN_UTF8_STRING 13
1172 /* CERT_RDN attribute dwValueType flags */
1173 #define CERT_RDN_FLAGS_MASK 0xff000000
1174 #define CERT_RDN_ENABLE_T61_UNICODE_FLAG 0x80000000
1175 #define CERT_RDN_DISABLE_CHECK_TYPE_FLAG 0x4000000
1176 #define CERT_RDN_ENABLE_UTF8_UNICODE_FLAG 0x2000000
1177 #define CERT_RDN_DISABLE_IE4_UTF8_FLAG 0x0100000
1179 #define IS_CERT_RDN_CHAR_STRING(x) \
1180 (((x) & CERT_RDN_TYPE_MASK) >= CERT_RDN_NUMERIC_STRING)
1182 /* CRL reason codes */
1183 #define CRL_REASON_UNSPECIFIED 0
1184 #define CRL_REASON_KEY_COMPROMISE 1
1185 #define CRL_REASON_CA_COMPROMISE 2
1186 #define CRL_REASON_AFFILIATION_CHANGED 3
1187 #define CRL_REASON_SUPERSEDED 4
1188 #define CRL_REASON_CESSATION_OF_OPERATION 5
1189 #define CRL_REASON_CERTIFICATE_HOLD 6
1190 #define CRL_REASON_REMOVE_FROM_CRL 8
1193 #define szOID_RSA "1.2.840.113549"
1194 #define szOID_PKCS "1.2.840.113549.1"
1195 #define szOID_RSA_HASH "1.2.840.113549.2"
1196 #define szOID_RSA_ENCRYPT "1.2.840.113549.3"
1197 #define szOID_PKCS_1 "1.2.840.113549.1.1"
1198 #define szOID_PKCS_2 "1.2.840.113549.1.2"
1199 #define szOID_PKCS_3 "1.2.840.113549.1.3"
1200 #define szOID_PKCS_4 "1.2.840.113549.1.4"
1201 #define szOID_PKCS_5 "1.2.840.113549.1.5"
1202 #define szOID_PKCS_6 "1.2.840.113549.1.6"
1203 #define szOID_PKCS_7 "1.2.840.113549.1.7"
1204 #define szOID_PKCS_8 "1.2.840.113549.1.8"
1205 #define szOID_PKCS_9 "1.2.840.113549.1.9"
1206 #define szOID_PKCS_10 "1.2.840.113549.1.10"
1207 #define szOID_PKCS_11 "1.2.840.113549.1.12"
1208 #define szOID_RSA_RSA "1.2.840.113549.1.1.1"
1209 #define CERT_RSA_PUBLIC_KEY_OBJID szOID_RSA_RSA
1210 #define CERT_DEFAULT_OID_PUBLIC_KEY_SIGN szOID_RSA_RSA
1211 #define CERT_DEFAULT_OID_PUBLIC_KEY_XCHG szOID_RSA_RSA
1212 #define szOID_RSA_MD2RSA "1.2.840.113549.1.1.2"
1213 #define szOID_RSA_MD4RSA "1.2.840.113549.1.1.3"
1214 #define szOID_RSA_MD5RSA "1.2.840.113549.1.1.4"
1215 #define szOID_RSA_SHA1RSA "1.2.840.113549.1.1.5"
1216 #define szOID_RSA_SET0AEP_RSA "1.2.840.113549.1.1.6"
1217 #define szOID_RSA_DH "1.2.840.113549.1.3.1"
1218 #define szOID_RSA_data "1.2.840.113549.1.7.1"
1219 #define szOID_RSA_signedData "1.2.840.113549.1.7.2"
1220 #define szOID_RSA_envelopedData "1.2.840.113549.1.7.3"
1221 #define szOID_RSA_signEnvData "1.2.840.113549.1.7.4"
1222 #define szOID_RSA_digestedData "1.2.840.113549.1.7.5"
1223 #define szOID_RSA_hashedData "1.2.840.113549.1.7.5"
1224 #define szOID_RSA_encryptedData "1.2.840.113549.1.7.6"
1225 #define szOID_RSA_emailAddr "1.2.840.113549.1.9.1"
1226 #define szOID_RSA_unstructName "1.2.840.113549.1.9.2"
1227 #define szOID_RSA_contentType "1.2.840.113549.1.9.3"
1228 #define szOID_RSA_messageDigest "1.2.840.113549.1.9.4"
1229 #define szOID_RSA_signingTime "1.2.840.113549.1.9.5"
1230 #define szOID_RSA_counterSign "1.2.840.113549.1.9.6"
1231 #define szOID_RSA_challengePwd "1.2.840.113549.1.9.7"
1232 #define szOID_RSA_unstructAddr "1.2.840.113549.1.9.9"
1233 #define szOID_RSA_extCertAttrs "1.2.840.113549.1.9.9"
1234 #define szOID_RSA_certExtensions "1.2.840.113549.1.9.14"
1235 #define szOID_RSA_SMIMECapabilities "1.2.840.113549.1.9.15"
1236 #define szOID_RSA_preferSignedData "1.2.840.113549.1.9.15.1"
1237 #define szOID_RSA_SMIMEalg "1.2.840.113549.1.9.16.3"
1238 #define szOID_RSA_SMIMEalgESDH "1.2.840.113549.1.9.16.3.5"
1239 #define szOID_RSA_SMIMEalgCMS3DESwrap "1.2.840.113549.1.9.16.3.6"
1240 #define szOID_RSA_SMIMEalgCMSRC2wrap "1.2.840.113549.1.9.16.3.7"
1241 #define szOID_RSA_MD2 "1.2.840.113549.2.2"
1242 #define szOID_RSA_MD4 "1.2.840.113549.2.4"
1243 #define szOID_RSA_MD5 "1.2.840.113549.2.5"
1244 #define szOID_RSA_RC2CBC "1.2.840.113549.3.2"
1245 #define szOID_RSA_RC4 "1.2.840.113549.3.4"
1246 #define szOID_RSA_DES_EDE3_CBC "1.2.840.113549.3.7"
1247 #define szOID_RSA_RC5_CBCPad "1.2.840.113549.3.9"
1248 #define szOID_ANSI_X942 "1.2.840.10046"
1249 #define szOID_ANSI_X942_DH "1.2.840.10046.2.1"
1250 #define szOID_X957 "1.2.840.10040"
1251 #define szOID_X957_DSA "1.2.840.10040.4.1"
1252 #define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
1253 #define szOID_DS "2.5"
1254 #define szOID_DSALG "2.5.8"
1255 #define szOID_DSALG_CRPT "2.5.8.1"
1256 #define szOID_DSALG_HASH "2.5.8.2"
1257 #define szOID_DSALG_SIGN "2.5.8.3"
1258 #define szOID_DSALG_RSA "2.5.8.1.1"
1259 #define szOID_OIW "1.3.14"
1260 #define szOID_OIWSEC "1.3.14.3.2"
1261 #define szOID_OIWSEC_md4RSA "1.3.14.3.2.2.2"
1262 #define szOID_OIWSEC_md5RSA "1.3.14.3.2.2.3"
1263 #define szOID_OIWSEC_md4RSA2 "1.3.14.3.2.2.4"
1264 #define szOID_OIWSEC_desECB "1.3.14.3.2.2.6"
1265 #define szOID_OIWSEC_desCBC "1.3.14.3.2.2.7"
1266 #define szOID_OIWSEC_desOFB "1.3.14.3.2.2.8"
1267 #define szOID_OIWSEC_desCFB "1.3.14.3.2.2.9"
1268 #define szOID_OIWSEC_desMAC "1.3.14.3.2.2.10"
1269 #define szOID_OIWSEC_rsaSign "1.3.14.3.2.2.11"
1270 #define szOID_OIWSEC_dsa "1.3.14.3.2.2.12"
1271 #define szOID_OIWSEC_shaDSA "1.3.14.3.2.2.13"
1272 #define szOID_OIWSEC_mdc2RSA "1.3.14.3.2.2.14"
1273 #define szOID_OIWSEC_shaRSA "1.3.14.3.2.2.15"
1274 #define szOID_OIWSEC_dhCommMod "1.3.14.3.2.2.16"
1275 #define szOID_OIWSEC_desEDE "1.3.14.3.2.2.17"
1276 #define szOID_OIWSEC_sha "1.3.14.3.2.2.18"
1277 #define szOID_OIWSEC_mdc2 "1.3.14.3.2.2.19"
1278 #define szOID_OIWSEC_dsaComm "1.3.14.3.2.2.20"
1279 #define szOID_OIWSEC_dsaCommSHA "1.3.14.3.2.2.21"
1280 #define szOID_OIWSEC_rsaXchg "1.3.14.3.2.2.22"
1281 #define szOID_OIWSEC_keyHashSeal "1.3.14.3.2.2.23"
1282 #define szOID_OIWSEC_md2RSASign "1.3.14.3.2.2.24"
1283 #define szOID_OIWSEC_md5RSASign "1.3.14.3.2.2.25"
1284 #define szOID_OIWSEC_sha1 "1.3.14.3.2.2.26"
1285 #define szOID_OIWSEC_dsaSHA1 "1.3.14.3.2.2.27"
1286 #define szOID_OIWSEC_dsaCommSHA1 "1.3.14.3.2.2.28"
1287 #define szOID_OIWSEC_sha1RSASign "1.3.14.3.2.2.29"
1288 #define szOID_OIWDIR "1.3.14.7.2"
1289 #define szOID_OIWDIR_CRPT "1.3.14.7.2.1"
1290 #define szOID_OIWDIR_HASH "1.3.14.7.2.2"
1291 #define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
1292 #define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
1293 #define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
1294 #define szOID_INFOSEC "2.16.840.1.101.2.1"
1295 #define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
1296 #define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
1297 #define szOID_INFOSEC_sdnsConfidentiality "2.16.840.1.101.2.1.1.3"
1298 #define szOID_INFOSEC_mosaicConfidentiality "2.16.840.1.101.2.1.1.4"
1299 #define szOID_INFOSEC_sdnsIntegrity "2.16.840.1.101.2.1.1.5"
1300 #define szOID_INFOSEC_mosaicIntegrity "2.16.840.1.101.2.1.1.6"
1301 #define szOID_INFOSEC_sdnsTokenProtection "2.16.840.1.101.2.1.1.7"
1302 #define szOID_INFOSEC_mosaicTokenProtection "2.16.840.1.101.2.1.1.8"
1303 #define szOID_INFOSEC_sdnsKeyManagement "2.16.840.1.101.2.1.1.9"
1304 #define szOID_INFOSEC_mosaicKeyManagement "2.16.840.1.101.2.1.1.10"
1305 #define szOID_INFOSEC_sdnsKMandSig "2.16.840.1.101.2.1.1.11"
1306 #define szOID_INFOSEC_mosaicKMandSig "2.16.840.1.101.2.1.1.12"
1307 #define szOID_INFOSEC_SuiteASignature "2.16.840.1.101.2.1.1.13"
1308 #define szOID_INFOSEC_SuiteAConfidentiality "2.16.840.1.101.2.1.1.14"
1309 #define szOID_INFOSEC_SuiteAIntegrity "2.16.840.1.101.2.1.1.15"
1310 #define szOID_INFOSEC_SuiteATokenProtection "2.16.840.1.101.2.1.1.16"
1311 #define szOID_INFOSEC_SuiteAKeyManagement "2.16.840.1.101.2.1.1.17"
1312 #define szOID_INFOSEC_SuiteAKMandSig "2.16.840.1.101.2.1.1.18"
1313 #define szOID_INFOSEC_mosaicUpdatedSig "2.16.840.1.101.2.1.1.19"
1314 #define szOID_INFOSEC_mosaicKMandUpdSig "2.16.840.1.101.2.1.1.20"
1315 #define szOID_INFOSEC_mosaicUpdateInteg "2.16.840.1.101.2.1.1.21"
1316 #define szOID_COMMON_NAME "2.5.4.3"
1317 #define szOID_SUR_NAME "2.5.4.4"
1318 #define szOID_DEVICE_SERIAL_NUMBER "2.5.4.5"
1319 #define szOID_COUNTRY_NAME "2.5.4.6"
1320 #define szOID_LOCALITY_NAME "2.5.4.7"
1321 #define szOID_STATE_OR_PROVINCE_NAME "2.5.4.8"
1322 #define szOID_STREET_ADDRESS "2.5.4.9"
1323 #define szOID_ORGANIZATION_NAME "2.5.4.10"
1324 #define szOID_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
1325 #define szOID_TITLE "2.5.4.12"
1326 #define szOID_DESCRIPTION "2.5.4.13"
1327 #define szOID_SEARCH_GUIDE "2.5.4.14"
1328 #define szOID_BUSINESS_CATEGORY "2.5.4.15"
1329 #define szOID_POSTAL_ADDRESS "2.5.4.16"
1330 #define szOID_POSTAL_CODE "2.5.4.17"
1331 #define szOID_POST_OFFICE_BOX "2.5.4.18"
1332 #define szOID_PHYSICAL_DELIVERY_OFFICE_NAME "2.5.4.19"
1333 #define szOID_TELEPHONE_NUMBER "2.5.4.20"
1334 #define szOID_TELEX_NUMBER "2.5.4.21"
1335 #define szOID_TELETEXT_TERMINAL_IDENTIFIER "2.5.4.22"
1336 #define szOID_FACSIMILE_TELEPHONE_NUMBER "2.5.4.23"
1337 #define szOID_X21_ADDRESS "2.5.4.24"
1338 #define szOID_INTERNATIONAL_ISDN_NUMBER "2.5.4.25"
1339 #define szOID_REGISTERED_ADDRESS "2.5.4.26"
1340 #define szOID_DESTINATION_INDICATOR "2.5.4.27"
1341 #define szOID_PREFERRED_DELIVERY_METHOD "2.5.4.28"
1342 #define szOID_PRESENTATION_ADDRESS "2.5.4.29"
1343 #define szOID_SUPPORTED_APPLICATION_CONTEXT "2.5.4.30"
1344 #define szOID_MEMBER "2.5.4.31"
1345 #define szOID_OWNER "2.5.4.32"
1346 #define szOID_ROLE_OCCUPANT "2.5.4.33"
1347 #define szOID_SEE_ALSO "2.5.4.34"
1348 #define szOID_USER_PASSWORD "2.5.4.35"
1349 #define szOID_USER_CERTIFICATE "2.5.4.36"
1350 #define szOID_CA_CERTIFICATE "2.5.4.37"
1351 #define szOID_AUTHORITY_REVOCATION_LIST "2.5.4.38"
1352 #define szOID_CERTIFICATE_REVOCATION_LIST "2.5.4.39"
1353 #define szOID_CROSS_CERTIFICATE_PAIR "2.5.4.40"
1354 #define szOID_GIVEN_NAME "2.5.4.42"
1355 #define szOID_INITIALS "2.5.4.43"
1356 #define szOID_DN_QUALIFIER "2.5.4.46"
1357 #define szOID_AUTHORITY_KEY_IDENTIFIER "2.5.29.1"
1358 #define szOID_KEY_ATTRIBUTES "2.5.29.2"
1359 #define szOID_CERT_POLICIES_95 "2.5.29.3"
1360 #define szOID_KEY_USAGE_RESTRICTION "2.5.29.4"
1361 #define szOID_LEGACY_POLICY_MAPPINGS "2.5.29.5"
1362 #define szOID_SUBJECT_ALT_NAME "2.5.29.7"
1363 #define szOID_ISSUER_ALT_NAME "2.5.29.8"
1364 #define szOID_SUBJECT_DIR_ATTRS "2.5.29.9"
1365 #define szOID_BASIC_CONSTRAINTS "2.5.29.10"
1366 #define szOID_SUBJECT_KEY_IDENTIFIER "2.5.29.14"
1367 #define szOID_KEY_USAGE "2.5.29.15"
1368 #define szOID_PRIVATEKEY_USAGE_PERIOD "2.5.29.16"
1369 #define szOID_SUBJECT_ALT_NAME2 "2.5.29.17"
1370 #define szOID_ISSUER_ALT_NAME2 "2.5.29.18"
1371 #define szOID_BASIC_CONSTRAINTS2 "2.5.29.19"
1372 #define szOID_CRL_NUMBER "2.5.29.20"
1373 #define szOID_CRL_REASON_CODE "2.5.29.21"
1374 #define szOID_REASON_CODE_HOLD "2.5.29.23"
1375 #define szOID_DELTA_CRL_INDICATOR "2.5.29.27"
1376 #define szOID_ISSUING_DIST_POINT "2.5.29.28"
1377 #define szOID_NAME_CONSTRAINTS "2.5.29.30"
1378 #define szOID_CRL_DIST_POINTS "2.5.29.31"
1379 #define szOID_CERT_POLICIES "2.5.29.32"
1380 #define szOID_ANY_CERT_POLICY "2.5.29.32.0"
1381 #define szOID_POLICY_MAPPINGS "2.5.29.33"
1382 #define szOID_AUTHORITY_KEY_IDENTIFIER2 "2.5.29.35"
1383 #define szOID_POLICY_CONSTRAINTS "2.5.29.36"
1384 #define szOID_ENHANCED_KEY_USAGE "2.5.29.37"
1385 #define szOID_FRESHEST_CRL "2.5.29.46"
1386 #define szOID_DOMAIN_COMPONENT "0.9.2342.19200300.100.1.25"
1387 #define szOID_PKCS_12_FRIENDLY_NAME_ATTR "1.2.840.113549.1.9.20"
1388 #define szOID_PKCS_12_LOCAL_KEY_ID "1.2.840.113549.1.9.21"
1389 #define szOID_RENEWAL_CERTIFICATE "1.3.6.1.4.1.311.13.1"
1390 #define szOID_ENROLLMENT_NAME_VALUE_PAIR "1.3.6.1.4.1.311.13.2.1"
1391 #define szOID_ENROLLMENT_CSP_PROVIDER "1.3.6.1.4.1.311.13.2.2"
1392 #define szOID_OS_VERSION "1.3.6.1.4.1.311.13.2.3"
1393 #define szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR "1.3.6.1.4.1.311.17.1"
1394 #define szOID_LOCAL_MACHINE_KEYSET "1.3.6.1.4.1.311.17.2"
1395 #define szOID_ENROLLMENT_AGENT "1.3.6.1.4.1.311.20.2.1"
1396 #define szOID_KEYID_RDN "1.3.6.1.4.1.311.10.7.1"
1397 #define szOID_PKIX "1.3.6.1.5.5.7"
1398 #define szOID_PKIX_PE "1.3.6.1.5.5.7.1"
1399 #define szOID_AUTHORITY_INFO_ACCESS "1.3.6.1.5.5.7.1.1"
1400 #define szOID_PKIX_POLICY_QUALIFIER_CPS "1.3.6.1.5.5.7.2.1"
1401 #define szOID_PKIX_POLICY_QUALIFIER_USERNOTICE "1.3.6.1.5.5.7.2.2"
1402 #define szOID_PKIX_KP "1.3.6.1.5.5.7.3"
1403 #define szOID_PKIX_KP_SERVER_AUTH "1.3.6.1.5.5.7.3.1"
1404 #define szOID_PKIX_KP_CLIENT_AUTH "1.3.6.1.5.5.7.3.2"
1405 #define szOID_PKIX_KP_CODE_SIGNING "1.3.6.1.5.5.7.3.3"
1406 #define szOID_PKIX_KP_EMAIL_PROTECTION "1.3.6.1.5.5.7.3.4"
1407 #define szOID_PKIX_KP_IPSEC_END_SYSTEM "1.3.6.1.5.5.7.3.5"
1408 #define szOID_PKIX_KP_IPSEC_TUNNEL "1.3.6.1.5.5.7.3.6"
1409 #define szOID_PKIX_KP_IPSEC_USER "1.3.6.1.5.5.7.3.7"
1410 #define szOID_PKIX_KP_TIMESTAMP_SIGNING "1.3.6.1.5.5.7.3.8"
1411 #define szOID_IPSEC_KP_IKE_INTERMEDIATE "1.3.6.1.5.5.8.2.2"
1412 #define CRYPT_ENCODE_DECODE_NONE 0
1413 #define X509_CERT ((LPCSTR)1)
1414 #define X509_CERT_TO_BE_SIGNED ((LPCSTR)2)
1415 #define X509_CERT_CRL_TO_BE_SIGNED ((LPCSTR)3)
1416 #define X509_CERT_REQUEST_TO_BE_SIGNED ((LPCSTR)4)
1417 #define X509_EXTENSIONS ((LPCSTR)5)
1418 #define X509_NAME_VALUE ((LPCSTR)6)
1419 #define X509_ANY_STRING X509_NAME_VALUE
1420 #define X509_NAME ((LPCSTR)7)
1421 #define X509_PUBLIC_KEY_INFO ((LPCSTR)8)
1422 #define X509_AUTHORITY_KEY_ID ((LPCSTR)9)
1423 #define X509_KEY_ATTRIBUTES ((LPCSTR)10)
1424 #define X509_KEY_USAGE_RESTRICTION ((LPCSTR)11)
1425 #define X509_ALTERNATE_NAME ((LPCSTR)12)
1426 #define X509_BASIC_CONSTRAINTS ((LPCSTR)13)
1427 #define X509_KEY_USAGE ((LPCSTR)14)
1428 #define X509_BASIC_CONSTRAINTS2 ((LPCSTR)15)
1429 #define X509_CERT_POLICIES ((LPCSTR)16)
1430 #define PKCS_UTC_TIME ((LPCSTR)17)
1431 #define PKCS_TIME_REQUEST ((LPCSTR)18)
1432 #define RSA_CSP_PUBLICKEYBLOB ((LPCSTR)19)
1433 #define X509_UNICODE_NAME ((LPCSTR)20)
1434 #define X509_KEYGEN_REQUEST_TO_BE_SIGNED ((LPCSTR)21)
1435 #define PKCS_ATTRIBUTE ((LPCSTR)22)
1436 #define PKCS_CONTENT_INFO_SEQUENCE_OF_ANY ((LPCSTR)23)
1437 #define X509_UNICODE_NAME_VALUE ((LPCSTR)24)
1438 #define X509_UNICODE_ANY_STRING X509_UNICODE_NAME_VALUE
1439 #define X509_OCTET_STRING ((LPCSTR)25)
1440 #define X509_BITS ((LPCSTR)26)
1441 #define X509_INTEGER ((LPCSTR)27)
1442 #define X509_MULTI_BYTE_INTEGER ((LPCSTR)28)
1443 #define X509_ENUMERATED ((LPCSTR)29)
1444 #define X509_CRL_REASON_CODE X509_ENUMERATED
1445 #define X509_CHOICE_OF_TIME ((LPCSTR)30)
1446 #define X509_AUTHORITY_KEY_ID2 ((LPCSTR)31)
1447 #define X509_AUTHORITY_INFO_ACCESS ((LPCSTR)32)
1448 #define PKCS_CONTENT_INFO ((LPCSTR)33)
1449 #define X509_SEQUENCE_OF_ANY ((LPCSTR)34)
1450 #define X509_CRL_DIST_POINTS ((LPCSTR)35)
1451 #define X509_ENHANCED_KEY_USAGE ((LPCSTR)36)
1452 #define PKCS_CTL ((LPCSTR)37)
1453 #define X509_MULTI_BYTE_UINT ((LPCSTR)38)
1454 #define X509_DSS_PUBLICKEY X509_MULTI_BYTE_UINT
1455 #define X509_DSS_PARAMETERS ((LPCSTR)39)
1456 #define X509_DSS_SIGNATURE ((LPCSTR)40)
1457 #define PKCS_RC2_CBC_PARAMETERS ((LPCSTR)41)
1458 #define PKCS_SMIME_CAPABILITIES ((LPCSTR)42)
1459 #define PKCS_RSA_PRIVATE_KEY ((LPCSTR)43)
1460 #define PKCS_PRIVATE_KEY_INFO ((LPCSTR)44)
1461 #define PKCS_ENCRYPTED_PRIVATE_KEY_INFO ((LPCSTR)45)
1462 #define X509_PKIX_POLICY_QUALIFIER_USERNOTICE ((LPCSTR)46)
1463 #define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
1464 #define X509_DH_PARAMETERS ((LPCSTR)47)
1465 #define PKCS_ATTRIBUTES ((LPCSTR)48)
1466 #define PKCS_SORTED_CTL ((LPCSTR)49)
1467 #define X942_DH_PARAMETERS ((LPCSTR)50)
1468 #define X509_BITS_WITHOUT_TRAILING_ZEROES ((LPCSTR)51)
1469 #define X942_OTHER_INFO ((LPCSTR)52)
1470 #define X509_CERT_PAIR ((LPCSTR)53)
1471 #define X509_ISSUING_DIST_POINT ((LPCSTR)54)
1472 #define X509_NAME_CONSTRAINTS ((LPCSTR)55)
1473 #define X509_POLICY_MAPPINGS ((LPCSTR)56)
1474 #define X509_POLICY_CONSTRAINTS ((LPCSTR)57)
1475 #define X509_CROSS_CERT_DIST_POINTS ((LPCSTR)58)
1476 #define CMC_DATA ((LPCSTR)59)
1477 #define CMC_RESPONSE ((LPCSTR)60)
1478 #define CMC_STATUS ((LPCSTR)61)
1479 #define CMC_ADD_EXTENSIONS ((LPCSTR)62)
1480 #define CMC_ADD_ATTRIBUTES ((LPCSTR)63)
1481 #define X509_CERTIFICATE_TEMPLATE ((LPCSTR)64)
1482 #define PKCS7_SIGNER_INFO ((LPCSTR)500)
1483 #define CMS_SIGNER_INFO ((LPCSTR)501)
1485 /* encode/decode flags */
1486 #define CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
1487 #define CRYPT_ENCODE_ALLOC_FLAG 0x08000
1488 #define CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG 0x10000
1489 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG \
1490 CERT_RDN_ENABLE_T61_UNICODE_FLAG
1491 #define CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG \
1492 CERT_RDN_ENABLE_UTF8_UNICODE_FLAG
1493 #define CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG \
1494 CERT_RDN_DISABLE_CHECK_TYPE_FLAG
1496 #define CRYPT_DECODE_NOCOPY_FLAG 0x00001
1497 #define CRYPT_DECODE_TO_BE_SIGNED_FLAG 0x00002
1498 #define CRYPT_DECODE_SHARE_OID_STRING_FLAG 0x00004
1499 #define CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG 0x00008
1500 #define CRYPT_DECODE_ALLOC_FLAG 0x08000
1501 #define CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG \
1502 CERT_RDN_DISABLE_IE4_UTF8_FLAG
1504 /* function declarations */
1506 BOOL WINAPI
CryptAcquireContextA(HCRYPTPROV
*phProv
, LPCSTR pszContainer
,
1507 LPCSTR pszProvider
, DWORD dwProvType
,
1509 BOOL WINAPI
CryptAcquireContextW (HCRYPTPROV
*phProv
, LPCWSTR pszContainer
,
1510 LPCWSTR pszProvider
, DWORD dwProvType
, DWORD dwFlags
);
1511 #define CryptAcquireContext WINELIB_NAME_AW(CryptAcquireContext)
1512 BOOL WINAPI
CryptGenRandom (HCRYPTPROV hProv
, DWORD dwLen
, BYTE
*pbBuffer
);
1513 BOOL WINAPI
CryptContextAddRef (HCRYPTPROV hProv
, DWORD
*pdwReserved
, DWORD dwFlags
);
1514 BOOL WINAPI
CryptCreateHash (HCRYPTPROV hProv
, ALG_ID Algid
, HCRYPTKEY hKey
,
1515 DWORD dwFlags
, HCRYPTHASH
*phHash
);
1516 BOOL WINAPI
CryptDecrypt (HCRYPTKEY hKey
, HCRYPTHASH hHash
, BOOL Final
,
1517 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
);
1518 BOOL WINAPI
CryptDeriveKey (HCRYPTPROV hProv
, ALG_ID Algid
, HCRYPTHASH hBaseData
,
1519 DWORD dwFlags
, HCRYPTKEY
*phKey
);
1520 BOOL WINAPI
CryptDestroyHash (HCRYPTHASH hHash
);
1521 BOOL WINAPI
CryptDestroyKey (HCRYPTKEY hKey
);
1522 BOOL WINAPI
CryptDuplicateKey (HCRYPTKEY hKey
, DWORD
*pdwReserved
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
1523 BOOL WINAPI
CryptDuplicateHash (HCRYPTHASH hHash
, DWORD
*pdwReserved
,
1524 DWORD dwFlags
, HCRYPTHASH
*phHash
);
1525 BOOL WINAPI
CryptEncrypt (HCRYPTKEY hKey
, HCRYPTHASH hHash
, BOOL Final
,
1526 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
, DWORD dwBufLen
);
1527 BOOL WINAPI
CryptEnumProvidersA (DWORD dwIndex
, DWORD
*pdwReserved
,
1528 DWORD dwFlags
, DWORD
*pdwProvType
, LPSTR pszProvName
, DWORD
*pcbProvName
);
1529 BOOL WINAPI
CryptEnumProvidersW (DWORD dwIndex
, DWORD
*pdwReserved
,
1530 DWORD dwFlags
, DWORD
*pdwProvType
, LPWSTR pszProvName
, DWORD
*pcbProvName
);
1531 #define CryptEnumProviders WINELIB_NAME_AW(CryptEnumProviders)
1532 BOOL WINAPI
CryptEnumProviderTypesA (DWORD dwIndex
, DWORD
*pdwReserved
,
1533 DWORD dwFlags
, DWORD
*pdwProvType
, LPSTR pszTypeName
, DWORD
*pcbTypeName
);
1534 BOOL WINAPI
CryptEnumProviderTypesW (DWORD dwIndex
, DWORD
*pdwReserved
,
1535 DWORD dwFlags
, DWORD
*pdwProvType
, LPWSTR pszTypeName
, DWORD
*pcbTypeName
);
1536 #define CryptEnumProviderTypes WINELIB_NAME_AW(CryptEnumProviderTypes)
1537 BOOL WINAPI
CryptExportKey (HCRYPTKEY hKey
, HCRYPTKEY hExpKey
, DWORD dwBlobType
,
1538 DWORD dwFlags
, BYTE
*pbData
, DWORD
*pdwDataLen
);
1539 BOOL WINAPI
CryptGenKey (HCRYPTPROV hProv
, ALG_ID Algid
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
1540 BOOL WINAPI
CryptGetKeyParam (HCRYPTKEY hKey
, DWORD dwParam
, BYTE
*pbData
,
1541 DWORD
*pdwDataLen
, DWORD dwFlags
);
1542 BOOL WINAPI
CryptGetHashParam (HCRYPTHASH hHash
, DWORD dwParam
, BYTE
*pbData
,
1543 DWORD
*pdwDataLen
, DWORD dwFlags
);
1544 BOOL WINAPI
CryptGetOIDFunctionValue(DWORD dwEncodingType
, LPCSTR pszFuncName
,
1545 LPCSTR pszOID
, LPCWSTR szValueName
, DWORD
*pdwValueType
,
1546 BYTE
*pbValueData
, DWORD
*pcbValueData
);
1547 BOOL WINAPI
CryptGetProvParam (HCRYPTPROV hProv
, DWORD dwParam
, BYTE
*pbData
,
1548 DWORD
*pdwDataLen
, DWORD dwFlags
);
1549 BOOL WINAPI
CryptGetDefaultProviderA (DWORD dwProvType
, DWORD
*pdwReserved
,
1550 DWORD dwFlags
, LPSTR pszProvName
, DWORD
*pcbProvName
);
1551 BOOL WINAPI
CryptGetDefaultProviderW (DWORD dwProvType
, DWORD
*pdwReserved
,
1552 DWORD dwFlags
, LPWSTR pszProvName
, DWORD
*pcbProvName
);
1553 #define CryptGetDefaultProvider WINELIB_NAME_AW(CryptGetDefaultProvider)
1554 BOOL WINAPI
CryptGetUserKey (HCRYPTPROV hProv
, DWORD dwKeySpec
, HCRYPTKEY
*phUserKey
);
1555 BOOL WINAPI
CryptHashData (HCRYPTHASH hHash
, BYTE
*pbData
, DWORD dwDataLen
, DWORD dwFlags
);
1556 BOOL WINAPI
CryptHashSessionKey (HCRYPTHASH hHash
, HCRYPTKEY hKey
, DWORD dwFlags
);
1557 BOOL WINAPI
CryptImportKey (HCRYPTPROV hProv
, BYTE
*pbData
, DWORD dwDataLen
,
1558 HCRYPTKEY hPubKey
, DWORD dwFlags
, HCRYPTKEY
*phKey
);
1559 BOOL WINAPI
CryptRegisterOIDFunction(DWORD
,LPCSTR
,LPCSTR
,LPCWSTR
,LPCSTR
);
1560 BOOL WINAPI
CryptReleaseContext (HCRYPTPROV hProv
, DWORD dwFlags
);
1561 BOOL WINAPI
CryptSetHashParam (HCRYPTHASH hHash
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
1562 BOOL WINAPI
CryptSetKeyParam (HCRYPTKEY hKey
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
1563 BOOL WINAPI
CryptSetOIDFunctionValue(DWORD dwEncodingType
, LPCSTR pszFuncName
,
1564 LPCSTR pszOID
, LPCWSTR pwszValueName
, DWORD dwValueType
,
1565 const BYTE
*pbValueData
, DWORD cbValueData
);
1566 BOOL WINAPI
CryptSetProviderA (LPCSTR pszProvName
, DWORD dwProvType
);
1567 BOOL WINAPI
CryptSetProviderW (LPCWSTR pszProvName
, DWORD dwProvType
);
1568 #define CryptSetProvider WINELIB_NAME_AW(CryptSetProvider)
1569 BOOL WINAPI
CryptSetProviderExA (LPCSTR pszProvName
, DWORD dwProvType
, DWORD
*pdwReserved
, DWORD dwFlags
);
1570 BOOL WINAPI
CryptSetProviderExW (LPCWSTR pszProvName
, DWORD dwProvType
, DWORD
*pdwReserved
, DWORD dwFlags
);
1571 #define CryptSetProviderEx WINELIB_NAME_AW(CryptSetProviderEx)
1572 BOOL WINAPI
CryptSetProvParam (HCRYPTPROV hProv
, DWORD dwParam
, BYTE
*pbData
, DWORD dwFlags
);
1573 BOOL WINAPI
CryptSignHashA (HCRYPTHASH hHash
, DWORD dwKeySpec
, LPCSTR sDescription
,
1574 DWORD dwFlags
, BYTE
*pbSignature
, DWORD
*pdwSigLen
);
1575 BOOL WINAPI
CryptSignHashW (HCRYPTHASH hHash
, DWORD dwKeySpec
, LPCWSTR sDescription
,
1576 DWORD dwFlags
, BYTE
*pbSignature
, DWORD
*pdwSigLen
);
1577 #define CryptSignHash WINELIB_NAME_AW(CryptSignHash)
1578 BOOL WINAPI
CryptUnregisterOIDFunction(DWORD
,LPCSTR
,LPCSTR
);
1579 BOOL WINAPI
CryptVerifySignatureA (HCRYPTHASH hHash
, BYTE
*pbSignature
, DWORD dwSigLen
,
1580 HCRYPTKEY hPubKey
, LPCSTR sDescription
, DWORD dwFlags
);
1581 BOOL WINAPI
CryptVerifySignatureW (HCRYPTHASH hHash
, BYTE
*pbSignature
, DWORD dwSigLen
,
1582 HCRYPTKEY hPubKey
, LPCWSTR sDescription
, DWORD dwFlags
);
1583 #define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
1585 LPCSTR WINAPI
CertAlgIdToOID(DWORD dwAlgId
);
1586 DWORD WINAPI
CertOIDToAlgId(LPCSTR pszObjId
);
1588 /* cert store functions */
1589 HCERTSTORE WINAPI
CertOpenStore(LPCSTR lpszStoreProvider
, DWORD dwEncodingType
,
1590 HCRYPTPROV hCryptProv
, DWORD dwFlags
, const void *pvPara
);
1592 HCERTSTORE WINAPI
CertOpenSystemStoreA(HCRYPTPROV hProv
,
1593 LPCSTR szSubSystemProtocol
);
1594 HCERTSTORE WINAPI
CertOpenSystemStoreW(HCRYPTPROV hProv
,
1595 LPCWSTR szSubSystemProtocol
);
1596 #define CertOpenSystemStore WINELIB_NAME_AW(CertOpenSystemStore)
1598 PCCERT_CONTEXT WINAPI
CertEnumCertificatesInStore(HCERTSTORE hCertStore
, PCCERT_CONTEXT pPrev
);
1600 BOOL WINAPI
CertEnumSystemStoreLocation(DWORD dwFlags
, void *pvArg
,
1601 PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum
);
1603 BOOL WINAPI
CertEnumSystemStore(DWORD dwFlags
, void *pvSystemStoreLocationPara
,
1604 void *pvArg
, PFN_CERT_ENUM_SYSTEM_STORE pfnEnum
);
1606 BOOL WINAPI
CertEnumPhysicalStore(const void *pvSystemStore
, DWORD dwFlags
,
1607 void *pvArg
, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum
);
1609 BOOL WINAPI
CertSaveStore(HCERTSTORE hCertStore
, DWORD dwMsgAndCertEncodingType
,
1610 DWORD dwSaveAs
, DWORD dwSaveTo
, void* pvSaveToPara
, DWORD dwFlags
);
1612 PCCRL_CONTEXT WINAPI
CertCreateCRLContext( DWORD dwCertEncodingType
,
1613 const BYTE
* pbCrlEncoded
, DWORD cbCrlEncoded
);
1615 BOOL WINAPI
CertAddStoreToCollection(HCERTSTORE hCollectionStore
,
1616 HCERTSTORE hSiblingStore
, DWORD dwUpdateFlags
, DWORD dwPriority
);
1618 void WINAPI
CertRemoveStoreFromCollection(HCERTSTORE hCollectionStore
,
1619 HCERTSTORE hSiblingStore
);
1621 PCCERT_CHAIN_CONTEXT WINAPI
CertFindChainInStore(HCERTSTORE hCertStore
,
1622 DWORD dwCertEncodingType
, DWORD dwFindFlags
, DWORD dwFindType
,
1623 const void *pvFindPara
, PCCERT_CHAIN_CONTEXT pPrevChainContext
);
1625 BOOL WINAPI
CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID
,
1626 PCCERT_CHAIN_CONTEXT pChainContext
, PCERT_CHAIN_POLICY_PARA pPolicyPara
,
1627 PCERT_CHAIN_POLICY_STATUS pPolicyStatus
);
1629 BOOL WINAPI
CertCloseStore( HCERTSTORE hCertStore
, DWORD dwFlags
);
1631 BOOL WINAPI
CertFreeCertificateContext( PCCERT_CONTEXT pCertContext
);
1633 BOOL WINAPI
CertFreeCRLContext( PCCRL_CONTEXT pCrlContext
);
1635 BOOL WINAPI
CertAddCRLContextToStore( HCERTSTORE hCertStore
,
1636 PCCRL_CONTEXT pCrlContext
, DWORD dwAddDisposition
,
1637 PCCRL_CONTEXT
*ppStoreContext
);
1639 PCCERT_CONTEXT WINAPI
CertFindCertificateInStore( HCERTSTORE hCertStore
,
1640 DWORD dwCertEncodingType
, DWORD dwFindFlags
, DWORD dwFindType
,
1641 const void *pvFindPara
, PCCERT_CONTEXT pPrevCertContext
);
1643 BOOL WINAPI
CryptEncodeObject(DWORD dwCertEncodingType
, LPCSTR lpszStructType
,
1644 const void *pvStructInfo
, BYTE
*pbEncoded
, DWORD
*pcbEncoded
);
1645 BOOL WINAPI
CryptEncodeObjectEx(DWORD dwCertEncodingType
, LPCSTR lpszStructType
,
1646 const void *pvStructInfo
, DWORD dwFlags
, PCRYPT_ENCODE_PARA pEncodePara
,
1647 void *pvEncoded
, DWORD
*pcbEncoded
);
1649 BOOL WINAPI
CryptDecodeObject(DWORD dwCertEncodingType
, LPCSTR lpszStructType
,
1650 const BYTE
*pbEncoded
, DWORD cbEncoded
, DWORD dwFlags
, void *pvStructInfo
,
1651 DWORD
*pcbStructInfo
);
1652 BOOL WINAPI
CryptDecodeObjectEx(DWORD dwCertEncodingType
, LPCSTR lpszStructType
,
1653 const BYTE
*pbEncoded
, DWORD cbEncoded
, DWORD dwFlags
,
1654 PCRYPT_DECODE_PARA pDecodePara
, void *pvStructInfo
, DWORD
*pcbStructInfo
);
1656 /* crypt32.dll functions */
1657 BOOL WINAPI
CryptProtectData( DATA_BLOB
* pDataIn
, LPCWSTR szDataDescr
,
1658 DATA_BLOB
* pOptionalEntropy
, PVOID pvReserved
,
1659 CRYPTPROTECT_PROMPTSTRUCT
* pPromptStruct
, DWORD dwFlags
, DATA_BLOB
* pDataOut
);
1661 BOOL WINAPI
CryptUnprotectData( DATA_BLOB
* pDataIn
, LPWSTR
* ppszDataDescr
,
1662 DATA_BLOB
* pOptionalEntropy
, PVOID pvReserved
,
1663 CRYPTPROTECT_PROMPTSTRUCT
* pPromptStruct
, DWORD dwFlags
, DATA_BLOB
* pDataOut
);