2 * Copyright (C) 2008 Juan Lang
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 #ifndef __CRYPTUIAPI_H__
19 #define __CRYPTUIAPI_H__
31 BOOL WINAPI
CryptUIDlgViewContext(DWORD dwContextType
, LPVOID pvContext
,
32 HWND hwnd
, LPCWSTR pwszTitle
, DWORD dwFlags
, LPVOID pvReserved
);
34 /* Values for dwDontUseColumn */
35 #define CRYPTUI_SELECT_ISSUEDTO_COLUMN 0x00000001
36 #define CRYPTUI_SELECT_ISSUEDBY_COLUMN 0x00000002
37 #define CRYPTUI_SELECT_INTENDEDUSE_COLUMN 0x00000004
38 #define CRYPTUI_SELECT_FRIENDLYNAME_COLUMN 0x00000008
39 #define CRYPTUI_SELECT_LOCATION_COLUMN 0x00000010
40 #define CRYPTUI_SELECT_EXPIRATION_COLUMN 0x00000020
42 PCCERT_CONTEXT WINAPI
CryptUIDlgSelectCertificateFromStore(
43 HCERTSTORE hCertStore
, HWND hwnd
, LPCWSTR pwszTitle
, LPCWSTR pwszDisplayString
,
44 DWORD dwDontUseColumn
, DWORD dwFlags
, LPVOID pvReserved
);
46 /* Values for CRYPTUI_CERT_MGR_STRUCT's dwFlags */
47 #define CRYPTUI_CERT_MGR_PUBLISHER_TAB 0x00000004
48 #define CRYPTUI_CERT_MGR_TAB_MASK 0x0000000f
49 #define CRYPTUI_CERT_MGR_SINGLE_TAB_FLAG 0x00008000
51 typedef struct _CRYPTUI_CERT_MGR_STRUCT
57 LPCSTR pszInitUsageOID
;
58 } CRYPTUI_CERT_MGR_STRUCT
, *PCRYPTUI_CERT_MGR_STRUCT
;
59 typedef const struct _CRYPTUI_CERT_MGR_STRUCT
*PCCRYPTUI_CERT_MGR_STRUCT
;
61 BOOL WINAPI
CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr
);
63 typedef BOOL (WINAPI
*PFNCFILTERPROC
)(PCCERT_CONTEXT pCertContext
,
64 BOOL
*pfInitialSelectedCert
, void *pvCallbackData
);
66 typedef struct tagCRYPTUI_INITDIALOG_STRUCT
69 PCCERT_CONTEXT pCertContext
;
70 } CRYPTUI_INITDIALOG_STRUCT
, *PCRYPTUI_INITDIALOG_STRUCT
;
72 /* Values for CRYPTUI_VIEWCERTIFICATE_STRUCT's dwFlags */
73 #define CRYPTUI_HIDE_HIERARCHYPAGE 0x00000001
74 #define CRYPTUI_HIDE_DETAILPAGE 0x00000002
75 #define CRYPTUI_DISABLE_EDITPROPERTIES 0x00000004
76 #define CRYPTUI_ENABLE_EDITPROPERTIES 0x00000008
77 #define CRYPTUI_DISABLE_ADDTOSTORE 0x00000010
78 #define CRYPTUI_ENABLE_ADDTOSTORE 0x00000020
79 #define CRYPTUI_ACCEPT_DECLINE_STYLE 0x00000040
80 #define CRYPTUI_IGNORE_UNTRUSTED_ROOT 0x00000080
81 #define CRYPTUI_DONT_OPEN_STORES 0x00000100
82 #define CRYPTUI_ONLY_OPEN_ROOT_STORE 0x00000200
83 #define CRYPTUI_WARN_UNTRUSTED_ROOT 0x00000400
84 #define CRYPTUI_ENABLE_REVOCATION_CHECKING 0x00000800
85 #define CRYPTUI_WARN_REMOTE_TRUST 0x00001000
86 #define CRYPTUI_DISABLE_EXPORT 0x00002000
87 #define CRYPTUI_ENABLE_REVOCATION_CHECK_END_CERT 0x00004000
88 #define CRYPTUI_ENABLE_REVOCATION_CHECK_CHAIN 0x00008000
89 #define CRYPTUI_ENABLE_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT CRYPTUI_ENABLE_REVOCATION_CHECKING
90 #define CRYPTUI_DISABLE_HTMLLINK 0x00010000
92 typedef struct tagCRYPTUI_VIEWCERTIFICATE_STRUCTA
98 PCCERT_CONTEXT pCertContext
;
102 CRYPT_PROVIDER_DATA
const *pCryptProviderData
;
103 HANDLE hWVTStateData
;
105 BOOL fpCryptProviderDataTrustedUsage
;
109 DWORD idxCounterSigner
;
111 HCERTSTORE
*rghStores
;
112 DWORD cPropSheetPages
;
113 LPCPROPSHEETPAGEA rgPropSheetPages
;
115 } CRYPTUI_VIEWCERTIFICATE_STRUCTA
, *PCRYPTUI_VIEWCERTIFICATE_STRUCTA
;
116 typedef const CRYPTUI_VIEWCERTIFICATE_STRUCTA
*PCCRYPTUI_VIEWCERTIFICATE_STRUCTA
;
118 typedef struct tagCRYPTUI_VIEWCERTIFICATE_STRUCTW
124 PCCERT_CONTEXT pCertContext
;
125 LPCSTR
*rgszPurposes
;
128 CRYPT_PROVIDER_DATA
const *pCryptProviderData
;
129 HANDLE hWVTStateData
;
131 BOOL fpCryptProviderDataTrustedUsage
;
135 DWORD idxCounterSigner
;
137 HCERTSTORE
*rghStores
;
138 DWORD cPropSheetPages
;
139 LPCPROPSHEETPAGEW rgPropSheetPages
;
141 } CRYPTUI_VIEWCERTIFICATE_STRUCTW
, *PCRYPTUI_VIEWCERTIFICATE_STRUCTW
;
142 typedef const CRYPTUI_VIEWCERTIFICATE_STRUCTW
*PCCRYPTUI_VIEWCERTIFICATE_STRUCTW
;
144 #define CRYPTUI_VIEWCERTIFICATE_STRUCT WINELIB_NAME_AW(CRYPTUI_VIEWCERTIFICATE_STRUCT)
145 #define PCCRYPTUI_VIEWCERTIFICATE_STRUCT WINELIB_NAME_AW(PCCRYPTUI_VIEWCERTIFICATE_STRUCT)
147 BOOL WINAPI
CryptUIDlgViewCertificateA(
148 PCCRYPTUI_VIEWCERTIFICATE_STRUCTA pCertViewInfo
, BOOL
*pfPropertiesChanged
);
149 BOOL WINAPI
CryptUIDlgViewCertificateW(
150 PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertViewInfo
, BOOL
*pfPropertiesChanged
);
151 #define CryptUIDlgViewCertificate WINELIB_NAME_AW(CryptUIDlgViewCertificate)
153 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO
159 LPCWSTR pwszDisplayName
;
160 } CRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO
, *PCRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO
;
161 typedef const CRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO
*
162 PCCRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO
;
164 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_STORE_INFO
168 HCERTSTORE
*rghCertStore
;
169 PFNCFILTERPROC pFilterCallback
;
170 void *pvCallbackData
;
171 } CRYPTUI_WIZ_DIGITAL_SIGN_STORE_INFO
, *PCRYPTUI_WIZ_DIGITAL_SIGN_STORE_INFO
;
172 typedef const CRYPTUI_WIZ_DIGITAL_SIGN_STORE_INFO
*
173 PCCRYPTUI_WIZ_DIGITAL_SIGN_STORE_INFO
;
175 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO
178 LPWSTR pwszPvkFileName
;
181 } CRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO
,
182 *PCRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO
;
183 typedef const CRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO
*
184 PCCRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO
;
186 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO
189 LPWSTR pwszSigningCertFileName
;
192 PCCRYPTUI_WIZ_DIGITAL_SIGN_PVK_FILE_INFO pPvkFileInfo
;
193 PCRYPT_KEY_PROV_INFO pPvkProvInfo
;
195 } CRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO
,
196 *PCRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO
;
197 typedef const CRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO
*
198 PCCRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO
;
200 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO
204 LPCWSTR pwszDescription
;
205 LPCWSTR pwszMoreInfoLocation
;
207 LPCWSTR pwszSigningCertDisplayString
;
208 HCERTSTORE hAdditionalCertStore
;
209 PCRYPT_ATTRIBUTES psAuthenticated
;
210 PCRYPT_ATTRIBUTES psUnauthenticated
;
211 } CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO
,
212 *PCRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO
;
213 typedef const CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO
*
214 PCCRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO
;
216 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_INFO
219 DWORD dwSubjectChoice
;
221 LPCWSTR pwszFileName
;
222 PCCRYPTUI_WIZ_DIGITAL_SIGN_BLOB_INFO pSignBlobInfo
;
224 DWORD dwSigningCertChoice
;
226 PCCERT_CONTEXT pSigningCertContext
;
227 PCCRYPTUI_WIZ_DIGITAL_SIGN_STORE_INFO pSigningCertStore
;
228 PCCRYPTUI_WIZ_DIGITAL_SIGN_CERT_PVK_INFO pSigningCertPvkInfo
;
230 LPCWSTR pwszTimestampURL
;
231 DWORD dwAdditionalCertChoice
;
232 PCCRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO pSignExtInfo
;
233 } CRYPTUI_WIZ_DIGITAL_SIGN_INFO
, *PCRYPTUI_WIZ_DIGITAL_SIGN_INFO
;
234 typedef const CRYPTUI_WIZ_DIGITAL_SIGN_INFO
*PCCRYPTUI_WIZ_DIGITAL_SIGN_INFO
;
236 typedef struct _CRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT
241 } CRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT
, *PCRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT
;
243 /* Values for CryptUIWizDigitalSign's dwFlags */
244 #define CRYPTUI_WIZ_NO_UI 0x00000001
245 #define CRYPTUI_WIZ_DIGITAL_SIGN_EXCLUDE_PAGE_HASHES 0x00000002
246 #define CRYPTUI_WIZ_DIGITAL_SIGN_INCLUDE_PAGE_HASHES 0x00000004
248 BOOL WINAPI
CryptUIWizDigitalSign(DWORD dwFlags
, HWND hwndParent
,
249 LPCWSTR pwszWizardTitle
, PCCRYPTUI_WIZ_DIGITAL_SIGN_INFO pDigitalSignInfo
,
250 PCRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT
*ppSignContext
);
252 BOOL WINAPI
CryptUIWizFreeDigitalSignContext(
253 PCRYPTUI_WIZ_DIGITAL_SIGN_CONTEXT pSignContext
);
255 /* Values for CRYPTUI_WIZ_EXPORT_INFO's dwSubjectChoice */
256 #define CRYPTUI_WIZ_EXPORT_CERT_CONTEXT 1
257 #define CRYPTUI_WIZ_EXPORT_CTL_CONTEXT 2
258 #define CRYPTUI_WIZ_EXPORT_CRL_CONTEXT 3
259 #define CRYPTUI_WIZ_EXPORT_CERT_STORE 4
260 #define CRYPTUI_WIZ_EXPORT_CERT_STORE_CERTIFICATES_ONLY 5
261 #define CRYPTUI_WIZ_EXPORT_FORMAT_CRL 6
262 #define CRYPTUI_WIZ_EXPORT_FORMAT_CTL 7
264 typedef struct _CRYPTUI_WIZ_EXPORT_INFO
267 LPCWSTR pwszExportFileName
;
268 DWORD dwSubjectChoice
;
270 PCCERT_CONTEXT pCertContext
;
271 PCCTL_CONTEXT pCTLContext
;
272 PCCRL_CONTEXT pCRLContext
;
275 HCERTSTORE
*rghStores
;
276 } CRYPTUI_WIZ_EXPORT_INFO
, *PCRYPTUI_WIZ_EXPORT_INFO
;
277 typedef const CRYPTUI_WIZ_EXPORT_INFO
*PCCRYPTUI_WIZ_EXPORT_INFO
;
279 /* Values for CRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO's dwExportFormat */
280 #define CRYPTUI_WIZ_EXPORT_FORMAT_DER 1
281 #define CRYPTUI_WIZ_EXPORT_FORMAT_PFX 2
282 #define CRYPTUI_WIZ_EXPORT_FORMAT_PKCS7 3
283 #define CRYPTUI_WIZ_EXPORT_FORMAT_BASE64 4
284 #define CRYPTUI_WIZ_EXPORT_FORMAT_SERIALIZED_CERT_STORE 5
286 typedef struct _CRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
289 DWORD dwExportFormat
;
291 BOOL fExportPrivateKeys
;
292 LPCWSTR pwszPassword
;
293 BOOL fStrongEncryption
;
294 } CRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
, *PCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
;
295 typedef const CRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
*
296 PCCRYPTUI_WIZ_EXPORT_CERTCONTEXT_INFO
;
298 BOOL WINAPI
CryptUIWizExport(DWORD dwFlags
, HWND hwndParent
,
299 LPCWSTR pwszWizardTitle
, PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo
, void *pvoid
);
301 /* Values for CRYPTUI_WIZ_IMPORT_SRC_INFO's dwSubjectChoice */
302 #define CRYPTUI_WIZ_IMPORT_SUBJECT_FILE 1
303 #define CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT 2
304 #define CRYPTUI_WIZ_IMPORT_SUBJECT_CTL_CONTEXT 3
305 #define CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT 4
306 #define CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE 5
308 typedef struct _CRYPTUI_WIZ_IMPORT_SUBJECT_INFO
311 DWORD dwSubjectChoice
;
313 LPCWSTR pwszFileName
;
314 PCCERT_CONTEXT pCertContext
;
315 PCCTL_CONTEXT pCTLContext
;
316 PCCRL_CONTEXT pCRLContext
;
317 HCERTSTORE hCertStore
;
320 LPCWSTR pwszPassword
;
321 } CRYPTUI_WIZ_IMPORT_SRC_INFO
, *PCRYPTUI_WIZ_IMPORT_SRC_INFO
;
322 typedef const CRYPTUI_WIZ_IMPORT_SRC_INFO
*PCCRYPTUI_WIZ_IMPORT_SRC_INFO
;
324 /* Values for CryptUIWizImport's dwFlags */
325 #define CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE 0x00010000
326 #define CRYPTUI_WIZ_IMPORT_ALLOW_CERT 0x00020000
327 #define CRYPTUI_WIZ_IMPORT_ALLOW_CRL 0x00040000
328 #define CRYPTUI_WIZ_IMPORT_ALLOW_CTL 0x00080000
329 #define CRYPTUI_WIZ_IMPORT_TO_LOCALMACHINE 0x00100000
330 #define CRYPTUI_WIZ_IMPORT_TO_CURRENTUSER 0x00200000
331 #define CRYPTUI_WIZ_IMPORT_REMOTE_DEST_STORE 0x00400000
333 BOOL WINAPI
CryptUIWizImport(DWORD dwFlags
, HWND hwndParent
,
334 LPCWSTR pwszWizardTitle
, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc
,
335 HCERTSTORE hDestCertStore
);