Back to index

lightning-sunbird  0.9+nobinonly
nsIX509Cert.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org code.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Javier Delgadillo <javi@netscape.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #include "nsISupports.idl"
00041 
00042 interface nsIArray;
00043 interface nsIX509CertValidity;
00044 interface nsIASN1Object;
00045 
00051 [scriptable, uuid(f0980f60-ee3d-11d4-998b-00b0d02354a0)]
00052 interface nsIX509Cert : nsISupports {
00053 
00057   readonly attribute AString nickname;
00058 
00062   readonly attribute AString emailAddress;
00063 
00071   void getEmailAddresses(out unsigned long length, 
00072                          [retval, array, size_is(length)] out wstring addresses);
00073 
00083   boolean containsEmailAddress(in AString aEmailAddress);
00084 
00088   readonly attribute AString subjectName;
00089 
00093   readonly attribute AString commonName;
00094 
00098   readonly attribute AString organization;
00099 
00103   readonly attribute AString organizationalUnit;
00104 
00109   readonly attribute AString sha1Fingerprint;
00110 
00115   readonly attribute AString md5Fingerprint;
00116 
00121   readonly attribute AString tokenName;
00122 
00126   readonly attribute AString issuerName;
00127 
00131   readonly attribute AString serialNumber;
00132 
00136   readonly attribute AString issuerCommonName;
00137 
00141   readonly attribute AString issuerOrganization;
00142 
00146   readonly attribute AString issuerOrganizationUnit;
00147 
00151   readonly attribute nsIX509Cert issuer;
00152 
00156   readonly attribute nsIX509CertValidity validity;
00157 
00161   readonly attribute string dbKey;
00162 
00166   readonly attribute string windowTitle;
00167 
00171   const unsigned long UNKNOWN_CERT =      0;
00172   const unsigned long CA_CERT      = 1 << 0;
00173   const unsigned long USER_CERT    = 1 << 1;
00174   const unsigned long EMAIL_CERT   = 1 << 2;
00175   const unsigned long SERVER_CERT  = 1 << 3;
00176 
00180   const unsigned long VERIFIED_OK          =      0;
00181   const unsigned long NOT_VERIFIED_UNKNOWN = 1 << 0;
00182   const unsigned long CERT_REVOKED         = 1 << 1;
00183   const unsigned long CERT_EXPIRED         = 1 << 2;
00184   const unsigned long CERT_NOT_TRUSTED     = 1 << 3;
00185   const unsigned long ISSUER_NOT_TRUSTED   = 1 << 4;
00186   const unsigned long ISSUER_UNKNOWN       = 1 << 5;
00187   const unsigned long INVALID_CA           = 1 << 6;
00188   const unsigned long USAGE_NOT_ALLOWED    = 1 << 7;
00189   
00193   const unsigned long CERT_USAGE_SSLClient = 0;
00194   const unsigned long CERT_USAGE_SSLServer = 1;
00195   const unsigned long CERT_USAGE_SSLServerWithStepUp = 2;
00196   const unsigned long CERT_USAGE_SSLCA = 3;
00197   const unsigned long CERT_USAGE_EmailSigner = 4;
00198   const unsigned long CERT_USAGE_EmailRecipient = 5;
00199   const unsigned long CERT_USAGE_ObjectSigner = 6;
00200   const unsigned long CERT_USAGE_UserCertImport = 7;
00201   const unsigned long CERT_USAGE_VerifyCA = 8;
00202   const unsigned long CERT_USAGE_ProtectedObjectSigner = 9;
00203   const unsigned long CERT_USAGE_StatusResponder = 10;
00204   const unsigned long CERT_USAGE_AnyCA = 11;
00205 
00213   nsIArray getChain();
00214 
00224   void getUsagesArray(in boolean ignoreOcsp,
00225                       out PRUint32 verified,
00226                       out PRUint32 count, 
00227                       [array, size_is(count)] out wstring usages);
00228 
00237   void getUsagesString(in boolean ignoreOcsp, out PRUint32 verified, out AString usages);
00238 
00244    unsigned long verifyForUsage(in unsigned long usage);
00245 
00251   readonly attribute nsIASN1Object ASN1Structure;
00252 
00260   void getRawDER(out unsigned long length,
00261                       [retval, array, size_is(length)] out octet data);
00262 
00269   boolean equals(in nsIX509Cert other);
00270 };