michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _CERTDB_H_ michael@0: #define _CERTDB_H_ michael@0: michael@0: michael@0: /* common flags for all types of certificates */ michael@0: #define CERTDB_TERMINAL_RECORD (1u<<0) michael@0: #define CERTDB_TRUSTED (1u<<1) michael@0: #define CERTDB_SEND_WARN (1u<<2) michael@0: #define CERTDB_VALID_CA (1u<<3) michael@0: #define CERTDB_TRUSTED_CA (1u<<4) /* trusted for issuing server certs */ michael@0: #define CERTDB_NS_TRUSTED_CA (1u<<5) michael@0: #define CERTDB_USER (1u<<6) michael@0: #define CERTDB_TRUSTED_CLIENT_CA (1u<<7) /* trusted for issuing client certs */ michael@0: #define CERTDB_INVISIBLE_CA (1u<<8) /* don't show in UI */ michael@0: #define CERTDB_GOVT_APPROVED_CA (1u<<9) /* can do strong crypto in export ver */ michael@0: michael@0: /* old usage, to keep old programs compiling */ michael@0: /* On Windows, Mac, and Linux (and other gcc platforms), we can give compile michael@0: * time deprecation warnings when applications use the old CERTDB_VALID_PEER michael@0: * define */ michael@0: #if __GNUC__ > 3 michael@0: #if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) michael@0: typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated)); michael@0: #else michael@0: typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated michael@0: ("CERTDB_VALID_PEER is now CERTDB_TERMINAL_RECORD"))); michael@0: #endif michael@0: #define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER) CERTDB_TERMINAL_RECORD) michael@0: #else michael@0: #ifdef _WIN32 michael@0: #pragma deprecated(CERTDB_VALID_PEER) michael@0: #endif michael@0: #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD michael@0: #endif michael@0: michael@0: SEC_BEGIN_PROTOS michael@0: michael@0: CERTSignedCrl * michael@0: SEC_FindCrlByKey(CERTCertDBHandle *handle, SECItem *crlKey, int type); michael@0: michael@0: CERTSignedCrl * michael@0: SEC_FindCrlByName(CERTCertDBHandle *handle, SECItem *crlKey, int type); michael@0: michael@0: CERTSignedCrl * michael@0: SEC_FindCrlByDERCert(CERTCertDBHandle *handle, SECItem *derCrl, int type); michael@0: michael@0: PRBool michael@0: SEC_CertNicknameConflict(const char *nickname, const SECItem *derSubject, michael@0: CERTCertDBHandle *handle); michael@0: CERTSignedCrl * michael@0: SEC_NewCrl(CERTCertDBHandle *handle, char *url, SECItem *derCrl, int type); michael@0: michael@0: SECStatus michael@0: SEC_DeletePermCRL(CERTSignedCrl *crl); michael@0: michael@0: michael@0: SECStatus michael@0: SEC_LookupCrls(CERTCertDBHandle *handle, CERTCrlHeadNode **nodes, int type); michael@0: michael@0: SECStatus michael@0: SEC_DestroyCrl(CERTSignedCrl *crl); michael@0: michael@0: CERTSignedCrl* SEC_DupCrl(CERTSignedCrl* acrl); michael@0: michael@0: SECStatus michael@0: CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname, michael@0: CERTCertTrust *trust); michael@0: michael@0: SECStatus SEC_DeletePermCertificate(CERTCertificate *cert); michael@0: michael@0: PRBool michael@0: SEC_CrlIsNewer(CERTCrl *inNew, CERTCrl *old); michael@0: michael@0: SECCertTimeValidity michael@0: SEC_CheckCrlTimes(CERTCrl *crl, PRTime t); michael@0: michael@0: SEC_END_PROTOS michael@0: michael@0: #endif /* _CERTDB_H_ */