nsICertificateDialogs.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/security/manager/ssl/public/nsICertificateDialogs.idl
  3. */
  4. #ifndef __gen_nsICertificateDialogs_h__
  5. #define __gen_nsICertificateDialogs_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIInterfaceRequestor; /* forward declaration */
  14. class nsIX509Cert; /* forward declaration */
  15. class nsICRLInfo; /* forward declaration */
  16. /* starting interface: nsICertificateDialogs */
  17. #define NS_ICERTIFICATEDIALOGS_IID_STR "a03ca940-09be-11d5-ac5d-000064657374"
  18. #define NS_ICERTIFICATEDIALOGS_IID \
  19. {0xa03ca940, 0x09be, 0x11d5, \
  20. { 0xac, 0x5d, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
  21. /**
  22. * Functions that implement user interface dialogs to manage certificates.
  23. *
  24. * @status FROZEN
  25. */
  26. class NS_NO_VTABLE nsICertificateDialogs : public nsISupports {
  27. public:
  28. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICERTIFICATEDIALOGS_IID)
  29. /**
  30. * UI shown when a user is asked to download a new CA cert.
  31. * Provides user with ability to choose trust settings for the cert.
  32. * Asks the user to grant permission to import the certificate.
  33. *
  34. * @param ctx A user interface context.
  35. * @param cert The certificate that is about to get installed.
  36. * @param trust a bit mask of trust flags,
  37. * see nsIX509CertDB for possible values.
  38. *
  39. * @return true if the user allows to import the certificate.
  40. */
  41. /* boolean confirmDownloadCACert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert, out unsigned long trust); */
  42. NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval) = 0;
  43. /**
  44. * UI shown when a web site has delivered a CA certificate to
  45. * be imported, but the certificate is already contained in the
  46. * user's storage.
  47. *
  48. * @param ctx A user interface context.
  49. */
  50. /* void notifyCACertExists (in nsIInterfaceRequestor ctx); */
  51. NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx) = 0;
  52. /**
  53. * UI shown when a user's personal certificate is going to be
  54. * exported to a backup file.
  55. * The implementation of this dialog should make sure
  56. * to prompt the user to type the password twice in order to
  57. * confirm correct input.
  58. * The wording in the dialog should also motivate the user
  59. * to enter a strong password.
  60. *
  61. * @param ctx A user interface context.
  62. * @param password The password provided by the user.
  63. *
  64. * @return false if the user requests to cancel.
  65. */
  66. /* boolean setPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
  67. NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) = 0;
  68. /**
  69. * UI shown when a user is about to restore a personal
  70. * certificate from a backup file.
  71. * The user is requested to enter the password
  72. * that was used in the past to protect that backup file.
  73. *
  74. * @param ctx A user interface context.
  75. * @param password The password provided by the user.
  76. *
  77. * @return false if the user requests to cancel.
  78. */
  79. /* boolean getPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
  80. NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) = 0;
  81. /**
  82. * UI shown when a certificate needs to be shown to the user.
  83. * The implementation should try to display as many attributes
  84. * as possible.
  85. *
  86. * @param ctx A user interface context.
  87. * @param cert The certificate to be shown to the user.
  88. */
  89. /* void viewCert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert); */
  90. NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert) = 0;
  91. /**
  92. * UI shown after a Certificate Revocation List (CRL) has been
  93. * successfully imported.
  94. *
  95. * @param ctx A user interface context.
  96. * @param crl Information describing the CRL that was imported.
  97. */
  98. /* void crlImportStatusDialog (in nsIInterfaceRequestor ctx, in nsICRLInfo crl); */
  99. NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) = 0;
  100. };
  101. /* Use this macro when declaring classes that implement this interface. */
  102. #define NS_DECL_NSICERTIFICATEDIALOGS \
  103. NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval); \
  104. NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx); \
  105. NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval); \
  106. NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval); \
  107. NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert); \
  108. NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl);
  109. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  110. #define NS_FORWARD_NSICERTIFICATEDIALOGS(_to) \
  111. NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval) { return _to ConfirmDownloadCACert(ctx, cert, trust, _retval); } \
  112. NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx) { return _to NotifyCACertExists(ctx); } \
  113. NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return _to SetPKCS12FilePassword(ctx, password, _retval); } \
  114. NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return _to GetPKCS12FilePassword(ctx, password, _retval); } \
  115. NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert) { return _to ViewCert(ctx, cert); } \
  116. NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) { return _to CrlImportStatusDialog(ctx, crl); }
  117. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  118. #define NS_FORWARD_SAFE_NSICERTIFICATEDIALOGS(_to) \
  119. NS_IMETHOD ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConfirmDownloadCACert(ctx, cert, trust, _retval); } \
  120. NS_IMETHOD NotifyCACertExists(nsIInterfaceRequestor *ctx) { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyCACertExists(ctx); } \
  121. NS_IMETHOD SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPKCS12FilePassword(ctx, password, _retval); } \
  122. NS_IMETHOD GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPKCS12FilePassword(ctx, password, _retval); } \
  123. NS_IMETHOD ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert) { return !_to ? NS_ERROR_NULL_POINTER : _to->ViewCert(ctx, cert); } \
  124. NS_IMETHOD CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl) { return !_to ? NS_ERROR_NULL_POINTER : _to->CrlImportStatusDialog(ctx, crl); }
  125. #if 0
  126. /* Use the code below as a template for the implementation class for this interface. */
  127. /* Header file */
  128. class nsCertificateDialogs : public nsICertificateDialogs
  129. {
  130. public:
  131. NS_DECL_ISUPPORTS
  132. NS_DECL_NSICERTIFICATEDIALOGS
  133. nsCertificateDialogs();
  134. private:
  135. ~nsCertificateDialogs();
  136. protected:
  137. /* additional members */
  138. };
  139. /* Implementation file */
  140. NS_IMPL_ISUPPORTS1(nsCertificateDialogs, nsICertificateDialogs)
  141. nsCertificateDialogs::nsCertificateDialogs()
  142. {
  143. /* member initializers and constructor code */
  144. }
  145. nsCertificateDialogs::~nsCertificateDialogs()
  146. {
  147. /* destructor code */
  148. }
  149. /* boolean confirmDownloadCACert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert, out unsigned long trust); */
  150. NS_IMETHODIMP nsCertificateDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert, PRUint32 *trust, PRBool *_retval)
  151. {
  152. return NS_ERROR_NOT_IMPLEMENTED;
  153. }
  154. /* void notifyCACertExists (in nsIInterfaceRequestor ctx); */
  155. NS_IMETHODIMP nsCertificateDialogs::NotifyCACertExists(nsIInterfaceRequestor *ctx)
  156. {
  157. return NS_ERROR_NOT_IMPLEMENTED;
  158. }
  159. /* boolean setPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
  160. NS_IMETHODIMP nsCertificateDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval)
  161. {
  162. return NS_ERROR_NOT_IMPLEMENTED;
  163. }
  164. /* boolean getPKCS12FilePassword (in nsIInterfaceRequestor ctx, out AString password); */
  165. NS_IMETHODIMP nsCertificateDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx, nsAString & password, PRBool *_retval)
  166. {
  167. return NS_ERROR_NOT_IMPLEMENTED;
  168. }
  169. /* void viewCert (in nsIInterfaceRequestor ctx, in nsIX509Cert cert); */
  170. NS_IMETHODIMP nsCertificateDialogs::ViewCert(nsIInterfaceRequestor *ctx, nsIX509Cert *cert)
  171. {
  172. return NS_ERROR_NOT_IMPLEMENTED;
  173. }
  174. /* void crlImportStatusDialog (in nsIInterfaceRequestor ctx, in nsICRLInfo crl); */
  175. NS_IMETHODIMP nsCertificateDialogs::CrlImportStatusDialog(nsIInterfaceRequestor *ctx, nsICRLInfo *crl)
  176. {
  177. return NS_ERROR_NOT_IMPLEMENTED;
  178. }
  179. /* End of implementation class template. */
  180. #endif
  181. #define NS_CERTIFICATEDIALOGS_CONTRACTID "@mozilla.org/nsCertificateDialogs;1"
  182. #endif /* __gen_nsICertificateDialogs_h__ */