|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 |
|
7 interface nsIInterfaceRequestor; |
|
8 interface nsIX509Cert; |
|
9 |
|
10 /** |
|
11 * Functions that implement user interface dialogs to manage certificates. |
|
12 */ |
|
13 [scriptable, uuid(da871dab-f69e-4173-ab26-99fcd47b0e85)] |
|
14 interface nsICertificateDialogs : nsISupports |
|
15 { |
|
16 /** |
|
17 * UI shown when a user is asked to download a new CA cert. |
|
18 * Provides user with ability to choose trust settings for the cert. |
|
19 * Asks the user to grant permission to import the certificate. |
|
20 * |
|
21 * @param ctx A user interface context. |
|
22 * @param cert The certificate that is about to get installed. |
|
23 * @param trust a bit mask of trust flags, |
|
24 * see nsIX509CertDB for possible values. |
|
25 * |
|
26 * @return true if the user allows to import the certificate. |
|
27 */ |
|
28 boolean confirmDownloadCACert(in nsIInterfaceRequestor ctx, |
|
29 in nsIX509Cert cert, |
|
30 out unsigned long trust); |
|
31 |
|
32 /** |
|
33 * UI shown when a web site has delivered a CA certificate to |
|
34 * be imported, but the certificate is already contained in the |
|
35 * user's storage. |
|
36 * |
|
37 * @param ctx A user interface context. |
|
38 */ |
|
39 void notifyCACertExists(in nsIInterfaceRequestor ctx); |
|
40 |
|
41 /** |
|
42 * UI shown when a user's personal certificate is going to be |
|
43 * exported to a backup file. |
|
44 * The implementation of this dialog should make sure |
|
45 * to prompt the user to type the password twice in order to |
|
46 * confirm correct input. |
|
47 * The wording in the dialog should also motivate the user |
|
48 * to enter a strong password. |
|
49 * |
|
50 * @param ctx A user interface context. |
|
51 * @param password The password provided by the user. |
|
52 * |
|
53 * @return false if the user requests to cancel. |
|
54 */ |
|
55 boolean setPKCS12FilePassword(in nsIInterfaceRequestor ctx, |
|
56 out AString password); |
|
57 |
|
58 /** |
|
59 * UI shown when a user is about to restore a personal |
|
60 * certificate from a backup file. |
|
61 * The user is requested to enter the password |
|
62 * that was used in the past to protect that backup file. |
|
63 * |
|
64 * @param ctx A user interface context. |
|
65 * @param password The password provided by the user. |
|
66 * |
|
67 * @return false if the user requests to cancel. |
|
68 */ |
|
69 boolean getPKCS12FilePassword(in nsIInterfaceRequestor ctx, |
|
70 out AString password); |
|
71 |
|
72 /** |
|
73 * UI shown when a certificate needs to be shown to the user. |
|
74 * The implementation should try to display as many attributes |
|
75 * as possible. |
|
76 * |
|
77 * @param ctx A user interface context. |
|
78 * @param cert The certificate to be shown to the user. |
|
79 */ |
|
80 void viewCert(in nsIInterfaceRequestor ctx, |
|
81 in nsIX509Cert cert); |
|
82 }; |
|
83 |
|
84 %{C++ |
|
85 #define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1" |
|
86 %} |