michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIInterfaceRequestor; michael@0: interface nsIX509Cert; michael@0: michael@0: /** michael@0: * Functions that implement user interface dialogs to manage certificates. michael@0: */ michael@0: [scriptable, uuid(da871dab-f69e-4173-ab26-99fcd47b0e85)] michael@0: interface nsICertificateDialogs : nsISupports michael@0: { michael@0: /** michael@0: * UI shown when a user is asked to download a new CA cert. michael@0: * Provides user with ability to choose trust settings for the cert. michael@0: * Asks the user to grant permission to import the certificate. michael@0: * michael@0: * @param ctx A user interface context. michael@0: * @param cert The certificate that is about to get installed. michael@0: * @param trust a bit mask of trust flags, michael@0: * see nsIX509CertDB for possible values. michael@0: * michael@0: * @return true if the user allows to import the certificate. michael@0: */ michael@0: boolean confirmDownloadCACert(in nsIInterfaceRequestor ctx, michael@0: in nsIX509Cert cert, michael@0: out unsigned long trust); michael@0: michael@0: /** michael@0: * UI shown when a web site has delivered a CA certificate to michael@0: * be imported, but the certificate is already contained in the michael@0: * user's storage. michael@0: * michael@0: * @param ctx A user interface context. michael@0: */ michael@0: void notifyCACertExists(in nsIInterfaceRequestor ctx); michael@0: michael@0: /** michael@0: * UI shown when a user's personal certificate is going to be michael@0: * exported to a backup file. michael@0: * The implementation of this dialog should make sure michael@0: * to prompt the user to type the password twice in order to michael@0: * confirm correct input. michael@0: * The wording in the dialog should also motivate the user michael@0: * to enter a strong password. michael@0: * michael@0: * @param ctx A user interface context. michael@0: * @param password The password provided by the user. michael@0: * michael@0: * @return false if the user requests to cancel. michael@0: */ michael@0: boolean setPKCS12FilePassword(in nsIInterfaceRequestor ctx, michael@0: out AString password); michael@0: michael@0: /** michael@0: * UI shown when a user is about to restore a personal michael@0: * certificate from a backup file. michael@0: * The user is requested to enter the password michael@0: * that was used in the past to protect that backup file. michael@0: * michael@0: * @param ctx A user interface context. michael@0: * @param password The password provided by the user. michael@0: * michael@0: * @return false if the user requests to cancel. michael@0: */ michael@0: boolean getPKCS12FilePassword(in nsIInterfaceRequestor ctx, michael@0: out AString password); michael@0: michael@0: /** michael@0: * UI shown when a certificate needs to be shown to the user. michael@0: * The implementation should try to display as many attributes michael@0: * as possible. michael@0: * michael@0: * @param ctx A user interface context. michael@0: * @param cert The certificate to be shown to the user. michael@0: */ michael@0: void viewCert(in nsIInterfaceRequestor ctx, michael@0: in nsIX509Cert cert); michael@0: }; michael@0: michael@0: %{C++ michael@0: #define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1" michael@0: %}