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