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