OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #ifndef _CERTDB_H_ | 5 #ifndef _CERTDB_H_ |
6 #define _CERTDB_H_ | 6 #define _CERTDB_H_ |
7 | 7 |
8 | |
9 /* common flags for all types of certificates */ | 8 /* common flags for all types of certificates */ |
10 #define CERTDB_TERMINAL_RECORD» (1u<<0) | 9 #define CERTDB_TERMINAL_RECORD (1u << 0) |
11 #define CERTDB_TRUSTED» » (1u<<1) | 10 #define CERTDB_TRUSTED (1u << 1) |
12 #define CERTDB_SEND_WARN» (1u<<2) | 11 #define CERTDB_SEND_WARN (1u << 2) |
13 #define CERTDB_VALID_CA»» (1u<<3) | 12 #define CERTDB_VALID_CA (1u << 3) |
14 #define CERTDB_TRUSTED_CA» (1u<<4) /* trusted for issuing server certs */ | 13 #define CERTDB_TRUSTED_CA (1u << 4) /* trusted for issuing server certs */ |
15 #define CERTDB_NS_TRUSTED_CA» (1u<<5) | 14 #define CERTDB_NS_TRUSTED_CA (1u << 5) |
16 #define CERTDB_USER» » (1u<<6) | 15 #define CERTDB_USER (1u << 6) |
17 #define CERTDB_TRUSTED_CLIENT_CA (1u<<7) /* trusted for issuing client certs */ | 16 #define CERTDB_TRUSTED_CLIENT_CA (1u << 7) /* trusted for issuing client certs *
/ |
18 #define CERTDB_INVISIBLE_CA» (1u<<8) /* don't show in UI */ | 17 #define CERTDB_INVISIBLE_CA (1u << 8) /* don't show in UI */ |
19 #define CERTDB_GOVT_APPROVED_CA»(1u<<9) /* can do strong crypto in export ver */ | 18 #define CERTDB_GOVT_APPROVED_CA (1u << 9) /* can do strong crypto in export ver
*/ |
20 | 19 |
21 /* old usage, to keep old programs compiling */ | 20 /* old usage, to keep old programs compiling */ |
22 /* On Windows, Mac, and Linux (and other gcc platforms), we can give compile | 21 /* On Windows, Mac, and Linux (and other gcc platforms), we can give compile |
23 * time deprecation warnings when applications use the old CERTDB_VALID_PEER | 22 * time deprecation warnings when applications use the old CERTDB_VALID_PEER |
24 * define */ | 23 * define */ |
25 #if __GNUC__ > 3 | 24 #if __GNUC__ > 3 |
26 #if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) | 25 #if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) |
27 typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated)); | 26 typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated)); |
28 #else | 27 #else |
29 typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated | 28 typedef unsigned int __CERTDB_VALID_PEER __attribute__(( |
30 ("CERTDB_VALID_PEER is now CERTDB_TERMINAL_RECORD"))); | 29 deprecated("CERTDB_VALID_PEER is now CERTDB_TERMINAL_RECORD"))); |
31 #endif | 30 #endif |
32 #define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER) CERTDB_TERMINAL_RECORD) | 31 #define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER)CERTDB_TERMINAL_RECORD) |
33 #else | 32 #else |
34 #ifdef _WIN32 | 33 #ifdef _WIN32 |
35 #pragma deprecated(CERTDB_VALID_PEER) | 34 #pragma deprecated(CERTDB_VALID_PEER) |
36 #endif | 35 #endif |
37 #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD | 36 #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD |
38 #endif | 37 #endif |
39 | 38 |
40 SEC_BEGIN_PROTOS | 39 SEC_BEGIN_PROTOS |
41 | 40 |
42 CERTSignedCrl * | 41 CERTSignedCrl *SEC_FindCrlByKey(CERTCertDBHandle *handle, SECItem *crlKey, |
43 SEC_FindCrlByKey(CERTCertDBHandle *handle, SECItem *crlKey, int type); | 42 int type); |
44 | 43 |
45 CERTSignedCrl * | 44 CERTSignedCrl *SEC_FindCrlByName(CERTCertDBHandle *handle, SECItem *crlKey, |
46 SEC_FindCrlByName(CERTCertDBHandle *handle, SECItem *crlKey, int type); | 45 int type); |
47 | 46 |
48 CERTSignedCrl * | 47 CERTSignedCrl *SEC_FindCrlByDERCert(CERTCertDBHandle *handle, SECItem *derCrl, |
49 SEC_FindCrlByDERCert(CERTCertDBHandle *handle, SECItem *derCrl, int type); | 48 int type); |
50 | 49 |
51 PRBool | 50 PRBool SEC_CertNicknameConflict(const char *nickname, const SECItem *derSubject, |
52 SEC_CertNicknameConflict(const char *nickname, const SECItem *derSubject, | 51 CERTCertDBHandle *handle); |
53 » » » CERTCertDBHandle *handle); | 52 CERTSignedCrl *SEC_NewCrl(CERTCertDBHandle *handle, char *url, SECItem *derCrl, |
54 CERTSignedCrl * | 53 int type); |
55 SEC_NewCrl(CERTCertDBHandle *handle, char *url, SECItem *derCrl, int type); | |
56 | 54 |
57 SECStatus | 55 SECStatus SEC_DeletePermCRL(CERTSignedCrl *crl); |
58 SEC_DeletePermCRL(CERTSignedCrl *crl); | |
59 | 56 |
| 57 SECStatus SEC_LookupCrls(CERTCertDBHandle *handle, CERTCrlHeadNode **nodes, |
| 58 int type); |
60 | 59 |
61 SECStatus | 60 SECStatus SEC_DestroyCrl(CERTSignedCrl *crl); |
62 SEC_LookupCrls(CERTCertDBHandle *handle, CERTCrlHeadNode **nodes, int type); | |
63 | 61 |
64 SECStatus | 62 CERTSignedCrl *SEC_DupCrl(CERTSignedCrl *acrl); |
65 SEC_DestroyCrl(CERTSignedCrl *crl); | |
66 | 63 |
67 CERTSignedCrl* SEC_DupCrl(CERTSignedCrl* acrl); | 64 SECStatus CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname, |
68 | 65 CERTCertTrust *trust); |
69 SECStatus | |
70 CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname, | |
71 » » CERTCertTrust *trust); | |
72 | 66 |
73 SECStatus SEC_DeletePermCertificate(CERTCertificate *cert); | 67 SECStatus SEC_DeletePermCertificate(CERTCertificate *cert); |
74 | 68 |
75 PRBool | 69 PRBool SEC_CrlIsNewer(CERTCrl *inNew, CERTCrl *old); |
76 SEC_CrlIsNewer(CERTCrl *inNew, CERTCrl *old); | |
77 | 70 |
78 /* | 71 /* |
79 ** Extract the validity times from a CRL | 72 ** Extract the validity times from a CRL |
80 ** "crl" is the CRL | 73 ** "crl" is the CRL |
81 ** "notBefore" is the start of the validity period (last update) | 74 ** "notBefore" is the start of the validity period (last update) |
82 ** "notAfter" is the end of the validity period (next update) | 75 ** "notAfter" is the end of the validity period (next update) |
83 */ | 76 */ |
84 SECStatus | 77 SECStatus SEC_GetCrlTimes(CERTCrl *crl, PRTime *notBefore, PRTime *notAfter); |
85 SEC_GetCrlTimes(CERTCrl *crl, PRTime *notBefore, PRTime *notAfter); | |
86 | 78 |
87 /* | 79 /* |
88 ** Check the validity times of a crl vs. time 't', allowing | 80 ** Check the validity times of a crl vs. time 't', allowing |
89 ** some slop for broken clocks and stuff. | 81 ** some slop for broken clocks and stuff. |
90 ** "crl" is the certificate to be checked | 82 ** "crl" is the certificate to be checked |
91 ** "t" is the time to check against | 83 ** "t" is the time to check against |
92 */ | 84 */ |
93 SECCertTimeValidity | 85 SECCertTimeValidity SEC_CheckCrlTimes(CERTCrl *crl, PRTime t); |
94 SEC_CheckCrlTimes(CERTCrl *crl, PRTime t); | |
95 | 86 |
96 SEC_END_PROTOS | 87 SEC_END_PROTOS |
97 | 88 |
98 #endif /* _CERTDB_H_ */ | 89 #endif /* _CERTDB_H_ */ |
OLD | NEW |