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 PKITM_H | 5 #ifndef PKITM_H |
6 #define PKITM_H | 6 #define PKITM_H |
7 | 7 |
8 /* | 8 /* |
9 * pkitm.h | 9 * pkitm.h |
10 * | 10 * |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 /* | 30 /* |
31 * nssDecodedCert | 31 * nssDecodedCert |
32 * | 32 * |
33 * This is an interface to allow the PKI module access to certificate | 33 * This is an interface to allow the PKI module access to certificate |
34 * information that can only be found by decoding. The interface is | 34 * information that can only be found by decoding. The interface is |
35 * generic, allowing each certificate type its own way of providing | 35 * generic, allowing each certificate type its own way of providing |
36 * the information | 36 * the information |
37 */ | 37 */ |
38 struct nssDecodedCertStr { | 38 struct nssDecodedCertStr { |
39 NSSCertificateType type; | 39 NSSCertificateType type; |
40 void *data; | 40 void *data; |
41 /* returns the unique identifier for the cert */ | 41 /* returns the unique identifier for the cert */ |
42 NSSItem * (*getIdentifier)(nssDecodedCert *dc); | 42 NSSItem *(*getIdentifier)(nssDecodedCert *dc); |
43 /* returns the unique identifier for this cert's issuer */ | 43 /* returns the unique identifier for this cert's issuer */ |
44 void * (*getIssuerIdentifier)(nssDecodedCert *dc); | 44 void *(*getIssuerIdentifier)(nssDecodedCert *dc); |
45 /* is id the identifier for this cert? */ | 45 /* is id the identifier for this cert? */ |
46 nssCertIDMatch (*matchIdentifier)(nssDecodedCert *dc, void *id); | 46 nssCertIDMatch (*matchIdentifier)(nssDecodedCert *dc, void *id); |
47 /* is this cert a valid CA cert? */ | 47 /* is this cert a valid CA cert? */ |
48 PRBool (*isValidIssuer)(nssDecodedCert *dc); | 48 PRBool (*isValidIssuer)(nssDecodedCert *dc); |
49 /* returns the cert usage */ | 49 /* returns the cert usage */ |
50 NSSUsage * (*getUsage)(nssDecodedCert *dc); | 50 NSSUsage *(*getUsage)(nssDecodedCert *dc); |
51 /* is time within the validity period of the cert? */ | 51 /* is time within the validity period of the cert? */ |
52 PRBool (*isValidAtTime)(nssDecodedCert *dc, NSSTime *time); | 52 PRBool (*isValidAtTime)(nssDecodedCert *dc, NSSTime *time); |
53 /* is the validity period of this cert newer than cmpdc? */ | 53 /* is the validity period of this cert newer than cmpdc? */ |
54 PRBool (*isNewerThan)(nssDecodedCert *dc, nssDecodedCert *cmpdc); | 54 PRBool (*isNewerThan)(nssDecodedCert *dc, nssDecodedCert *cmpdc); |
55 /* does the usage for this cert match the requested usage? */ | 55 /* does the usage for this cert match the requested usage? */ |
56 PRBool (*matchUsage)(nssDecodedCert *dc, const NSSUsage *usage); | 56 PRBool (*matchUsage)(nssDecodedCert *dc, const NSSUsage *usage); |
57 /* is this cert trusted for the requested usage? */ | 57 /* is this cert trusted for the requested usage? */ |
58 PRBool (*isTrustedForUsage)(nssDecodedCert *dc, | 58 PRBool (*isTrustedForUsage)(nssDecodedCert *dc, const NSSUsage *usage); |
59 const NSSUsage *usage); | 59 /* extract the email address */ |
60 /* extract the email address */ | 60 NSSASCII7 *(*getEmailAddress)(nssDecodedCert *dc); |
61 NSSASCII7 *(*getEmailAddress)(nssDecodedCert *dc); | 61 /* extract the DER-encoded serial number */ |
62 /* extract the DER-encoded serial number */ | 62 PRStatus (*getDERSerialNumber)(nssDecodedCert *dc, NSSDER *derSerial, |
63 PRStatus (*getDERSerialNumber)(nssDecodedCert *dc, | 63 NSSArena *arena); |
64 NSSDER *derSerial, NSSArena *arena); | |
65 }; | 64 }; |
66 | 65 |
67 struct NSSUsageStr { | 66 struct NSSUsageStr { |
68 PRBool anyUsage; | 67 PRBool anyUsage; |
69 SECCertUsage nss3usage; | 68 SECCertUsage nss3usage; |
70 PRBool nss3lookingForCA; | 69 PRBool nss3lookingForCA; |
71 }; | 70 }; |
72 | 71 |
73 typedef struct nssPKIObjectCollectionStr nssPKIObjectCollection; | 72 typedef struct nssPKIObjectCollectionStr nssPKIObjectCollection; |
74 | 73 |
75 typedef struct | 74 typedef struct { |
76 { | |
77 union { | 75 union { |
78 PRStatus (* cert)(NSSCertificate *c, void *arg); | 76 PRStatus (*cert)(NSSCertificate *c, void *arg); |
79 PRStatus (* crl)(NSSCRL *crl, void *arg); | 77 PRStatus (*crl)(NSSCRL *crl, void *arg); |
80 PRStatus (* pvkey)(NSSPrivateKey *vk, void *arg); | 78 PRStatus (*pvkey)(NSSPrivateKey *vk, void *arg); |
81 PRStatus (* pbkey)(NSSPublicKey *bk, void *arg); | 79 PRStatus (*pbkey)(NSSPublicKey *bk, void *arg); |
82 } func; | 80 } func; |
83 void *arg; | 81 void *arg; |
84 } nssPKIObjectCallback; | 82 } nssPKIObjectCallback; |
85 | 83 |
86 PR_END_EXTERN_C | 84 PR_END_EXTERN_C |
87 | 85 |
88 #endif /* PKITM_H */ | 86 #endif /* PKITM_H */ |
OLD | NEW |