security/nss/lib/certdb/certdb.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef _CERTDB_H_
     6 #define _CERTDB_H_
     9 /* common flags for all types of certificates */
    10 #define CERTDB_TERMINAL_RECORD	(1u<<0)
    11 #define CERTDB_TRUSTED		(1u<<1)
    12 #define CERTDB_SEND_WARN	(1u<<2)
    13 #define CERTDB_VALID_CA		(1u<<3)
    14 #define CERTDB_TRUSTED_CA	(1u<<4) /* trusted for issuing server certs */
    15 #define CERTDB_NS_TRUSTED_CA	(1u<<5)
    16 #define CERTDB_USER		(1u<<6)
    17 #define CERTDB_TRUSTED_CLIENT_CA (1u<<7) /* trusted for issuing client certs */
    18 #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 */
    21 /* old usage, to keep old programs compiling */
    22 /* 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
    24  * define */
    25 #if __GNUC__ > 3
    26 #if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5)
    27 typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated));
    28 #else
    29 typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated
    30     ("CERTDB_VALID_PEER is now CERTDB_TERMINAL_RECORD")));
    31 #endif
    32 #define CERTDB_VALID_PEER  ((__CERTDB_VALID_PEER) CERTDB_TERMINAL_RECORD)
    33 #else
    34 #ifdef _WIN32
    35 #pragma deprecated(CERTDB_VALID_PEER)
    36 #endif
    37 #define CERTDB_VALID_PEER  CERTDB_TERMINAL_RECORD 
    38 #endif
    40 SEC_BEGIN_PROTOS
    42 CERTSignedCrl *
    43 SEC_FindCrlByKey(CERTCertDBHandle *handle, SECItem *crlKey, int type);
    45 CERTSignedCrl *
    46 SEC_FindCrlByName(CERTCertDBHandle *handle, SECItem *crlKey, int type);
    48 CERTSignedCrl *
    49 SEC_FindCrlByDERCert(CERTCertDBHandle *handle, SECItem *derCrl, int type);
    51 PRBool
    52 SEC_CertNicknameConflict(const char *nickname, const SECItem *derSubject,
    53 			 CERTCertDBHandle *handle);
    54 CERTSignedCrl *
    55 SEC_NewCrl(CERTCertDBHandle *handle, char *url, SECItem *derCrl, int type);
    57 SECStatus
    58 SEC_DeletePermCRL(CERTSignedCrl *crl);
    61 SECStatus
    62 SEC_LookupCrls(CERTCertDBHandle *handle, CERTCrlHeadNode **nodes, int type);
    64 SECStatus 
    65 SEC_DestroyCrl(CERTSignedCrl *crl);
    67 CERTSignedCrl* SEC_DupCrl(CERTSignedCrl* acrl);
    69 SECStatus
    70 CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname,
    71 		       CERTCertTrust *trust);
    73 SECStatus SEC_DeletePermCertificate(CERTCertificate *cert);
    75 PRBool
    76 SEC_CrlIsNewer(CERTCrl *inNew, CERTCrl *old);
    78 SECCertTimeValidity
    79 SEC_CheckCrlTimes(CERTCrl *crl, PRTime t);
    81 SEC_END_PROTOS
    83 #endif /* _CERTDB_H_ */

mercurial