1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/manager/ssl/public/nsICertificateDialogs.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,86 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsISupports.idl" 1.9 + 1.10 +interface nsIInterfaceRequestor; 1.11 +interface nsIX509Cert; 1.12 + 1.13 +/** 1.14 + * Functions that implement user interface dialogs to manage certificates. 1.15 + */ 1.16 +[scriptable, uuid(da871dab-f69e-4173-ab26-99fcd47b0e85)] 1.17 +interface nsICertificateDialogs : nsISupports 1.18 +{ 1.19 + /** 1.20 + * UI shown when a user is asked to download a new CA cert. 1.21 + * Provides user with ability to choose trust settings for the cert. 1.22 + * Asks the user to grant permission to import the certificate. 1.23 + * 1.24 + * @param ctx A user interface context. 1.25 + * @param cert The certificate that is about to get installed. 1.26 + * @param trust a bit mask of trust flags, 1.27 + * see nsIX509CertDB for possible values. 1.28 + * 1.29 + * @return true if the user allows to import the certificate. 1.30 + */ 1.31 + boolean confirmDownloadCACert(in nsIInterfaceRequestor ctx, 1.32 + in nsIX509Cert cert, 1.33 + out unsigned long trust); 1.34 + 1.35 + /** 1.36 + * UI shown when a web site has delivered a CA certificate to 1.37 + * be imported, but the certificate is already contained in the 1.38 + * user's storage. 1.39 + * 1.40 + * @param ctx A user interface context. 1.41 + */ 1.42 + void notifyCACertExists(in nsIInterfaceRequestor ctx); 1.43 + 1.44 + /** 1.45 + * UI shown when a user's personal certificate is going to be 1.46 + * exported to a backup file. 1.47 + * The implementation of this dialog should make sure 1.48 + * to prompt the user to type the password twice in order to 1.49 + * confirm correct input. 1.50 + * The wording in the dialog should also motivate the user 1.51 + * to enter a strong password. 1.52 + * 1.53 + * @param ctx A user interface context. 1.54 + * @param password The password provided by the user. 1.55 + * 1.56 + * @return false if the user requests to cancel. 1.57 + */ 1.58 + boolean setPKCS12FilePassword(in nsIInterfaceRequestor ctx, 1.59 + out AString password); 1.60 + 1.61 + /** 1.62 + * UI shown when a user is about to restore a personal 1.63 + * certificate from a backup file. 1.64 + * The user is requested to enter the password 1.65 + * that was used in the past to protect that backup file. 1.66 + * 1.67 + * @param ctx A user interface context. 1.68 + * @param password The password provided by the user. 1.69 + * 1.70 + * @return false if the user requests to cancel. 1.71 + */ 1.72 + boolean getPKCS12FilePassword(in nsIInterfaceRequestor ctx, 1.73 + out AString password); 1.74 + 1.75 + /** 1.76 + * UI shown when a certificate needs to be shown to the user. 1.77 + * The implementation should try to display as many attributes 1.78 + * as possible. 1.79 + * 1.80 + * @param ctx A user interface context. 1.81 + * @param cert The certificate to be shown to the user. 1.82 + */ 1.83 + void viewCert(in nsIInterfaceRequestor ctx, 1.84 + in nsIX509Cert cert); 1.85 +}; 1.86 + 1.87 +%{C++ 1.88 +#define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1" 1.89 +%}