Blame security/manager/ssl/nsICertificateDialogs.idl

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