nsICertificateDialogs.idl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is mozilla.org code.
  15. *
  16. * The Initial Developer of the Original Code is
  17. * Netscape Communications Corporation.
  18. * Portions created by the Initial Developer are Copyright (C) 2001
  19. * the Initial Developer. All Rights Reserved.
  20. *
  21. * Contributor(s):
  22. * Terry Hayes <[email protected]>
  23. *
  24. * Alternatively, the contents of this file may be used under the terms of
  25. * either the GNU General Public License Version 2 or later (the "GPL"), or
  26. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27. * in which case the provisions of the GPL or the LGPL are applicable instead
  28. * of those above. If you wish to allow use of your version of this file only
  29. * under the terms of either the GPL or the LGPL, and not to allow others to
  30. * use your version of this file under the terms of the MPL, indicate your
  31. * decision by deleting the provisions above and replace them with the notice
  32. * and other provisions required by the GPL or the LGPL. If you do not delete
  33. * the provisions above, a recipient may use your version of this file under
  34. * the terms of any one of the MPL, the GPL or the LGPL.
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. #include "nsISupports.idl"
  38. interface nsIInterfaceRequestor;
  39. interface nsIX509Cert;
  40. interface nsICRLInfo;
  41. /**
  42. * Functions that implement user interface dialogs to manage certificates.
  43. *
  44. * @status FROZEN
  45. */
  46. [scriptable, uuid(a03ca940-09be-11d5-ac5d-000064657374)]
  47. interface nsICertificateDialogs : nsISupports
  48. {
  49. /**
  50. * UI shown when a user is asked to download a new CA cert.
  51. * Provides user with ability to choose trust settings for the cert.
  52. * Asks the user to grant permission to import the certificate.
  53. *
  54. * @param ctx A user interface context.
  55. * @param cert The certificate that is about to get installed.
  56. * @param trust a bit mask of trust flags,
  57. * see nsIX509CertDB for possible values.
  58. *
  59. * @return true if the user allows to import the certificate.
  60. */
  61. boolean confirmDownloadCACert(in nsIInterfaceRequestor ctx,
  62. in nsIX509Cert cert,
  63. out unsigned long trust);
  64. /**
  65. * UI shown when a web site has delivered a CA certificate to
  66. * be imported, but the certificate is already contained in the
  67. * user's storage.
  68. *
  69. * @param ctx A user interface context.
  70. */
  71. void notifyCACertExists(in nsIInterfaceRequestor ctx);
  72. /**
  73. * UI shown when a user's personal certificate is going to be
  74. * exported to a backup file.
  75. * The implementation of this dialog should make sure
  76. * to prompt the user to type the password twice in order to
  77. * confirm correct input.
  78. * The wording in the dialog should also motivate the user
  79. * to enter a strong password.
  80. *
  81. * @param ctx A user interface context.
  82. * @param password The password provided by the user.
  83. *
  84. * @return false if the user requests to cancel.
  85. */
  86. boolean setPKCS12FilePassword(in nsIInterfaceRequestor ctx,
  87. out AString password);
  88. /**
  89. * UI shown when a user is about to restore a personal
  90. * certificate from a backup file.
  91. * The user is requested to enter the password
  92. * that was used in the past to protect that backup file.
  93. *
  94. * @param ctx A user interface context.
  95. * @param password The password provided by the user.
  96. *
  97. * @return false if the user requests to cancel.
  98. */
  99. boolean getPKCS12FilePassword(in nsIInterfaceRequestor ctx,
  100. out AString password);
  101. /**
  102. * UI shown when a certificate needs to be shown to the user.
  103. * The implementation should try to display as many attributes
  104. * as possible.
  105. *
  106. * @param ctx A user interface context.
  107. * @param cert The certificate to be shown to the user.
  108. */
  109. void viewCert(in nsIInterfaceRequestor ctx,
  110. in nsIX509Cert cert);
  111. /**
  112. * UI shown after a Certificate Revocation List (CRL) has been
  113. * successfully imported.
  114. *
  115. * @param ctx A user interface context.
  116. * @param crl Information describing the CRL that was imported.
  117. */
  118. void crlImportStatusDialog(in nsIInterfaceRequestor ctx,
  119. in nsICRLInfo crl);
  120. };
  121. %{C++
  122. #define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1"
  123. %}