OLD | NEW |
| (Empty) |
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/. */ | |
4 | |
5 #ifndef PKITM_H | |
6 #define PKITM_H | |
7 | |
8 #ifdef DEBUG | |
9 static const char PKITM_CVS_ID[] = "@(#) $RCSfile: pkitm.h,v $ $Revision: 1.17 $
$Date: 2012/07/27 21:41:52 $"; | |
10 #endif /* DEBUG */ | |
11 | |
12 /* | |
13 * pkitm.h | |
14 * | |
15 * This file contains PKI-module specific types. | |
16 */ | |
17 | |
18 #ifndef BASET_H | |
19 #include "baset.h" | |
20 #endif /* BASET_H */ | |
21 | |
22 #ifndef PKIT_H | |
23 #include "pkit.h" | |
24 #endif /* PKIT_H */ | |
25 | |
26 PR_BEGIN_EXTERN_C | |
27 | |
28 typedef enum nssCertIDMatchEnum { | |
29 nssCertIDMatch_Yes = 0, | |
30 nssCertIDMatch_No = 1, | |
31 nssCertIDMatch_Unknown = 2 | |
32 } nssCertIDMatch; | |
33 | |
34 /* | |
35 * nssDecodedCert | |
36 * | |
37 * This is an interface to allow the PKI module access to certificate | |
38 * information that can only be found by decoding. The interface is | |
39 * generic, allowing each certificate type its own way of providing | |
40 * the information | |
41 */ | |
42 struct nssDecodedCertStr { | |
43 NSSCertificateType type; | |
44 void *data; | |
45 /* returns the unique identifier for the cert */ | |
46 NSSItem * (*getIdentifier)(nssDecodedCert *dc); | |
47 /* returns the unique identifier for this cert's issuer */ | |
48 void * (*getIssuerIdentifier)(nssDecodedCert *dc); | |
49 /* is id the identifier for this cert? */ | |
50 nssCertIDMatch (*matchIdentifier)(nssDecodedCert *dc, void *id); | |
51 /* is this cert a valid CA cert? */ | |
52 PRBool (*isValidIssuer)(nssDecodedCert *dc); | |
53 /* returns the cert usage */ | |
54 NSSUsage * (*getUsage)(nssDecodedCert *dc); | |
55 /* is time within the validity period of the cert? */ | |
56 PRBool (*isValidAtTime)(nssDecodedCert *dc, NSSTime *time); | |
57 /* is the validity period of this cert newer than cmpdc? */ | |
58 PRBool (*isNewerThan)(nssDecodedCert *dc, nssDecodedCert *cmpdc); | |
59 /* does the usage for this cert match the requested usage? */ | |
60 PRBool (*matchUsage)(nssDecodedCert *dc, const NSSUsage *usage); | |
61 /* is this cert trusted for the requested usage? */ | |
62 PRBool (*isTrustedForUsage)(nssDecodedCert *dc, | |
63 const NSSUsage *usage); | |
64 /* extract the email address */ | |
65 NSSASCII7 *(*getEmailAddress)(nssDecodedCert *dc); | |
66 /* extract the DER-encoded serial number */ | |
67 PRStatus (*getDERSerialNumber)(nssDecodedCert *dc, | |
68 NSSDER *derSerial, NSSArena *arena); | |
69 }; | |
70 | |
71 struct NSSUsageStr { | |
72 PRBool anyUsage; | |
73 SECCertUsage nss3usage; | |
74 PRBool nss3lookingForCA; | |
75 }; | |
76 | |
77 typedef struct nssPKIObjectCollectionStr nssPKIObjectCollection; | |
78 | |
79 typedef struct | |
80 { | |
81 union { | |
82 PRStatus (* cert)(NSSCertificate *c, void *arg); | |
83 PRStatus (* crl)(NSSCRL *crl, void *arg); | |
84 PRStatus (* pvkey)(NSSPrivateKey *vk, void *arg); | |
85 PRStatus (* pbkey)(NSSPublicKey *bk, void *arg); | |
86 } func; | |
87 void *arg; | |
88 } nssPKIObjectCallback; | |
89 | |
90 PR_END_EXTERN_C | |
91 | |
92 #endif /* PKITM_H */ | |
OLD | NEW |