2001-01-30 21:34:22 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Javier Delgadillo <javi@netscape.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the
|
|
|
|
* terms of the GNU General Public License Version 2 or later (the
|
|
|
|
* "GPL"), in which case the provisions of the GPL are applicable
|
|
|
|
* instead of those above. If you wish to allow use of your
|
|
|
|
* version of this file only under the terms of the GPL and not to
|
|
|
|
* allow others to use your version of this file under the MPL,
|
|
|
|
* indicate your decision by deleting the provisions above and
|
|
|
|
* replace them with the notice and other provisions required by
|
|
|
|
* the GPL. If you do not delete the provisions above, a recipient
|
|
|
|
* may use your version of this file under either the MPL or the
|
|
|
|
* GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2001-03-07 22:24:12 +03:00
|
|
|
%{C++
|
|
|
|
#include "nsString.h"
|
|
|
|
%}
|
|
|
|
|
2001-02-27 00:50:54 +03:00
|
|
|
interface nsIX509Cert;
|
2001-03-07 22:24:12 +03:00
|
|
|
interface nsIPK11Token;
|
|
|
|
|
|
|
|
native nsAutoString(nsAutoString);
|
|
|
|
[ref] native nsAutoStringRef(nsAutoString);
|
2001-02-27 00:50:54 +03:00
|
|
|
|
2001-03-07 22:24:12 +03:00
|
|
|
[scriptable, uuid(da48b3c0-1284-11d5-ac67-000064657374)]
|
2001-01-30 21:34:22 +03:00
|
|
|
interface nsIX509CertDB : nsISupports {
|
2001-02-27 00:50:54 +03:00
|
|
|
|
2001-03-07 22:24:12 +03:00
|
|
|
|
|
|
|
[noscript] nsIX509Cert getCertByName(in nsIPK11Token aToken,
|
|
|
|
in string aNickname);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* getCertificateList
|
|
|
|
*
|
|
|
|
* Obtain a list of certificates from the database.
|
|
|
|
*
|
|
|
|
* token - PKCS#11 token to get certs from (null for all tokens)
|
|
|
|
* type - type of certificate to obtain (see nsIX509Cert)
|
|
|
|
* count - number of certs in list
|
|
|
|
* certs - the list
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
void getCertificateList(in nsIPK11Token token,
|
|
|
|
in unsigned long type,
|
|
|
|
[array, size_is(count)] out nsIX509Cert certs,
|
|
|
|
[retval] out unsigned long count);
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* getCertificateNames
|
|
|
|
*
|
|
|
|
* Obtain a list of certificate names from the database.
|
|
|
|
* What the name is depends on type:
|
|
|
|
* user, ca, or server cert - the nickname
|
|
|
|
* email cert - the email address
|
|
|
|
*
|
|
|
|
* aToken - PKCS#11 token to get certs from (null for all tokens)
|
|
|
|
* aType - type of certificate to obtain (see nsIX509Cert)
|
|
|
|
* rCertNameList - a string of certificate names seperated by a delimiter
|
|
|
|
*/
|
|
|
|
[noscript] void getCertificateNames(in nsIPK11Token aToken,
|
|
|
|
in unsigned long aType,
|
|
|
|
in nsAutoStringRef rCertNameList);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* importCertificate
|
|
|
|
*
|
|
|
|
* Import a certificate into the database.
|
|
|
|
* XXX For now, this only imports into the default internal slot.
|
|
|
|
* should there be a importCertificateToSlot? Or change the sig?
|
|
|
|
*/
|
|
|
|
[noscript] void importCertificate(in nsIX509Cert cert,
|
|
|
|
in unsigned long type,
|
|
|
|
in unsigned long trust,
|
|
|
|
in wstring nickname);
|
2001-02-27 00:50:54 +03:00
|
|
|
|
2001-01-30 21:34:22 +03:00
|
|
|
};
|
|
|
|
|
2001-03-07 22:24:12 +03:00
|
|
|
%{C++
|
|
|
|
|
|
|
|
#define NS_X509CERTDB_CID { /* da48b3c0-1284-11d5-ac67-000064657374 */ \
|
|
|
|
0xda48b3c0, \
|
|
|
|
0x1284, \
|
|
|
|
0x11d5, \
|
|
|
|
{0xac, 0x67, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_X509CERTDB_CONTRACTID "@mozilla.org/security/x509certdb;1"
|
|
|
|
|
|
|
|
|
|
|
|
#define NS_CERTIFICATEMGR_DATASOURCE_CONTRACTID \
|
|
|
|
"@mozilla.org/rdf/datasource;1?name=certificatemgr"
|
|
|
|
|
|
|
|
%}
|