|
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 PKINSS3HACK_H |
|
6 #define PKINSS3HACK_H |
|
7 |
|
8 #ifndef NSSDEVT_H |
|
9 #include "nssdevt.h" |
|
10 #endif /* NSSDEVT_H */ |
|
11 |
|
12 #ifndef DEVT_H |
|
13 #include "devt.h" |
|
14 #endif /* DEVT_H */ |
|
15 |
|
16 #ifndef NSSPKIT_H |
|
17 #include "nsspkit.h" |
|
18 #endif /* NSSPKIT_H */ |
|
19 |
|
20 #include "base.h" |
|
21 |
|
22 #include "cert.h" |
|
23 |
|
24 PR_BEGIN_EXTERN_C |
|
25 |
|
26 #define NSSITEM_FROM_SECITEM(nssit, secit) \ |
|
27 (nssit)->data = (void *)(secit)->data; \ |
|
28 (nssit)->size = (PRUint32)(secit)->len; |
|
29 |
|
30 #define SECITEM_FROM_NSSITEM(secit, nssit) \ |
|
31 (secit)->data = (unsigned char *)(nssit)->data; \ |
|
32 (secit)->len = (unsigned int)(nssit)->size; |
|
33 |
|
34 NSS_EXTERN NSSTrustDomain * |
|
35 STAN_GetDefaultTrustDomain(); |
|
36 |
|
37 NSS_EXTERN NSSCryptoContext * |
|
38 STAN_GetDefaultCryptoContext(); |
|
39 |
|
40 NSS_EXTERN PRStatus |
|
41 STAN_InitTokenForSlotInfo(NSSTrustDomain *td, PK11SlotInfo *slot); |
|
42 |
|
43 NSS_EXTERN PRStatus |
|
44 STAN_ResetTokenInterator(NSSTrustDomain *td); |
|
45 |
|
46 NSS_EXTERN PRStatus |
|
47 STAN_LoadDefaultNSS3TrustDomain(void); |
|
48 |
|
49 NSS_EXTERN PRStatus |
|
50 STAN_Shutdown(); |
|
51 |
|
52 NSS_EXTERN SECStatus |
|
53 STAN_AddModuleToDefaultTrustDomain(SECMODModule *module); |
|
54 |
|
55 NSS_EXTERN SECStatus |
|
56 STAN_RemoveModuleFromDefaultTrustDomain(SECMODModule *module); |
|
57 |
|
58 NSS_EXTERN CERTCertificate * |
|
59 STAN_ForceCERTCertificateUpdate(NSSCertificate *c); |
|
60 |
|
61 NSS_EXTERN CERTCertificate * |
|
62 STAN_GetCERTCertificate(NSSCertificate *c); |
|
63 |
|
64 NSS_EXTERN CERTCertificate * |
|
65 STAN_GetCERTCertificateOrRelease(NSSCertificate *c); |
|
66 |
|
67 NSS_EXTERN NSSCertificate * |
|
68 STAN_GetNSSCertificate(CERTCertificate *c); |
|
69 |
|
70 NSS_EXTERN CERTCertTrust * |
|
71 nssTrust_GetCERTCertTrustForCert(NSSCertificate *c, CERTCertificate *cc); |
|
72 |
|
73 NSS_EXTERN PRStatus |
|
74 STAN_DeleteCertTrustMatchingSlot(NSSCertificate *c); |
|
75 |
|
76 NSS_EXTERN PRStatus |
|
77 STAN_ChangeCertTrust(CERTCertificate *cc, CERTCertTrust *trust); |
|
78 |
|
79 NSS_EXTERN PRStatus |
|
80 nssPKIX509_GetIssuerAndSerialFromDER(NSSDER *der, NSSArena *arena, |
|
81 NSSDER *issuer, NSSDER *serial); |
|
82 |
|
83 NSS_EXTERN char * |
|
84 STAN_GetCERTCertificateName(PLArenaPool *arenaOpt, NSSCertificate *c); |
|
85 |
|
86 NSS_EXTERN char * |
|
87 STAN_GetCERTCertificateNameForInstance(PLArenaPool *arenaOpt, |
|
88 NSSCertificate *c, |
|
89 nssCryptokiInstance *instance); |
|
90 |
|
91 /* exposing this */ |
|
92 NSS_EXTERN NSSCertificate * |
|
93 NSSCertificate_Create |
|
94 ( |
|
95 NSSArena *arenaOpt |
|
96 ); |
|
97 |
|
98 /* This function is being put here because it is a hack for |
|
99 * PK11_FindCertFromNickname. |
|
100 */ |
|
101 NSS_EXTERN NSSCertificate * |
|
102 nssTrustDomain_FindBestCertificateByNicknameForToken |
|
103 ( |
|
104 NSSTrustDomain *td, |
|
105 NSSToken *token, |
|
106 NSSUTF8 *name, |
|
107 NSSTime *timeOpt, /* NULL for "now" */ |
|
108 NSSUsage *usage, |
|
109 NSSPolicies *policiesOpt /* NULL for none */ |
|
110 ); |
|
111 |
|
112 /* This function is being put here because it is a hack for |
|
113 * PK11_FindCertsFromNickname. |
|
114 */ |
|
115 NSS_EXTERN NSSCertificate ** |
|
116 nssTrustDomain_FindCertificatesByNicknameForToken |
|
117 ( |
|
118 NSSTrustDomain *td, |
|
119 NSSToken *token, |
|
120 NSSUTF8 *name, |
|
121 NSSCertificate *rvOpt[], |
|
122 PRUint32 maximumOpt, /* 0 for no max */ |
|
123 NSSArena *arenaOpt |
|
124 ); |
|
125 |
|
126 /* CERT_TraversePermCertsForSubject */ |
|
127 NSS_EXTERN PRStatus |
|
128 nssTrustDomain_TraverseCertificatesBySubject |
|
129 ( |
|
130 NSSTrustDomain *td, |
|
131 NSSDER *subject, |
|
132 PRStatus (*callback)(NSSCertificate *c, void *arg), |
|
133 void *arg |
|
134 ); |
|
135 |
|
136 /* CERT_TraversePermCertsForNickname */ |
|
137 NSS_EXTERN PRStatus |
|
138 nssTrustDomain_TraverseCertificatesByNickname |
|
139 ( |
|
140 NSSTrustDomain *td, |
|
141 NSSUTF8 *nickname, |
|
142 PRStatus (*callback)(NSSCertificate *c, void *arg), |
|
143 void *arg |
|
144 ); |
|
145 |
|
146 /* SEC_TraversePermCerts */ |
|
147 NSS_EXTERN PRStatus |
|
148 nssTrustDomain_TraverseCertificates |
|
149 ( |
|
150 NSSTrustDomain *td, |
|
151 PRStatus (*callback)(NSSCertificate *c, void *arg), |
|
152 void *arg |
|
153 ); |
|
154 |
|
155 /* CERT_AddTempCertToPerm */ |
|
156 NSS_EXTERN PRStatus |
|
157 nssTrustDomain_AddTempCertToPerm |
|
158 ( |
|
159 NSSCertificate *c |
|
160 ); |
|
161 |
|
162 PR_END_EXTERN_C |
|
163 |
|
164 #endif /* PKINSS3HACK_H */ |