nsICertificateDialogs.idl (2414B)
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 [must_use] 29 boolean confirmDownloadCACert(in nsIInterfaceRequestor ctx, 30 in nsIX509Cert cert, 31 out unsigned long trust); 32 33 /** 34 * UI shown when a user's personal certificate is going to be 35 * exported to a backup file. 36 * The implementation of this dialog should make sure to prompt the user to 37 * type the password twice in order to confirm correct input. 38 * The wording in the dialog should also motivate the user to enter a strong 39 * password. 40 * 41 * @param ctx A user interface context. 42 * @param password The password provided by the user. 43 * 44 * @return false if the user requests to cancel. 45 */ 46 [must_use] 47 boolean setPKCS12FilePassword(in nsIInterfaceRequestor ctx, 48 out AString password); 49 50 /** 51 * UI shown when a user is about to restore a personal 52 * certificate from a backup file. 53 * The user is requested to enter the password 54 * that was used in the past to protect that backup file. 55 * 56 * @param ctx A user interface context. 57 * @param password The password provided by the user. 58 * 59 * @return false if the user requests to cancel. 60 */ 61 [must_use] 62 boolean getPKCS12FilePassword(in nsIInterfaceRequestor ctx, 63 out AString password); 64 }; 65 66 %{C++ 67 #define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1" 68 %}