security/manager/ssl/public/nsICertificateDialogs.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial