Bug 460926 A11y hierachy is broken on Ubuntu 8.10 (GNOME 2.24), r=Evan.Yan sr=roc
[wine-gecko.git] / security / nss / lib / pki / asymmkey.c
blob717c0df8bbbe2fa9255ec2ea560cfbbd38d9278b
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the Netscape security libraries.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPL"), or
25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
35 * ***** END LICENSE BLOCK ***** */
37 #ifdef DEBUG
38 static const char CVS_ID[] = "@(#) $RCSfile: asymmkey.c,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:48 $";
39 #endif /* DEBUG */
41 #ifndef NSSPKI_H
42 #include "nsspki.h"
43 #endif /* NSSPKI_H */
45 #ifndef BASE_H
46 #include "base.h"
47 #endif /* BASE_H */
49 extern const NSSError NSS_ERROR_NOT_FOUND;
51 NSS_IMPLEMENT PRStatus
52 NSSPrivateKey_Destroy (
53 NSSPrivateKey *vk
56 nss_SetError(NSS_ERROR_NOT_FOUND);
57 return PR_FAILURE;
60 NSS_IMPLEMENT PRStatus
61 NSSPrivateKey_DeleteStoredObject (
62 NSSPrivateKey *vk,
63 NSSCallback *uhh
66 nss_SetError(NSS_ERROR_NOT_FOUND);
67 return PR_FAILURE;
70 NSS_IMPLEMENT PRUint32
71 NSSPrivateKey_GetSignatureLength (
72 NSSPrivateKey *vk
75 nss_SetError(NSS_ERROR_NOT_FOUND);
76 return -1;
79 NSS_IMPLEMENT PRUint32
80 NSSPrivateKey_GetPrivateModulusLength (
81 NSSPrivateKey *vk
84 nss_SetError(NSS_ERROR_NOT_FOUND);
85 return -1;
88 NSS_IMPLEMENT PRBool
89 NSSPrivateKey_IsStillPresent (
90 NSSPrivateKey *vk,
91 PRStatus *statusOpt
94 nss_SetError(NSS_ERROR_NOT_FOUND);
95 return PR_FALSE;
98 NSS_IMPLEMENT NSSItem *
99 NSSPrivateKey_Encode (
100 NSSPrivateKey *vk,
101 NSSAlgorithmAndParameters *ap,
102 NSSItem *passwordOpt, /* NULL will cause a callback; "" for no password */
103 NSSCallback *uhhOpt,
104 NSSItem *rvOpt,
105 NSSArena *arenaOpt
108 nss_SetError(NSS_ERROR_NOT_FOUND);
109 return NULL;
112 NSS_IMPLEMENT NSSTrustDomain *
113 NSSPrivateKey_GetTrustDomain (
114 NSSPrivateKey *vk,
115 PRStatus *statusOpt
118 nss_SetError(NSS_ERROR_NOT_FOUND);
119 return NULL;
122 NSS_IMPLEMENT NSSToken *
123 NSSPrivateKey_GetToken (
124 NSSPrivateKey *vk
127 nss_SetError(NSS_ERROR_NOT_FOUND);
128 return NULL;
131 NSS_IMPLEMENT NSSSlot *
132 NSSPrivateKey_GetSlot (
133 NSSPrivateKey *vk
136 nss_SetError(NSS_ERROR_NOT_FOUND);
137 return NULL;
140 NSS_IMPLEMENT NSSModule *
141 NSSPrivateKey_GetModule (
142 NSSPrivateKey *vk
145 nss_SetError(NSS_ERROR_NOT_FOUND);
146 return NULL;
149 NSS_IMPLEMENT NSSItem *
150 NSSPrivateKey_Decrypt (
151 NSSPrivateKey *vk,
152 NSSAlgorithmAndParameters *apOpt,
153 NSSItem *encryptedData,
154 NSSCallback *uhh,
155 NSSItem *rvOpt,
156 NSSArena *arenaOpt
159 nss_SetError(NSS_ERROR_NOT_FOUND);
160 return NULL;
163 NSS_IMPLEMENT NSSItem *
164 NSSPrivateKey_Sign (
165 NSSPrivateKey *vk,
166 NSSAlgorithmAndParameters *apOpt,
167 NSSItem *data,
168 NSSCallback *uhh,
169 NSSItem *rvOpt,
170 NSSArena *arenaOpt
173 nss_SetError(NSS_ERROR_NOT_FOUND);
174 return NULL;
177 NSS_IMPLEMENT NSSItem *
178 NSSPrivateKey_SignRecover (
179 NSSPrivateKey *vk,
180 NSSAlgorithmAndParameters *apOpt,
181 NSSItem *data,
182 NSSCallback *uhh,
183 NSSItem *rvOpt,
184 NSSArena *arenaOpt
187 nss_SetError(NSS_ERROR_NOT_FOUND);
188 return NULL;
191 NSS_IMPLEMENT NSSSymmetricKey *
192 NSSPrivateKey_UnwrapSymmetricKey (
193 NSSPrivateKey *vk,
194 NSSAlgorithmAndParameters *apOpt,
195 NSSItem *wrappedKey,
196 NSSCallback *uhh
199 nss_SetError(NSS_ERROR_NOT_FOUND);
200 return NULL;
203 NSS_IMPLEMENT NSSSymmetricKey *
204 NSSPrivateKey_DeriveSymmetricKey (
205 NSSPrivateKey *vk,
206 NSSPublicKey *bk,
207 NSSAlgorithmAndParameters *apOpt,
208 NSSOID *target,
209 PRUint32 keySizeOpt, /* zero for best allowed */
210 NSSOperations operations,
211 NSSCallback *uhh
214 nss_SetError(NSS_ERROR_NOT_FOUND);
215 return NULL;
218 NSS_IMPLEMENT NSSPublicKey *
219 NSSPrivateKey_FindPublicKey (
220 NSSPrivateKey *vk
221 /* { don't need the callback here, right? } */
224 nss_SetError(NSS_ERROR_NOT_FOUND);
225 return NULL;
228 NSS_IMPLEMENT NSSCryptoContext *
229 NSSPrivateKey_CreateCryptoContext (
230 NSSPrivateKey *vk,
231 NSSAlgorithmAndParameters *apOpt,
232 NSSCallback *uhh
235 nss_SetError(NSS_ERROR_NOT_FOUND);
236 return NULL;
239 NSS_IMPLEMENT NSSCertificate **
240 NSSPrivateKey_FindCertificates (
241 NSSPrivateKey *vk,
242 NSSCertificate *rvOpt[],
243 PRUint32 maximumOpt, /* 0 for no max */
244 NSSArena *arenaOpt
247 nss_SetError(NSS_ERROR_NOT_FOUND);
248 return NULL;
251 NSS_IMPLEMENT NSSCertificate *
252 NSSPrivateKey_FindBestCertificate (
253 NSSPrivateKey *vk,
254 NSSTime *timeOpt,
255 NSSUsage *usageOpt,
256 NSSPolicies *policiesOpt
259 nss_SetError(NSS_ERROR_NOT_FOUND);
260 return NULL;
263 NSS_IMPLEMENT PRStatus
264 NSSPublicKey_Destroy (
265 NSSPublicKey *bk
268 nss_SetError(NSS_ERROR_NOT_FOUND);
269 return PR_FAILURE;
272 NSS_IMPLEMENT PRStatus
273 NSSPublicKey_DeleteStoredObject (
274 NSSPublicKey *bk,
275 NSSCallback *uhh
278 nss_SetError(NSS_ERROR_NOT_FOUND);
279 return PR_FAILURE;
282 NSS_IMPLEMENT NSSItem *
283 NSSPublicKey_Encode (
284 NSSPublicKey *bk,
285 NSSAlgorithmAndParameters *ap,
286 NSSCallback *uhhOpt,
287 NSSItem *rvOpt,
288 NSSArena *arenaOpt
291 nss_SetError(NSS_ERROR_NOT_FOUND);
292 return NULL;
295 NSS_IMPLEMENT NSSTrustDomain *
296 NSSPublicKey_GetTrustDomain (
297 NSSPublicKey *bk,
298 PRStatus *statusOpt
301 nss_SetError(NSS_ERROR_NOT_FOUND);
302 return NULL;
305 NSS_IMPLEMENT NSSToken *
306 NSSPublicKey_GetToken (
307 NSSPublicKey *bk,
308 PRStatus *statusOpt
311 nss_SetError(NSS_ERROR_NOT_FOUND);
312 return NULL;
315 NSS_IMPLEMENT NSSSlot *
316 NSSPublicKey_GetSlot (
317 NSSPublicKey *bk,
318 PRStatus *statusOpt
321 nss_SetError(NSS_ERROR_NOT_FOUND);
322 return NULL;
325 NSS_IMPLEMENT NSSModule *
326 NSSPublicKey_GetModule (
327 NSSPublicKey *bk,
328 PRStatus *statusOpt
331 nss_SetError(NSS_ERROR_NOT_FOUND);
332 return NULL;
335 NSS_IMPLEMENT NSSItem *
336 NSSPublicKey_Encrypt (
337 NSSPublicKey *bk,
338 NSSAlgorithmAndParameters *apOpt,
339 NSSItem *data,
340 NSSCallback *uhh,
341 NSSItem *rvOpt,
342 NSSArena *arenaOpt
345 nss_SetError(NSS_ERROR_NOT_FOUND);
346 return NULL;
349 NSS_IMPLEMENT PRStatus
350 NSSPublicKey_Verify (
351 NSSPublicKey *bk,
352 NSSAlgorithmAndParameters *apOpt,
353 NSSItem *data,
354 NSSItem *signature,
355 NSSCallback *uhh
358 nss_SetError(NSS_ERROR_NOT_FOUND);
359 return PR_FAILURE;
362 NSS_IMPLEMENT NSSItem *
363 NSSPublicKey_VerifyRecover (
364 NSSPublicKey *bk,
365 NSSAlgorithmAndParameters *apOpt,
366 NSSItem *signature,
367 NSSCallback *uhh,
368 NSSItem *rvOpt,
369 NSSArena *arenaOpt
372 nss_SetError(NSS_ERROR_NOT_FOUND);
373 return NULL;
376 NSS_IMPLEMENT NSSItem *
377 NSSPublicKey_WrapSymmetricKey (
378 NSSPublicKey *bk,
379 NSSAlgorithmAndParameters *apOpt,
380 NSSSymmetricKey *keyToWrap,
381 NSSCallback *uhh,
382 NSSItem *rvOpt,
383 NSSArena *arenaOpt
386 nss_SetError(NSS_ERROR_NOT_FOUND);
387 return NULL;
390 NSS_IMPLEMENT NSSCryptoContext *
391 NSSPublicKey_CreateCryptoContext (
392 NSSPublicKey *bk,
393 NSSAlgorithmAndParameters *apOpt,
394 NSSCallback *uhh
397 nss_SetError(NSS_ERROR_NOT_FOUND);
398 return NULL;
401 NSS_IMPLEMENT NSSCertificate **
402 NSSPublicKey_FindCertificates (
403 NSSPublicKey *bk,
404 NSSCertificate *rvOpt[],
405 PRUint32 maximumOpt, /* 0 for no max */
406 NSSArena *arenaOpt
409 nss_SetError(NSS_ERROR_NOT_FOUND);
410 return NULL;
413 NSS_IMPLEMENT NSSCertificate *
414 NSSPublicKey_FindBestCertificate (
415 NSSPublicKey *bk,
416 NSSTime *timeOpt,
417 NSSUsage *usageOpt,
418 NSSPolicies *policiesOpt
421 nss_SetError(NSS_ERROR_NOT_FOUND);
422 return NULL;
425 NSS_IMPLEMENT NSSPrivateKey *
426 NSSPublicKey_FindPrivateKey (
427 NSSPublicKey *bk,
428 NSSCallback *uhh
431 nss_SetError(NSS_ERROR_NOT_FOUND);
432 return NULL;