Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef _CERTDB_H_ |
michael@0 | 6 | #define _CERTDB_H_ |
michael@0 | 7 | |
michael@0 | 8 | |
michael@0 | 9 | /* common flags for all types of certificates */ |
michael@0 | 10 | #define CERTDB_TERMINAL_RECORD (1u<<0) |
michael@0 | 11 | #define CERTDB_TRUSTED (1u<<1) |
michael@0 | 12 | #define CERTDB_SEND_WARN (1u<<2) |
michael@0 | 13 | #define CERTDB_VALID_CA (1u<<3) |
michael@0 | 14 | #define CERTDB_TRUSTED_CA (1u<<4) /* trusted for issuing server certs */ |
michael@0 | 15 | #define CERTDB_NS_TRUSTED_CA (1u<<5) |
michael@0 | 16 | #define CERTDB_USER (1u<<6) |
michael@0 | 17 | #define CERTDB_TRUSTED_CLIENT_CA (1u<<7) /* trusted for issuing client certs */ |
michael@0 | 18 | #define CERTDB_INVISIBLE_CA (1u<<8) /* don't show in UI */ |
michael@0 | 19 | #define CERTDB_GOVT_APPROVED_CA (1u<<9) /* can do strong crypto in export ver */ |
michael@0 | 20 | |
michael@0 | 21 | /* old usage, to keep old programs compiling */ |
michael@0 | 22 | /* On Windows, Mac, and Linux (and other gcc platforms), we can give compile |
michael@0 | 23 | * time deprecation warnings when applications use the old CERTDB_VALID_PEER |
michael@0 | 24 | * define */ |
michael@0 | 25 | #if __GNUC__ > 3 |
michael@0 | 26 | #if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) |
michael@0 | 27 | typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated)); |
michael@0 | 28 | #else |
michael@0 | 29 | typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated |
michael@0 | 30 | ("CERTDB_VALID_PEER is now CERTDB_TERMINAL_RECORD"))); |
michael@0 | 31 | #endif |
michael@0 | 32 | #define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER) CERTDB_TERMINAL_RECORD) |
michael@0 | 33 | #else |
michael@0 | 34 | #ifdef _WIN32 |
michael@0 | 35 | #pragma deprecated(CERTDB_VALID_PEER) |
michael@0 | 36 | #endif |
michael@0 | 37 | #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD |
michael@0 | 38 | #endif |
michael@0 | 39 | |
michael@0 | 40 | SEC_BEGIN_PROTOS |
michael@0 | 41 | |
michael@0 | 42 | CERTSignedCrl * |
michael@0 | 43 | SEC_FindCrlByKey(CERTCertDBHandle *handle, SECItem *crlKey, int type); |
michael@0 | 44 | |
michael@0 | 45 | CERTSignedCrl * |
michael@0 | 46 | SEC_FindCrlByName(CERTCertDBHandle *handle, SECItem *crlKey, int type); |
michael@0 | 47 | |
michael@0 | 48 | CERTSignedCrl * |
michael@0 | 49 | SEC_FindCrlByDERCert(CERTCertDBHandle *handle, SECItem *derCrl, int type); |
michael@0 | 50 | |
michael@0 | 51 | PRBool |
michael@0 | 52 | SEC_CertNicknameConflict(const char *nickname, const SECItem *derSubject, |
michael@0 | 53 | CERTCertDBHandle *handle); |
michael@0 | 54 | CERTSignedCrl * |
michael@0 | 55 | SEC_NewCrl(CERTCertDBHandle *handle, char *url, SECItem *derCrl, int type); |
michael@0 | 56 | |
michael@0 | 57 | SECStatus |
michael@0 | 58 | SEC_DeletePermCRL(CERTSignedCrl *crl); |
michael@0 | 59 | |
michael@0 | 60 | |
michael@0 | 61 | SECStatus |
michael@0 | 62 | SEC_LookupCrls(CERTCertDBHandle *handle, CERTCrlHeadNode **nodes, int type); |
michael@0 | 63 | |
michael@0 | 64 | SECStatus |
michael@0 | 65 | SEC_DestroyCrl(CERTSignedCrl *crl); |
michael@0 | 66 | |
michael@0 | 67 | CERTSignedCrl* SEC_DupCrl(CERTSignedCrl* acrl); |
michael@0 | 68 | |
michael@0 | 69 | SECStatus |
michael@0 | 70 | CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname, |
michael@0 | 71 | CERTCertTrust *trust); |
michael@0 | 72 | |
michael@0 | 73 | SECStatus SEC_DeletePermCertificate(CERTCertificate *cert); |
michael@0 | 74 | |
michael@0 | 75 | PRBool |
michael@0 | 76 | SEC_CrlIsNewer(CERTCrl *inNew, CERTCrl *old); |
michael@0 | 77 | |
michael@0 | 78 | SECCertTimeValidity |
michael@0 | 79 | SEC_CheckCrlTimes(CERTCrl *crl, PRTime t); |
michael@0 | 80 | |
michael@0 | 81 | SEC_END_PROTOS |
michael@0 | 82 | |
michael@0 | 83 | #endif /* _CERTDB_H_ */ |