nsICertificateDialogs.idl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. #include "nsISupports.idl"
  5. interface nsIInterfaceRequestor;
  6. interface nsIX509Cert;
  7. /**
  8. * Functions that implement user interface dialogs to manage certificates.
  9. */
  10. [scriptable, uuid(da871dab-f69e-4173-ab26-99fcd47b0e85)]
  11. interface nsICertificateDialogs : nsISupports
  12. {
  13. /**
  14. * UI shown when a user is asked to download a new CA cert.
  15. * Provides user with ability to choose trust settings for the cert.
  16. * Asks the user to grant permission to import the certificate.
  17. *
  18. * @param ctx A user interface context.
  19. * @param cert The certificate that is about to get installed.
  20. * @param trust a bit mask of trust flags,
  21. * see nsIX509CertDB for possible values.
  22. *
  23. * @return true if the user allows to import the certificate.
  24. */
  25. boolean confirmDownloadCACert(in nsIInterfaceRequestor ctx,
  26. in nsIX509Cert cert,
  27. out unsigned long trust);
  28. /**
  29. * UI shown when a user's personal certificate is going to be
  30. * exported to a backup file.
  31. * The implementation of this dialog should make sure
  32. * to prompt the user to type the password twice in order to
  33. * confirm correct input.
  34. * The wording in the dialog should also motivate the user
  35. * to enter a strong password.
  36. *
  37. * @param ctx A user interface context.
  38. * @param password The password provided by the user.
  39. *
  40. * @return false if the user requests to cancel.
  41. */
  42. boolean setPKCS12FilePassword(in nsIInterfaceRequestor ctx,
  43. out AString password);
  44. /**
  45. * UI shown when a user is about to restore a personal
  46. * certificate from a backup file.
  47. * The user is requested to enter the password
  48. * that was used in the past to protect that backup file.
  49. *
  50. * @param ctx A user interface context.
  51. * @param password The password provided by the user.
  52. *
  53. * @return false if the user requests to cancel.
  54. */
  55. boolean getPKCS12FilePassword(in nsIInterfaceRequestor ctx,
  56. out AString password);
  57. /**
  58. * UI shown when a certificate needs to be shown to the user.
  59. * The implementation should try to display as many attributes
  60. * as possible.
  61. *
  62. * @param ctx A user interface context.
  63. * @param cert The certificate to be shown to the user.
  64. */
  65. void viewCert(in nsIInterfaceRequestor ctx,
  66. in nsIX509Cert cert);
  67. };
  68. %{C++
  69. #define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1"
  70. %}