PageRenderTime 67ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIX509CertDB.h

http://firefox-mac-pdf.googlecode.com/
C Header | 496 lines | 201 code | 70 blank | 225 comment | 0 complexity | e9756f74a2bd3ba86dbfe73941025bf4 MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/security/manager/ssl/public/nsIX509CertDB.idl
  3. */
  4. #ifndef __gen_nsIX509CertDB_h__
  5. #define __gen_nsIX509CertDB_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 nsIArray; /* forward declaration */
  14. class nsIX509Cert; /* forward declaration */
  15. class nsILocalFile; /* forward declaration */
  16. class nsIInterfaceRequestor; /* forward declaration */
  17. #define NS_X509CERTDB_CONTRACTID "@mozilla.org/security/x509certdb;1"
  18. /* starting interface: nsIX509CertDB */
  19. #define NS_IX509CERTDB_IID_STR "da48b3c0-1284-11d5-ac67-000064657374"
  20. #define NS_IX509CERTDB_IID \
  21. {0xda48b3c0, 0x1284, 0x11d5, \
  22. { 0xac, 0x67, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
  23. /**
  24. * This represents a service to access and manipulate
  25. * X.509 certificates stored in a database.
  26. *
  27. * @status FROZEN
  28. */
  29. class NS_NO_VTABLE NS_SCRIPTABLE nsIX509CertDB : public nsISupports {
  30. public:
  31. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IX509CERTDB_IID)
  32. /**
  33. * Constants that define which usages a certificate
  34. * is trusted for.
  35. */
  36. enum { UNTRUSTED = 0U };
  37. enum { TRUSTED_SSL = 1U };
  38. enum { TRUSTED_EMAIL = 2U };
  39. enum { TRUSTED_OBJSIGN = 4U };
  40. /**
  41. * Given a nickname and optionally a token,
  42. * locate the matching certificate.
  43. *
  44. * @param aToken Optionally limits the scope of
  45. * this function to a token device.
  46. * Can be null to mean any token.
  47. * @param aNickname The nickname to be used as the key
  48. * to find a certificate.
  49. *
  50. * @return The matching certificate if found.
  51. */
  52. /* nsIX509Cert findCertByNickname (in nsISupports aToken, in AString aNickname); */
  53. NS_SCRIPTABLE NS_IMETHOD FindCertByNickname(nsISupports *aToken, const nsAString & aNickname, nsIX509Cert **_retval) = 0;
  54. /**
  55. * Will find a certificate based on its dbkey
  56. * retrieved by getting the dbKey attribute of
  57. * the certificate.
  58. *
  59. * @param aDBkey Database internal key, as obtained using
  60. * attribute dbkey in nsIX509Cert.
  61. * @param aToken Optionally limits the scope of
  62. * this function to a token device.
  63. * Can be null to mean any token.
  64. */
  65. /* nsIX509Cert findCertByDBKey (in string aDBkey, in nsISupports aToken); */
  66. NS_SCRIPTABLE NS_IMETHOD FindCertByDBKey(const char *aDBkey, nsISupports *aToken, nsIX509Cert **_retval) = 0;
  67. /**
  68. * Obtain a list of certificate nicknames from the database.
  69. * What the name is depends on type:
  70. * user, ca, or server cert - the nickname
  71. * email cert - the email address
  72. *
  73. * @param aToken Optionally limits the scope of
  74. * this function to a token device.
  75. * Can be null to mean any token.
  76. * @param aType Type of certificate to obtain
  77. * See certificate type constants in nsIX509Cert.
  78. * @param count The number of nicknames in the returned array
  79. * @param certNameList The returned array of certificate nicknames.
  80. */
  81. /* void findCertNicknames (in nsISupports aToken, in unsigned long aType, out unsigned long count, [array, size_is (count)] out wstring certNameList); */
  82. NS_SCRIPTABLE NS_IMETHOD FindCertNicknames(nsISupports *aToken, PRUint32 aType, PRUint32 *count, PRUnichar ***certNameList) = 0;
  83. /**
  84. * Find the email encryption certificate by nickname.
  85. *
  86. * @param aNickname The nickname to be used as the key
  87. * to find the certificate.
  88. *
  89. * @return The matching certificate if found.
  90. */
  91. /* nsIX509Cert findEmailEncryptionCert (in AString aNickname); */
  92. NS_SCRIPTABLE NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert **_retval) = 0;
  93. /**
  94. * Find the email signing certificate by nickname.
  95. *
  96. * @param aNickname The nickname to be used as the key
  97. * to find the certificate.
  98. *
  99. * @return The matching certificate if found.
  100. */
  101. /* nsIX509Cert findEmailSigningCert (in AString aNickname); */
  102. NS_SCRIPTABLE NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert **_retval) = 0;
  103. /**
  104. * Find a certificate by email address.
  105. *
  106. * @param aToken Optionally limits the scope of
  107. * this function to a token device.
  108. * Can be null to mean any token.
  109. * @param aEmailAddress The email address to be used as the key
  110. * to find the certificate.
  111. *
  112. * @return The matching certificate if found.
  113. */
  114. /* nsIX509Cert findCertByEmailAddress (in nsISupports aToken, in string aEmailAddress); */
  115. NS_SCRIPTABLE NS_IMETHOD FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval) = 0;
  116. /**
  117. * Use this to import a stream sent down as a mime type into
  118. * the certificate database on the default token.
  119. * The stream may consist of one or more certificates.
  120. *
  121. * @param data The raw data to be imported
  122. * @param length The length of the data to be imported
  123. * @param type The type of the certificate, see constants in nsIX509Cert
  124. * @param ctx A UI context.
  125. */
  126. /* void importCertificates ([array, size_is (length)] in octet data, in unsigned long length, in unsigned long type, in nsIInterfaceRequestor ctx); */
  127. NS_SCRIPTABLE NS_IMETHOD ImportCertificates(PRUint8 *data, PRUint32 length, PRUint32 type, nsIInterfaceRequestor *ctx) = 0;
  128. /**
  129. * Import another person's email certificate into the database.
  130. *
  131. * @param data The raw data to be imported
  132. * @param length The length of the data to be imported
  133. * @param ctx A UI context.
  134. */
  135. /* void importEmailCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  136. NS_SCRIPTABLE NS_IMETHOD ImportEmailCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) = 0;
  137. /**
  138. * Import a server machine's certificate into the database.
  139. *
  140. * @param data The raw data to be imported
  141. * @param length The length of the data to be imported
  142. * @param ctx A UI context.
  143. */
  144. /* void importServerCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  145. NS_SCRIPTABLE NS_IMETHOD ImportServerCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) = 0;
  146. /**
  147. * Import a personal certificate into the database, assuming
  148. * the database already contains the private key for this certificate.
  149. *
  150. * @param data The raw data to be imported
  151. * @param length The length of the data to be imported
  152. * @param ctx A UI context.
  153. */
  154. /* void importUserCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  155. NS_SCRIPTABLE NS_IMETHOD ImportUserCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) = 0;
  156. /**
  157. * Delete a certificate stored in the database.
  158. *
  159. * @param aCert Delete this certificate.
  160. */
  161. /* void deleteCertificate (in nsIX509Cert aCert); */
  162. NS_SCRIPTABLE NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) = 0;
  163. /**
  164. * Modify the trust that is stored and associated to a certificate within
  165. * a database. Separate trust is stored for
  166. * One call manipulates the trust for one trust type only.
  167. * See the trust type constants defined within this interface.
  168. *
  169. * @param cert Change the stored trust of this certificate.
  170. * @param type The type of the certificate. See nsIX509Cert.
  171. * @param trust A bitmask. The new trust for the possible usages.
  172. * See the trust constants defined within this interface.
  173. */
  174. /* void setCertTrust (in nsIX509Cert cert, in unsigned long type, in unsigned long trust); */
  175. NS_SCRIPTABLE NS_IMETHOD SetCertTrust(nsIX509Cert *cert, PRUint32 type, PRUint32 trust) = 0;
  176. /**
  177. * Query whether a certificate is trusted for a particular use.
  178. *
  179. * @param cert Obtain the stored trust of this certificate.
  180. * @param certType The type of the certificate. See nsIX509Cert.
  181. * @param trustType A single bit from the usages constants defined
  182. * within this interface.
  183. *
  184. * @return Returns true if the certificate is trusted for the given use.
  185. */
  186. /* boolean isCertTrusted (in nsIX509Cert cert, in unsigned long certType, in unsigned long trustType); */
  187. NS_SCRIPTABLE NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, PRUint32 certType, PRUint32 trustType, PRBool *_retval) = 0;
  188. /**
  189. * Import certificate(s) from file
  190. *
  191. * @param aToken Optionally limits the scope of
  192. * this function to a token device.
  193. * Can be null to mean any token.
  194. * @param aFile Identifies a file that contains the certificate
  195. * to be imported.
  196. * @param aType Describes the type of certificate that is going to
  197. * be imported. See type constants in nsIX509Cert.
  198. */
  199. /* void importCertsFromFile (in nsISupports aToken, in nsILocalFile aFile, in unsigned long aType); */
  200. NS_SCRIPTABLE NS_IMETHOD ImportCertsFromFile(nsISupports *aToken, nsILocalFile *aFile, PRUint32 aType) = 0;
  201. /**
  202. * Import a PKCS#12 file containing cert(s) and key(s) into the database.
  203. *
  204. * @param aToken Optionally limits the scope of
  205. * this function to a token device.
  206. * Can be null to mean any token.
  207. * @param aFile Identifies a file that contains the data
  208. * to be imported.
  209. */
  210. /* void importPKCS12File (in nsISupports aToken, in nsILocalFile aFile); */
  211. NS_SCRIPTABLE NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsILocalFile *aFile) = 0;
  212. /**
  213. * Export a set of certs and keys from the database to a PKCS#12 file.
  214. *
  215. * @param aToken Optionally limits the scope of
  216. * this function to a token device.
  217. * Can be null to mean any token.
  218. * @param aFile Identifies a file that will be filled with the data
  219. * to be exported.
  220. * @param count The number of certificates to be exported.
  221. * @param aCerts The array of all certificates to be exported.
  222. */
  223. /* void exportPKCS12File (in nsISupports aToken, in nsILocalFile aFile, in unsigned long count, [array, size_is (count)] in nsIX509Cert aCerts); */
  224. NS_SCRIPTABLE NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsILocalFile *aFile, PRUint32 count, nsIX509Cert **aCerts) = 0;
  225. /**
  226. * An array of all known OCSP responders within the scope of the
  227. * certificate database.
  228. *
  229. * @return Array of OCSP responders, entries are QIable to nsIOCSPResponder.
  230. */
  231. /* nsIArray getOCSPResponders (); */
  232. NS_SCRIPTABLE NS_IMETHOD GetOCSPResponders(nsIArray **_retval) = 0;
  233. /**
  234. * Whether OCSP is enabled in preferences.
  235. */
  236. /* readonly attribute boolean isOcspOn; */
  237. NS_SCRIPTABLE NS_IMETHOD GetIsOcspOn(PRBool *aIsOcspOn) = 0;
  238. /* nsIX509Cert constructX509FromBase64 (in string base64); */
  239. NS_SCRIPTABLE NS_IMETHOD ConstructX509FromBase64(const char *base64, nsIX509Cert **_retval) = 0;
  240. };
  241. NS_DEFINE_STATIC_IID_ACCESSOR(nsIX509CertDB, NS_IX509CERTDB_IID)
  242. /* Use this macro when declaring classes that implement this interface. */
  243. #define NS_DECL_NSIX509CERTDB \
  244. NS_SCRIPTABLE NS_IMETHOD FindCertByNickname(nsISupports *aToken, const nsAString & aNickname, nsIX509Cert **_retval); \
  245. NS_SCRIPTABLE NS_IMETHOD FindCertByDBKey(const char *aDBkey, nsISupports *aToken, nsIX509Cert **_retval); \
  246. NS_SCRIPTABLE NS_IMETHOD FindCertNicknames(nsISupports *aToken, PRUint32 aType, PRUint32 *count, PRUnichar ***certNameList); \
  247. NS_SCRIPTABLE NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert **_retval); \
  248. NS_SCRIPTABLE NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert **_retval); \
  249. NS_SCRIPTABLE NS_IMETHOD FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval); \
  250. NS_SCRIPTABLE NS_IMETHOD ImportCertificates(PRUint8 *data, PRUint32 length, PRUint32 type, nsIInterfaceRequestor *ctx); \
  251. NS_SCRIPTABLE NS_IMETHOD ImportEmailCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx); \
  252. NS_SCRIPTABLE NS_IMETHOD ImportServerCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx); \
  253. NS_SCRIPTABLE NS_IMETHOD ImportUserCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx); \
  254. NS_SCRIPTABLE NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert); \
  255. NS_SCRIPTABLE NS_IMETHOD SetCertTrust(nsIX509Cert *cert, PRUint32 type, PRUint32 trust); \
  256. NS_SCRIPTABLE NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, PRUint32 certType, PRUint32 trustType, PRBool *_retval); \
  257. NS_SCRIPTABLE NS_IMETHOD ImportCertsFromFile(nsISupports *aToken, nsILocalFile *aFile, PRUint32 aType); \
  258. NS_SCRIPTABLE NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsILocalFile *aFile); \
  259. NS_SCRIPTABLE NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsILocalFile *aFile, PRUint32 count, nsIX509Cert **aCerts); \
  260. NS_SCRIPTABLE NS_IMETHOD GetOCSPResponders(nsIArray **_retval); \
  261. NS_SCRIPTABLE NS_IMETHOD GetIsOcspOn(PRBool *aIsOcspOn); \
  262. NS_SCRIPTABLE NS_IMETHOD ConstructX509FromBase64(const char *base64, nsIX509Cert **_retval);
  263. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  264. #define NS_FORWARD_NSIX509CERTDB(_to) \
  265. NS_SCRIPTABLE NS_IMETHOD FindCertByNickname(nsISupports *aToken, const nsAString & aNickname, nsIX509Cert **_retval) { return _to FindCertByNickname(aToken, aNickname, _retval); } \
  266. NS_SCRIPTABLE NS_IMETHOD FindCertByDBKey(const char *aDBkey, nsISupports *aToken, nsIX509Cert **_retval) { return _to FindCertByDBKey(aDBkey, aToken, _retval); } \
  267. NS_SCRIPTABLE NS_IMETHOD FindCertNicknames(nsISupports *aToken, PRUint32 aType, PRUint32 *count, PRUnichar ***certNameList) { return _to FindCertNicknames(aToken, aType, count, certNameList); } \
  268. NS_SCRIPTABLE NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert **_retval) { return _to FindEmailEncryptionCert(aNickname, _retval); } \
  269. NS_SCRIPTABLE NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert **_retval) { return _to FindEmailSigningCert(aNickname, _retval); } \
  270. NS_SCRIPTABLE NS_IMETHOD FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval) { return _to FindCertByEmailAddress(aToken, aEmailAddress, _retval); } \
  271. NS_SCRIPTABLE NS_IMETHOD ImportCertificates(PRUint8 *data, PRUint32 length, PRUint32 type, nsIInterfaceRequestor *ctx) { return _to ImportCertificates(data, length, type, ctx); } \
  272. NS_SCRIPTABLE NS_IMETHOD ImportEmailCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) { return _to ImportEmailCertificate(data, length, ctx); } \
  273. NS_SCRIPTABLE NS_IMETHOD ImportServerCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) { return _to ImportServerCertificate(data, length, ctx); } \
  274. NS_SCRIPTABLE NS_IMETHOD ImportUserCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) { return _to ImportUserCertificate(data, length, ctx); } \
  275. NS_SCRIPTABLE NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) { return _to DeleteCertificate(aCert); } \
  276. NS_SCRIPTABLE NS_IMETHOD SetCertTrust(nsIX509Cert *cert, PRUint32 type, PRUint32 trust) { return _to SetCertTrust(cert, type, trust); } \
  277. NS_SCRIPTABLE NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, PRUint32 certType, PRUint32 trustType, PRBool *_retval) { return _to IsCertTrusted(cert, certType, trustType, _retval); } \
  278. NS_SCRIPTABLE NS_IMETHOD ImportCertsFromFile(nsISupports *aToken, nsILocalFile *aFile, PRUint32 aType) { return _to ImportCertsFromFile(aToken, aFile, aType); } \
  279. NS_SCRIPTABLE NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsILocalFile *aFile) { return _to ImportPKCS12File(aToken, aFile); } \
  280. NS_SCRIPTABLE NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsILocalFile *aFile, PRUint32 count, nsIX509Cert **aCerts) { return _to ExportPKCS12File(aToken, aFile, count, aCerts); } \
  281. NS_SCRIPTABLE NS_IMETHOD GetOCSPResponders(nsIArray **_retval) { return _to GetOCSPResponders(_retval); } \
  282. NS_SCRIPTABLE NS_IMETHOD GetIsOcspOn(PRBool *aIsOcspOn) { return _to GetIsOcspOn(aIsOcspOn); } \
  283. NS_SCRIPTABLE NS_IMETHOD ConstructX509FromBase64(const char *base64, nsIX509Cert **_retval) { return _to ConstructX509FromBase64(base64, _retval); }
  284. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  285. #define NS_FORWARD_SAFE_NSIX509CERTDB(_to) \
  286. NS_SCRIPTABLE NS_IMETHOD FindCertByNickname(nsISupports *aToken, const nsAString & aNickname, nsIX509Cert **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertByNickname(aToken, aNickname, _retval); } \
  287. NS_SCRIPTABLE NS_IMETHOD FindCertByDBKey(const char *aDBkey, nsISupports *aToken, nsIX509Cert **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertByDBKey(aDBkey, aToken, _retval); } \
  288. NS_SCRIPTABLE NS_IMETHOD FindCertNicknames(nsISupports *aToken, PRUint32 aType, PRUint32 *count, PRUnichar ***certNameList) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertNicknames(aToken, aType, count, certNameList); } \
  289. NS_SCRIPTABLE NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindEmailEncryptionCert(aNickname, _retval); } \
  290. NS_SCRIPTABLE NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindEmailSigningCert(aNickname, _retval); } \
  291. NS_SCRIPTABLE NS_IMETHOD FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertByEmailAddress(aToken, aEmailAddress, _retval); } \
  292. NS_SCRIPTABLE NS_IMETHOD ImportCertificates(PRUint8 *data, PRUint32 length, PRUint32 type, nsIInterfaceRequestor *ctx) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportCertificates(data, length, type, ctx); } \
  293. NS_SCRIPTABLE NS_IMETHOD ImportEmailCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportEmailCertificate(data, length, ctx); } \
  294. NS_SCRIPTABLE NS_IMETHOD ImportServerCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportServerCertificate(data, length, ctx); } \
  295. NS_SCRIPTABLE NS_IMETHOD ImportUserCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportUserCertificate(data, length, ctx); } \
  296. NS_SCRIPTABLE NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteCertificate(aCert); } \
  297. NS_SCRIPTABLE NS_IMETHOD SetCertTrust(nsIX509Cert *cert, PRUint32 type, PRUint32 trust) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCertTrust(cert, type, trust); } \
  298. NS_SCRIPTABLE NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, PRUint32 certType, PRUint32 trustType, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCertTrusted(cert, certType, trustType, _retval); } \
  299. NS_SCRIPTABLE NS_IMETHOD ImportCertsFromFile(nsISupports *aToken, nsILocalFile *aFile, PRUint32 aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportCertsFromFile(aToken, aFile, aType); } \
  300. NS_SCRIPTABLE NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsILocalFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportPKCS12File(aToken, aFile); } \
  301. NS_SCRIPTABLE NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsILocalFile *aFile, PRUint32 count, nsIX509Cert **aCerts) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExportPKCS12File(aToken, aFile, count, aCerts); } \
  302. NS_SCRIPTABLE NS_IMETHOD GetOCSPResponders(nsIArray **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOCSPResponders(_retval); } \
  303. NS_SCRIPTABLE NS_IMETHOD GetIsOcspOn(PRBool *aIsOcspOn) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsOcspOn(aIsOcspOn); } \
  304. NS_SCRIPTABLE NS_IMETHOD ConstructX509FromBase64(const char *base64, nsIX509Cert **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConstructX509FromBase64(base64, _retval); }
  305. #if 0
  306. /* Use the code below as a template for the implementation class for this interface. */
  307. /* Header file */
  308. class nsX509CertDB : public nsIX509CertDB
  309. {
  310. public:
  311. NS_DECL_ISUPPORTS
  312. NS_DECL_NSIX509CERTDB
  313. nsX509CertDB();
  314. private:
  315. ~nsX509CertDB();
  316. protected:
  317. /* additional members */
  318. };
  319. /* Implementation file */
  320. NS_IMPL_ISUPPORTS1(nsX509CertDB, nsIX509CertDB)
  321. nsX509CertDB::nsX509CertDB()
  322. {
  323. /* member initializers and constructor code */
  324. }
  325. nsX509CertDB::~nsX509CertDB()
  326. {
  327. /* destructor code */
  328. }
  329. /* nsIX509Cert findCertByNickname (in nsISupports aToken, in AString aNickname); */
  330. NS_IMETHODIMP nsX509CertDB::FindCertByNickname(nsISupports *aToken, const nsAString & aNickname, nsIX509Cert **_retval)
  331. {
  332. return NS_ERROR_NOT_IMPLEMENTED;
  333. }
  334. /* nsIX509Cert findCertByDBKey (in string aDBkey, in nsISupports aToken); */
  335. NS_IMETHODIMP nsX509CertDB::FindCertByDBKey(const char *aDBkey, nsISupports *aToken, nsIX509Cert **_retval)
  336. {
  337. return NS_ERROR_NOT_IMPLEMENTED;
  338. }
  339. /* void findCertNicknames (in nsISupports aToken, in unsigned long aType, out unsigned long count, [array, size_is (count)] out wstring certNameList); */
  340. NS_IMETHODIMP nsX509CertDB::FindCertNicknames(nsISupports *aToken, PRUint32 aType, PRUint32 *count, PRUnichar ***certNameList)
  341. {
  342. return NS_ERROR_NOT_IMPLEMENTED;
  343. }
  344. /* nsIX509Cert findEmailEncryptionCert (in AString aNickname); */
  345. NS_IMETHODIMP nsX509CertDB::FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert **_retval)
  346. {
  347. return NS_ERROR_NOT_IMPLEMENTED;
  348. }
  349. /* nsIX509Cert findEmailSigningCert (in AString aNickname); */
  350. NS_IMETHODIMP nsX509CertDB::FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert **_retval)
  351. {
  352. return NS_ERROR_NOT_IMPLEMENTED;
  353. }
  354. /* nsIX509Cert findCertByEmailAddress (in nsISupports aToken, in string aEmailAddress); */
  355. NS_IMETHODIMP nsX509CertDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval)
  356. {
  357. return NS_ERROR_NOT_IMPLEMENTED;
  358. }
  359. /* void importCertificates ([array, size_is (length)] in octet data, in unsigned long length, in unsigned long type, in nsIInterfaceRequestor ctx); */
  360. NS_IMETHODIMP nsX509CertDB::ImportCertificates(PRUint8 *data, PRUint32 length, PRUint32 type, nsIInterfaceRequestor *ctx)
  361. {
  362. return NS_ERROR_NOT_IMPLEMENTED;
  363. }
  364. /* void importEmailCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  365. NS_IMETHODIMP nsX509CertDB::ImportEmailCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx)
  366. {
  367. return NS_ERROR_NOT_IMPLEMENTED;
  368. }
  369. /* void importServerCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  370. NS_IMETHODIMP nsX509CertDB::ImportServerCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx)
  371. {
  372. return NS_ERROR_NOT_IMPLEMENTED;
  373. }
  374. /* void importUserCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  375. NS_IMETHODIMP nsX509CertDB::ImportUserCertificate(PRUint8 *data, PRUint32 length, nsIInterfaceRequestor *ctx)
  376. {
  377. return NS_ERROR_NOT_IMPLEMENTED;
  378. }
  379. /* void deleteCertificate (in nsIX509Cert aCert); */
  380. NS_IMETHODIMP nsX509CertDB::DeleteCertificate(nsIX509Cert *aCert)
  381. {
  382. return NS_ERROR_NOT_IMPLEMENTED;
  383. }
  384. /* void setCertTrust (in nsIX509Cert cert, in unsigned long type, in unsigned long trust); */
  385. NS_IMETHODIMP nsX509CertDB::SetCertTrust(nsIX509Cert *cert, PRUint32 type, PRUint32 trust)
  386. {
  387. return NS_ERROR_NOT_IMPLEMENTED;
  388. }
  389. /* boolean isCertTrusted (in nsIX509Cert cert, in unsigned long certType, in unsigned long trustType); */
  390. NS_IMETHODIMP nsX509CertDB::IsCertTrusted(nsIX509Cert *cert, PRUint32 certType, PRUint32 trustType, PRBool *_retval)
  391. {
  392. return NS_ERROR_NOT_IMPLEMENTED;
  393. }
  394. /* void importCertsFromFile (in nsISupports aToken, in nsILocalFile aFile, in unsigned long aType); */
  395. NS_IMETHODIMP nsX509CertDB::ImportCertsFromFile(nsISupports *aToken, nsILocalFile *aFile, PRUint32 aType)
  396. {
  397. return NS_ERROR_NOT_IMPLEMENTED;
  398. }
  399. /* void importPKCS12File (in nsISupports aToken, in nsILocalFile aFile); */
  400. NS_IMETHODIMP nsX509CertDB::ImportPKCS12File(nsISupports *aToken, nsILocalFile *aFile)
  401. {
  402. return NS_ERROR_NOT_IMPLEMENTED;
  403. }
  404. /* void exportPKCS12File (in nsISupports aToken, in nsILocalFile aFile, in unsigned long count, [array, size_is (count)] in nsIX509Cert aCerts); */
  405. NS_IMETHODIMP nsX509CertDB::ExportPKCS12File(nsISupports *aToken, nsILocalFile *aFile, PRUint32 count, nsIX509Cert **aCerts)
  406. {
  407. return NS_ERROR_NOT_IMPLEMENTED;
  408. }
  409. /* nsIArray getOCSPResponders (); */
  410. NS_IMETHODIMP nsX509CertDB::GetOCSPResponders(nsIArray **_retval)
  411. {
  412. return NS_ERROR_NOT_IMPLEMENTED;
  413. }
  414. /* readonly attribute boolean isOcspOn; */
  415. NS_IMETHODIMP nsX509CertDB::GetIsOcspOn(PRBool *aIsOcspOn)
  416. {
  417. return NS_ERROR_NOT_IMPLEMENTED;
  418. }
  419. /* nsIX509Cert constructX509FromBase64 (in string base64); */
  420. NS_IMETHODIMP nsX509CertDB::ConstructX509FromBase64(const char *base64, nsIX509Cert **_retval)
  421. {
  422. return NS_ERROR_NOT_IMPLEMENTED;
  423. }
  424. /* End of implementation class template. */
  425. #endif
  426. #endif /* __gen_nsIX509CertDB_h__ */