1
0

nsIX509Cert.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/security/manager/ssl/public/nsIX509Cert.idl
  3. */
  4. #ifndef __gen_nsIX509Cert_h__
  5. #define __gen_nsIX509Cert_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 nsIX509CertValidity; /* forward declaration */
  15. class nsIASN1Object; /* forward declaration */
  16. /* starting interface: nsIX509Cert */
  17. #define NS_IX509CERT_IID_STR "f0980f60-ee3d-11d4-998b-00b0d02354a0"
  18. #define NS_IX509CERT_IID \
  19. {0xf0980f60, 0xee3d, 0x11d4, \
  20. { 0x99, 0x8b, 0x00, 0xb0, 0xd0, 0x23, 0x54, 0xa0 }}
  21. /**
  22. * This represents a X.509 certificate.
  23. *
  24. * @status FROZEN
  25. */
  26. class NS_NO_VTABLE nsIX509Cert : public nsISupports {
  27. public:
  28. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IX509CERT_IID)
  29. /**
  30. * A nickname for the certificate.
  31. */
  32. /* readonly attribute AString nickname; */
  33. NS_IMETHOD GetNickname(nsAString & aNickname) = 0;
  34. /**
  35. * The primary email address of the certificate, if present.
  36. */
  37. /* readonly attribute AString emailAddress; */
  38. NS_IMETHOD GetEmailAddress(nsAString & aEmailAddress) = 0;
  39. /**
  40. * Obtain a list of all email addresses
  41. * contained in the certificate.
  42. *
  43. * @param length The number of strings in the returned array.
  44. * @return An array of email addresses.
  45. */
  46. /* void getEmailAddresses (out unsigned long length, [array, size_is (length), retval] out wstring addresses); */
  47. NS_IMETHOD GetEmailAddresses(PRUint32 *length, PRUnichar ***addresses) = 0;
  48. /**
  49. * Check whether a given address is contained in the certificate.
  50. * The comparison will convert the email address to lowercase.
  51. * The behaviour for non ASCII characters is undefined.
  52. *
  53. * @param aEmailAddress The address to search for.
  54. *
  55. * @return True if the address is contained in the certificate.
  56. */
  57. /* boolean containsEmailAddress (in AString aEmailAddress); */
  58. NS_IMETHOD ContainsEmailAddress(const nsAString & aEmailAddress, PRBool *_retval) = 0;
  59. /**
  60. * The subject owning the certificate.
  61. */
  62. /* readonly attribute AString subjectName; */
  63. NS_IMETHOD GetSubjectName(nsAString & aSubjectName) = 0;
  64. /**
  65. * The subject's common name.
  66. */
  67. /* readonly attribute AString commonName; */
  68. NS_IMETHOD GetCommonName(nsAString & aCommonName) = 0;
  69. /**
  70. * The subject's organization.
  71. */
  72. /* readonly attribute AString organization; */
  73. NS_IMETHOD GetOrganization(nsAString & aOrganization) = 0;
  74. /**
  75. * The subject's organizational unit.
  76. */
  77. /* readonly attribute AString organizationalUnit; */
  78. NS_IMETHOD GetOrganizationalUnit(nsAString & aOrganizationalUnit) = 0;
  79. /**
  80. * The fingerprint of the certificate's public key,
  81. * calculated using the SHA1 algorithm.
  82. */
  83. /* readonly attribute AString sha1Fingerprint; */
  84. NS_IMETHOD GetSha1Fingerprint(nsAString & aSha1Fingerprint) = 0;
  85. /**
  86. * The fingerprint of the certificate's public key,
  87. * calculated using the MD5 algorithm.
  88. */
  89. /* readonly attribute AString md5Fingerprint; */
  90. NS_IMETHOD GetMd5Fingerprint(nsAString & aMd5Fingerprint) = 0;
  91. /**
  92. * A human readable name identifying the hardware or
  93. * software token the certificate is stored on.
  94. */
  95. /* readonly attribute AString tokenName; */
  96. NS_IMETHOD GetTokenName(nsAString & aTokenName) = 0;
  97. /**
  98. * The subject identifying the issuer certificate.
  99. */
  100. /* readonly attribute AString issuerName; */
  101. NS_IMETHOD GetIssuerName(nsAString & aIssuerName) = 0;
  102. /**
  103. * The serial number the issuer assigned to this certificate.
  104. */
  105. /* readonly attribute AString serialNumber; */
  106. NS_IMETHOD GetSerialNumber(nsAString & aSerialNumber) = 0;
  107. /**
  108. * The issuer subject's common name.
  109. */
  110. /* readonly attribute AString issuerCommonName; */
  111. NS_IMETHOD GetIssuerCommonName(nsAString & aIssuerCommonName) = 0;
  112. /**
  113. * The issuer subject's organization.
  114. */
  115. /* readonly attribute AString issuerOrganization; */
  116. NS_IMETHOD GetIssuerOrganization(nsAString & aIssuerOrganization) = 0;
  117. /**
  118. * The issuer subject's organizational unit.
  119. */
  120. /* readonly attribute AString issuerOrganizationUnit; */
  121. NS_IMETHOD GetIssuerOrganizationUnit(nsAString & aIssuerOrganizationUnit) = 0;
  122. /**
  123. * The certificate used by the issuer to sign this certificate.
  124. */
  125. /* readonly attribute nsIX509Cert issuer; */
  126. NS_IMETHOD GetIssuer(nsIX509Cert * *aIssuer) = 0;
  127. /**
  128. * This certificate's validity period.
  129. */
  130. /* readonly attribute nsIX509CertValidity validity; */
  131. NS_IMETHOD GetValidity(nsIX509CertValidity * *aValidity) = 0;
  132. /**
  133. * A unique identifier of this certificate within the local storage.
  134. */
  135. /* readonly attribute string dbKey; */
  136. NS_IMETHOD GetDbKey(char * *aDbKey) = 0;
  137. /**
  138. * A human readable identifier to label this certificate.
  139. */
  140. /* readonly attribute string windowTitle; */
  141. NS_IMETHOD GetWindowTitle(char * *aWindowTitle) = 0;
  142. /**
  143. * Constants to classify the type of a certificate.
  144. */
  145. enum { UNKNOWN_CERT = 0U };
  146. enum { CA_CERT = 1U };
  147. enum { USER_CERT = 2U };
  148. enum { EMAIL_CERT = 4U };
  149. enum { SERVER_CERT = 8U };
  150. /**
  151. * Constants for certificate verification results.
  152. */
  153. enum { VERIFIED_OK = 0U };
  154. enum { NOT_VERIFIED_UNKNOWN = 1U };
  155. enum { CERT_REVOKED = 2U };
  156. enum { CERT_EXPIRED = 4U };
  157. enum { CERT_NOT_TRUSTED = 8U };
  158. enum { ISSUER_NOT_TRUSTED = 16U };
  159. enum { ISSUER_UNKNOWN = 32U };
  160. enum { INVALID_CA = 64U };
  161. enum { USAGE_NOT_ALLOWED = 128U };
  162. /**
  163. * Constants that describe the certified usages of a certificate.
  164. */
  165. enum { CERT_USAGE_SSLClient = 0U };
  166. enum { CERT_USAGE_SSLServer = 1U };
  167. enum { CERT_USAGE_SSLServerWithStepUp = 2U };
  168. enum { CERT_USAGE_SSLCA = 3U };
  169. enum { CERT_USAGE_EmailSigner = 4U };
  170. enum { CERT_USAGE_EmailRecipient = 5U };
  171. enum { CERT_USAGE_ObjectSigner = 6U };
  172. enum { CERT_USAGE_UserCertImport = 7U };
  173. enum { CERT_USAGE_VerifyCA = 8U };
  174. enum { CERT_USAGE_ProtectedObjectSigner = 9U };
  175. enum { CERT_USAGE_StatusResponder = 10U };
  176. enum { CERT_USAGE_AnyCA = 11U };
  177. /**
  178. * Obtain a list of certificates that contains this certificate
  179. * and the issuing certificates of all involved issuers,
  180. * up to the root issuer.
  181. *
  182. * @return The chain of certifficates including the issuers.
  183. */
  184. /* nsIArray getChain (); */
  185. NS_IMETHOD GetChain(nsIArray **_retval) = 0;
  186. /**
  187. * Obtain an array of human readable strings describing
  188. * the certificate's certified usages.
  189. *
  190. * @param ignoreOcsp Do not use OCSP even if it is currently activated.
  191. * @param verified The certificate verification result, see constants.
  192. * @param count The number of human readable usages returned.
  193. * @param usages The array of human readable usages.
  194. */
  195. /* void getUsagesArray (in boolean ignoreOcsp, out PRUint32 verified, out PRUint32 count, [array, size_is (count)] out wstring usages); */
  196. NS_IMETHOD GetUsagesArray(PRBool ignoreOcsp, PRUint32 *verified, PRUint32 *count, PRUnichar ***usages) = 0;
  197. /**
  198. * Obtain a single comma separated human readable string describing
  199. * the certificate's certified usages.
  200. *
  201. * @param ignoreOcsp Do not use OCSP even if it is currently activated.
  202. * @param verified The certificate verification result, see constants.
  203. * @param purposes The string listing the usages.
  204. */
  205. /* void getUsagesString (in boolean ignoreOcsp, out PRUint32 verified, out AString usages); */
  206. NS_IMETHOD GetUsagesString(PRBool ignoreOcsp, PRUint32 *verified, nsAString & usages) = 0;
  207. /**
  208. * Verify the certificate for a particular usage.
  209. *
  210. * @return The certificate verification result, see constants.
  211. */
  212. /* unsigned long verifyForUsage (in unsigned long usage); */
  213. NS_IMETHOD VerifyForUsage(PRUint32 usage, PRUint32 *_retval) = 0;
  214. /**
  215. * This is the attribute which describes the ASN1 layout
  216. * of the certificate. This can be used when doing a
  217. * "pretty print" of the certificate's ASN1 structure.
  218. */
  219. /* readonly attribute nsIASN1Object ASN1Structure; */
  220. NS_IMETHOD GetASN1Structure(nsIASN1Object * *aASN1Structure) = 0;
  221. /**
  222. * Obtain a raw binary encoding of this certificate
  223. * in DER format.
  224. *
  225. * @param length The number of bytes in the binary encoding.
  226. * @param data The bytes representing the DER encoded certificate.
  227. */
  228. /* void getRawDER (out unsigned long length, [array, size_is (length), retval] out octet data); */
  229. NS_IMETHOD GetRawDER(PRUint32 *length, PRUint8 **data) = 0;
  230. /**
  231. * Test whether two certificate instances represent the
  232. * same certificate.
  233. *
  234. * @return Whether the certificates are equal
  235. */
  236. /* boolean equals (in nsIX509Cert other); */
  237. NS_IMETHOD Equals(nsIX509Cert *other, PRBool *_retval) = 0;
  238. };
  239. /* Use this macro when declaring classes that implement this interface. */
  240. #define NS_DECL_NSIX509CERT \
  241. NS_IMETHOD GetNickname(nsAString & aNickname); \
  242. NS_IMETHOD GetEmailAddress(nsAString & aEmailAddress); \
  243. NS_IMETHOD GetEmailAddresses(PRUint32 *length, PRUnichar ***addresses); \
  244. NS_IMETHOD ContainsEmailAddress(const nsAString & aEmailAddress, PRBool *_retval); \
  245. NS_IMETHOD GetSubjectName(nsAString & aSubjectName); \
  246. NS_IMETHOD GetCommonName(nsAString & aCommonName); \
  247. NS_IMETHOD GetOrganization(nsAString & aOrganization); \
  248. NS_IMETHOD GetOrganizationalUnit(nsAString & aOrganizationalUnit); \
  249. NS_IMETHOD GetSha1Fingerprint(nsAString & aSha1Fingerprint); \
  250. NS_IMETHOD GetMd5Fingerprint(nsAString & aMd5Fingerprint); \
  251. NS_IMETHOD GetTokenName(nsAString & aTokenName); \
  252. NS_IMETHOD GetIssuerName(nsAString & aIssuerName); \
  253. NS_IMETHOD GetSerialNumber(nsAString & aSerialNumber); \
  254. NS_IMETHOD GetIssuerCommonName(nsAString & aIssuerCommonName); \
  255. NS_IMETHOD GetIssuerOrganization(nsAString & aIssuerOrganization); \
  256. NS_IMETHOD GetIssuerOrganizationUnit(nsAString & aIssuerOrganizationUnit); \
  257. NS_IMETHOD GetIssuer(nsIX509Cert * *aIssuer); \
  258. NS_IMETHOD GetValidity(nsIX509CertValidity * *aValidity); \
  259. NS_IMETHOD GetDbKey(char * *aDbKey); \
  260. NS_IMETHOD GetWindowTitle(char * *aWindowTitle); \
  261. NS_IMETHOD GetChain(nsIArray **_retval); \
  262. NS_IMETHOD GetUsagesArray(PRBool ignoreOcsp, PRUint32 *verified, PRUint32 *count, PRUnichar ***usages); \
  263. NS_IMETHOD GetUsagesString(PRBool ignoreOcsp, PRUint32 *verified, nsAString & usages); \
  264. NS_IMETHOD VerifyForUsage(PRUint32 usage, PRUint32 *_retval); \
  265. NS_IMETHOD GetASN1Structure(nsIASN1Object * *aASN1Structure); \
  266. NS_IMETHOD GetRawDER(PRUint32 *length, PRUint8 **data); \
  267. NS_IMETHOD Equals(nsIX509Cert *other, PRBool *_retval);
  268. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  269. #define NS_FORWARD_NSIX509CERT(_to) \
  270. NS_IMETHOD GetNickname(nsAString & aNickname) { return _to GetNickname(aNickname); } \
  271. NS_IMETHOD GetEmailAddress(nsAString & aEmailAddress) { return _to GetEmailAddress(aEmailAddress); } \
  272. NS_IMETHOD GetEmailAddresses(PRUint32 *length, PRUnichar ***addresses) { return _to GetEmailAddresses(length, addresses); } \
  273. NS_IMETHOD ContainsEmailAddress(const nsAString & aEmailAddress, PRBool *_retval) { return _to ContainsEmailAddress(aEmailAddress, _retval); } \
  274. NS_IMETHOD GetSubjectName(nsAString & aSubjectName) { return _to GetSubjectName(aSubjectName); } \
  275. NS_IMETHOD GetCommonName(nsAString & aCommonName) { return _to GetCommonName(aCommonName); } \
  276. NS_IMETHOD GetOrganization(nsAString & aOrganization) { return _to GetOrganization(aOrganization); } \
  277. NS_IMETHOD GetOrganizationalUnit(nsAString & aOrganizationalUnit) { return _to GetOrganizationalUnit(aOrganizationalUnit); } \
  278. NS_IMETHOD GetSha1Fingerprint(nsAString & aSha1Fingerprint) { return _to GetSha1Fingerprint(aSha1Fingerprint); } \
  279. NS_IMETHOD GetMd5Fingerprint(nsAString & aMd5Fingerprint) { return _to GetMd5Fingerprint(aMd5Fingerprint); } \
  280. NS_IMETHOD GetTokenName(nsAString & aTokenName) { return _to GetTokenName(aTokenName); } \
  281. NS_IMETHOD GetIssuerName(nsAString & aIssuerName) { return _to GetIssuerName(aIssuerName); } \
  282. NS_IMETHOD GetSerialNumber(nsAString & aSerialNumber) { return _to GetSerialNumber(aSerialNumber); } \
  283. NS_IMETHOD GetIssuerCommonName(nsAString & aIssuerCommonName) { return _to GetIssuerCommonName(aIssuerCommonName); } \
  284. NS_IMETHOD GetIssuerOrganization(nsAString & aIssuerOrganization) { return _to GetIssuerOrganization(aIssuerOrganization); } \
  285. NS_IMETHOD GetIssuerOrganizationUnit(nsAString & aIssuerOrganizationUnit) { return _to GetIssuerOrganizationUnit(aIssuerOrganizationUnit); } \
  286. NS_IMETHOD GetIssuer(nsIX509Cert * *aIssuer) { return _to GetIssuer(aIssuer); } \
  287. NS_IMETHOD GetValidity(nsIX509CertValidity * *aValidity) { return _to GetValidity(aValidity); } \
  288. NS_IMETHOD GetDbKey(char * *aDbKey) { return _to GetDbKey(aDbKey); } \
  289. NS_IMETHOD GetWindowTitle(char * *aWindowTitle) { return _to GetWindowTitle(aWindowTitle); } \
  290. NS_IMETHOD GetChain(nsIArray **_retval) { return _to GetChain(_retval); } \
  291. NS_IMETHOD GetUsagesArray(PRBool ignoreOcsp, PRUint32 *verified, PRUint32 *count, PRUnichar ***usages) { return _to GetUsagesArray(ignoreOcsp, verified, count, usages); } \
  292. NS_IMETHOD GetUsagesString(PRBool ignoreOcsp, PRUint32 *verified, nsAString & usages) { return _to GetUsagesString(ignoreOcsp, verified, usages); } \
  293. NS_IMETHOD VerifyForUsage(PRUint32 usage, PRUint32 *_retval) { return _to VerifyForUsage(usage, _retval); } \
  294. NS_IMETHOD GetASN1Structure(nsIASN1Object * *aASN1Structure) { return _to GetASN1Structure(aASN1Structure); } \
  295. NS_IMETHOD GetRawDER(PRUint32 *length, PRUint8 **data) { return _to GetRawDER(length, data); } \
  296. NS_IMETHOD Equals(nsIX509Cert *other, PRBool *_retval) { return _to Equals(other, _retval); }
  297. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  298. #define NS_FORWARD_SAFE_NSIX509CERT(_to) \
  299. NS_IMETHOD GetNickname(nsAString & aNickname) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNickname(aNickname); } \
  300. NS_IMETHOD GetEmailAddress(nsAString & aEmailAddress) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEmailAddress(aEmailAddress); } \
  301. NS_IMETHOD GetEmailAddresses(PRUint32 *length, PRUnichar ***addresses) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEmailAddresses(length, addresses); } \
  302. NS_IMETHOD ContainsEmailAddress(const nsAString & aEmailAddress, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContainsEmailAddress(aEmailAddress, _retval); } \
  303. NS_IMETHOD GetSubjectName(nsAString & aSubjectName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubjectName(aSubjectName); } \
  304. NS_IMETHOD GetCommonName(nsAString & aCommonName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommonName(aCommonName); } \
  305. NS_IMETHOD GetOrganization(nsAString & aOrganization) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOrganization(aOrganization); } \
  306. NS_IMETHOD GetOrganizationalUnit(nsAString & aOrganizationalUnit) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOrganizationalUnit(aOrganizationalUnit); } \
  307. NS_IMETHOD GetSha1Fingerprint(nsAString & aSha1Fingerprint) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSha1Fingerprint(aSha1Fingerprint); } \
  308. NS_IMETHOD GetMd5Fingerprint(nsAString & aMd5Fingerprint) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMd5Fingerprint(aMd5Fingerprint); } \
  309. NS_IMETHOD GetTokenName(nsAString & aTokenName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTokenName(aTokenName); } \
  310. NS_IMETHOD GetIssuerName(nsAString & aIssuerName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIssuerName(aIssuerName); } \
  311. NS_IMETHOD GetSerialNumber(nsAString & aSerialNumber) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSerialNumber(aSerialNumber); } \
  312. NS_IMETHOD GetIssuerCommonName(nsAString & aIssuerCommonName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIssuerCommonName(aIssuerCommonName); } \
  313. NS_IMETHOD GetIssuerOrganization(nsAString & aIssuerOrganization) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIssuerOrganization(aIssuerOrganization); } \
  314. NS_IMETHOD GetIssuerOrganizationUnit(nsAString & aIssuerOrganizationUnit) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIssuerOrganizationUnit(aIssuerOrganizationUnit); } \
  315. NS_IMETHOD GetIssuer(nsIX509Cert * *aIssuer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIssuer(aIssuer); } \
  316. NS_IMETHOD GetValidity(nsIX509CertValidity * *aValidity) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValidity(aValidity); } \
  317. NS_IMETHOD GetDbKey(char * *aDbKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDbKey(aDbKey); } \
  318. NS_IMETHOD GetWindowTitle(char * *aWindowTitle) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWindowTitle(aWindowTitle); } \
  319. NS_IMETHOD GetChain(nsIArray **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChain(_retval); } \
  320. NS_IMETHOD GetUsagesArray(PRBool ignoreOcsp, PRUint32 *verified, PRUint32 *count, PRUnichar ***usages) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUsagesArray(ignoreOcsp, verified, count, usages); } \
  321. NS_IMETHOD GetUsagesString(PRBool ignoreOcsp, PRUint32 *verified, nsAString & usages) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUsagesString(ignoreOcsp, verified, usages); } \
  322. NS_IMETHOD VerifyForUsage(PRUint32 usage, PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifyForUsage(usage, _retval); } \
  323. NS_IMETHOD GetASN1Structure(nsIASN1Object * *aASN1Structure) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetASN1Structure(aASN1Structure); } \
  324. NS_IMETHOD GetRawDER(PRUint32 *length, PRUint8 **data) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRawDER(length, data); } \
  325. NS_IMETHOD Equals(nsIX509Cert *other, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(other, _retval); }
  326. #if 0
  327. /* Use the code below as a template for the implementation class for this interface. */
  328. /* Header file */
  329. class nsX509Cert : public nsIX509Cert
  330. {
  331. public:
  332. NS_DECL_ISUPPORTS
  333. NS_DECL_NSIX509CERT
  334. nsX509Cert();
  335. private:
  336. ~nsX509Cert();
  337. protected:
  338. /* additional members */
  339. };
  340. /* Implementation file */
  341. NS_IMPL_ISUPPORTS1(nsX509Cert, nsIX509Cert)
  342. nsX509Cert::nsX509Cert()
  343. {
  344. /* member initializers and constructor code */
  345. }
  346. nsX509Cert::~nsX509Cert()
  347. {
  348. /* destructor code */
  349. }
  350. /* readonly attribute AString nickname; */
  351. NS_IMETHODIMP nsX509Cert::GetNickname(nsAString & aNickname)
  352. {
  353. return NS_ERROR_NOT_IMPLEMENTED;
  354. }
  355. /* readonly attribute AString emailAddress; */
  356. NS_IMETHODIMP nsX509Cert::GetEmailAddress(nsAString & aEmailAddress)
  357. {
  358. return NS_ERROR_NOT_IMPLEMENTED;
  359. }
  360. /* void getEmailAddresses (out unsigned long length, [array, size_is (length), retval] out wstring addresses); */
  361. NS_IMETHODIMP nsX509Cert::GetEmailAddresses(PRUint32 *length, PRUnichar ***addresses)
  362. {
  363. return NS_ERROR_NOT_IMPLEMENTED;
  364. }
  365. /* boolean containsEmailAddress (in AString aEmailAddress); */
  366. NS_IMETHODIMP nsX509Cert::ContainsEmailAddress(const nsAString & aEmailAddress, PRBool *_retval)
  367. {
  368. return NS_ERROR_NOT_IMPLEMENTED;
  369. }
  370. /* readonly attribute AString subjectName; */
  371. NS_IMETHODIMP nsX509Cert::GetSubjectName(nsAString & aSubjectName)
  372. {
  373. return NS_ERROR_NOT_IMPLEMENTED;
  374. }
  375. /* readonly attribute AString commonName; */
  376. NS_IMETHODIMP nsX509Cert::GetCommonName(nsAString & aCommonName)
  377. {
  378. return NS_ERROR_NOT_IMPLEMENTED;
  379. }
  380. /* readonly attribute AString organization; */
  381. NS_IMETHODIMP nsX509Cert::GetOrganization(nsAString & aOrganization)
  382. {
  383. return NS_ERROR_NOT_IMPLEMENTED;
  384. }
  385. /* readonly attribute AString organizationalUnit; */
  386. NS_IMETHODIMP nsX509Cert::GetOrganizationalUnit(nsAString & aOrganizationalUnit)
  387. {
  388. return NS_ERROR_NOT_IMPLEMENTED;
  389. }
  390. /* readonly attribute AString sha1Fingerprint; */
  391. NS_IMETHODIMP nsX509Cert::GetSha1Fingerprint(nsAString & aSha1Fingerprint)
  392. {
  393. return NS_ERROR_NOT_IMPLEMENTED;
  394. }
  395. /* readonly attribute AString md5Fingerprint; */
  396. NS_IMETHODIMP nsX509Cert::GetMd5Fingerprint(nsAString & aMd5Fingerprint)
  397. {
  398. return NS_ERROR_NOT_IMPLEMENTED;
  399. }
  400. /* readonly attribute AString tokenName; */
  401. NS_IMETHODIMP nsX509Cert::GetTokenName(nsAString & aTokenName)
  402. {
  403. return NS_ERROR_NOT_IMPLEMENTED;
  404. }
  405. /* readonly attribute AString issuerName; */
  406. NS_IMETHODIMP nsX509Cert::GetIssuerName(nsAString & aIssuerName)
  407. {
  408. return NS_ERROR_NOT_IMPLEMENTED;
  409. }
  410. /* readonly attribute AString serialNumber; */
  411. NS_IMETHODIMP nsX509Cert::GetSerialNumber(nsAString & aSerialNumber)
  412. {
  413. return NS_ERROR_NOT_IMPLEMENTED;
  414. }
  415. /* readonly attribute AString issuerCommonName; */
  416. NS_IMETHODIMP nsX509Cert::GetIssuerCommonName(nsAString & aIssuerCommonName)
  417. {
  418. return NS_ERROR_NOT_IMPLEMENTED;
  419. }
  420. /* readonly attribute AString issuerOrganization; */
  421. NS_IMETHODIMP nsX509Cert::GetIssuerOrganization(nsAString & aIssuerOrganization)
  422. {
  423. return NS_ERROR_NOT_IMPLEMENTED;
  424. }
  425. /* readonly attribute AString issuerOrganizationUnit; */
  426. NS_IMETHODIMP nsX509Cert::GetIssuerOrganizationUnit(nsAString & aIssuerOrganizationUnit)
  427. {
  428. return NS_ERROR_NOT_IMPLEMENTED;
  429. }
  430. /* readonly attribute nsIX509Cert issuer; */
  431. NS_IMETHODIMP nsX509Cert::GetIssuer(nsIX509Cert * *aIssuer)
  432. {
  433. return NS_ERROR_NOT_IMPLEMENTED;
  434. }
  435. /* readonly attribute nsIX509CertValidity validity; */
  436. NS_IMETHODIMP nsX509Cert::GetValidity(nsIX509CertValidity * *aValidity)
  437. {
  438. return NS_ERROR_NOT_IMPLEMENTED;
  439. }
  440. /* readonly attribute string dbKey; */
  441. NS_IMETHODIMP nsX509Cert::GetDbKey(char * *aDbKey)
  442. {
  443. return NS_ERROR_NOT_IMPLEMENTED;
  444. }
  445. /* readonly attribute string windowTitle; */
  446. NS_IMETHODIMP nsX509Cert::GetWindowTitle(char * *aWindowTitle)
  447. {
  448. return NS_ERROR_NOT_IMPLEMENTED;
  449. }
  450. /* nsIArray getChain (); */
  451. NS_IMETHODIMP nsX509Cert::GetChain(nsIArray **_retval)
  452. {
  453. return NS_ERROR_NOT_IMPLEMENTED;
  454. }
  455. /* void getUsagesArray (in boolean ignoreOcsp, out PRUint32 verified, out PRUint32 count, [array, size_is (count)] out wstring usages); */
  456. NS_IMETHODIMP nsX509Cert::GetUsagesArray(PRBool ignoreOcsp, PRUint32 *verified, PRUint32 *count, PRUnichar ***usages)
  457. {
  458. return NS_ERROR_NOT_IMPLEMENTED;
  459. }
  460. /* void getUsagesString (in boolean ignoreOcsp, out PRUint32 verified, out AString usages); */
  461. NS_IMETHODIMP nsX509Cert::GetUsagesString(PRBool ignoreOcsp, PRUint32 *verified, nsAString & usages)
  462. {
  463. return NS_ERROR_NOT_IMPLEMENTED;
  464. }
  465. /* unsigned long verifyForUsage (in unsigned long usage); */
  466. NS_IMETHODIMP nsX509Cert::VerifyForUsage(PRUint32 usage, PRUint32 *_retval)
  467. {
  468. return NS_ERROR_NOT_IMPLEMENTED;
  469. }
  470. /* readonly attribute nsIASN1Object ASN1Structure; */
  471. NS_IMETHODIMP nsX509Cert::GetASN1Structure(nsIASN1Object * *aASN1Structure)
  472. {
  473. return NS_ERROR_NOT_IMPLEMENTED;
  474. }
  475. /* void getRawDER (out unsigned long length, [array, size_is (length), retval] out octet data); */
  476. NS_IMETHODIMP nsX509Cert::GetRawDER(PRUint32 *length, PRUint8 **data)
  477. {
  478. return NS_ERROR_NOT_IMPLEMENTED;
  479. }
  480. /* boolean equals (in nsIX509Cert other); */
  481. NS_IMETHODIMP nsX509Cert::Equals(nsIX509Cert *other, PRBool *_retval)
  482. {
  483. return NS_ERROR_NOT_IMPLEMENTED;
  484. }
  485. /* End of implementation class template. */
  486. #endif
  487. #endif /* __gen_nsIX509Cert_h__ */