Mercurial > trustbridge > nss-cmake-static
comparison nss/lib/dev/dev.h @ 0:1e5118fa0cb1
This is NSS with a Cmake Buildsyste
To compile a static NSS library for Windows we've used the
Chromium-NSS fork and added a Cmake buildsystem to compile
it statically for Windows. See README.chromium for chromium
changes and README.trustbridge for our modifications.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 28 Jul 2014 10:47:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1e5118fa0cb1 |
---|---|
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 DEV_H | |
6 #define DEV_H | |
7 | |
8 /* | |
9 * dev.h | |
10 * | |
11 * Low-level methods for interaction with cryptoki devices | |
12 */ | |
13 | |
14 #ifndef NSSDEV_H | |
15 #include "nssdev.h" | |
16 #endif /* NSSDEV_H */ | |
17 | |
18 #ifndef DEVT_H | |
19 #include "devt.h" | |
20 #endif /* DEVT_H */ | |
21 | |
22 PR_BEGIN_EXTERN_C | |
23 | |
24 /* the global module list | |
25 * | |
26 * These functions are for managing the global set of modules. Trust Domains, | |
27 * etc., will draw from this set. These functions are completely internal | |
28 * and only invoked when there are changes to the global module state | |
29 * (load or unload). | |
30 * | |
31 * nss_InitializeGlobalModuleList | |
32 * nss_DestroyGlobalModuleList | |
33 * nss_GetLoadedModules | |
34 * | |
35 * nssGlobalModuleList_Add | |
36 * nssGlobalModuleList_Remove | |
37 * nssGlobalModuleList_FindModuleByName | |
38 * nssGlobalModuleList_FindSlotByName | |
39 * nssGlobalModuleList_FindTokenByName | |
40 */ | |
41 | |
42 NSS_EXTERN PRStatus | |
43 nss_InitializeGlobalModuleList | |
44 ( | |
45 void | |
46 ); | |
47 | |
48 NSS_EXTERN PRStatus | |
49 nss_DestroyGlobalModuleList | |
50 ( | |
51 void | |
52 ); | |
53 | |
54 NSS_EXTERN NSSModule ** | |
55 nss_GetLoadedModules | |
56 ( | |
57 void | |
58 ); | |
59 | |
60 NSS_EXTERN PRStatus | |
61 nssGlobalModuleList_Add | |
62 ( | |
63 NSSModule *module | |
64 ); | |
65 | |
66 NSS_EXTERN PRStatus | |
67 nssGlobalModuleList_Remove | |
68 ( | |
69 NSSModule *module | |
70 ); | |
71 | |
72 NSS_EXTERN NSSModule * | |
73 nssGlobalModuleList_FindModuleByName | |
74 ( | |
75 NSSUTF8 *moduleName | |
76 ); | |
77 | |
78 NSS_EXTERN NSSSlot * | |
79 nssGlobalModuleList_FindSlotByName | |
80 ( | |
81 NSSUTF8 *slotName | |
82 ); | |
83 | |
84 NSS_EXTERN NSSToken * | |
85 nssGlobalModuleList_FindTokenByName | |
86 ( | |
87 NSSUTF8 *tokenName | |
88 ); | |
89 | |
90 NSS_EXTERN NSSToken * | |
91 nss_GetDefaultCryptoToken | |
92 ( | |
93 void | |
94 ); | |
95 | |
96 NSS_EXTERN NSSToken * | |
97 nss_GetDefaultDatabaseToken | |
98 ( | |
99 void | |
100 ); | |
101 | |
102 /* | |
103 * |-----------|<---> NSSSlot <--> NSSToken | |
104 * | NSSModule |<---> NSSSlot <--> NSSToken | |
105 * |-----------|<---> NSSSlot <--> NSSToken | |
106 */ | |
107 | |
108 /* NSSModule | |
109 * | |
110 * nssModule_Create | |
111 * nssModule_CreateFromSpec | |
112 * nssModule_AddRef | |
113 * nssModule_GetName | |
114 * nssModule_GetSlots | |
115 * nssModule_FindSlotByName | |
116 * nssModule_FindTokenByName | |
117 * nssModule_GetCertOrder | |
118 */ | |
119 | |
120 NSS_EXTERN NSSModule * | |
121 nssModule_Create | |
122 ( | |
123 NSSUTF8 *moduleOpt, | |
124 NSSUTF8 *uriOpt, | |
125 NSSUTF8 *opaqueOpt, | |
126 void *reserved | |
127 ); | |
128 | |
129 /* This is to use the new loading mechanism. */ | |
130 NSS_EXTERN NSSModule * | |
131 nssModule_CreateFromSpec | |
132 ( | |
133 NSSUTF8 *moduleSpec, | |
134 NSSModule *parent, | |
135 PRBool loadSubModules | |
136 ); | |
137 | |
138 NSS_EXTERN PRStatus | |
139 nssModule_Destroy | |
140 ( | |
141 NSSModule *mod | |
142 ); | |
143 | |
144 NSS_EXTERN NSSModule * | |
145 nssModule_AddRef | |
146 ( | |
147 NSSModule *mod | |
148 ); | |
149 | |
150 NSS_EXTERN NSSUTF8 * | |
151 nssModule_GetName | |
152 ( | |
153 NSSModule *mod | |
154 ); | |
155 | |
156 NSS_EXTERN NSSSlot ** | |
157 nssModule_GetSlots | |
158 ( | |
159 NSSModule *mod | |
160 ); | |
161 | |
162 NSS_EXTERN NSSSlot * | |
163 nssModule_FindSlotByName | |
164 ( | |
165 NSSModule *mod, | |
166 NSSUTF8 *slotName | |
167 ); | |
168 | |
169 NSS_EXTERN NSSToken * | |
170 nssModule_FindTokenByName | |
171 ( | |
172 NSSModule *mod, | |
173 NSSUTF8 *tokenName | |
174 ); | |
175 | |
176 NSS_EXTERN PRInt32 | |
177 nssModule_GetCertOrder | |
178 ( | |
179 NSSModule *module | |
180 ); | |
181 | |
182 /* NSSSlot | |
183 * | |
184 * nssSlot_Destroy | |
185 * nssSlot_AddRef | |
186 * nssSlot_GetName | |
187 * nssSlot_GetTokenName | |
188 * nssSlot_IsTokenPresent | |
189 * nssSlot_IsPermanent | |
190 * nssSlot_IsFriendly | |
191 * nssSlot_IsHardware | |
192 * nssSlot_Refresh | |
193 * nssSlot_GetModule | |
194 * nssSlot_GetToken | |
195 * nssSlot_Login | |
196 * nssSlot_Logout | |
197 * nssSlot_SetPassword | |
198 * nssSlot_CreateSession | |
199 */ | |
200 | |
201 NSS_EXTERN PRStatus | |
202 nssSlot_Destroy | |
203 ( | |
204 NSSSlot *slot | |
205 ); | |
206 | |
207 NSS_EXTERN NSSSlot * | |
208 nssSlot_AddRef | |
209 ( | |
210 NSSSlot *slot | |
211 ); | |
212 | |
213 NSS_EXTERN void | |
214 nssSlot_ResetDelay | |
215 ( | |
216 NSSSlot *slot | |
217 ); | |
218 | |
219 NSS_EXTERN NSSUTF8 * | |
220 nssSlot_GetName | |
221 ( | |
222 NSSSlot *slot | |
223 ); | |
224 | |
225 NSS_EXTERN NSSUTF8 * | |
226 nssSlot_GetTokenName | |
227 ( | |
228 NSSSlot *slot | |
229 ); | |
230 | |
231 NSS_EXTERN NSSModule * | |
232 nssSlot_GetModule | |
233 ( | |
234 NSSSlot *slot | |
235 ); | |
236 | |
237 NSS_EXTERN NSSToken * | |
238 nssSlot_GetToken | |
239 ( | |
240 NSSSlot *slot | |
241 ); | |
242 | |
243 NSS_EXTERN PRBool | |
244 nssSlot_IsTokenPresent | |
245 ( | |
246 NSSSlot *slot | |
247 ); | |
248 | |
249 NSS_EXTERN PRBool | |
250 nssSlot_IsPermanent | |
251 ( | |
252 NSSSlot *slot | |
253 ); | |
254 | |
255 NSS_EXTERN PRBool | |
256 nssSlot_IsFriendly | |
257 ( | |
258 NSSSlot *slot | |
259 ); | |
260 | |
261 NSS_EXTERN PRBool | |
262 nssSlot_IsHardware | |
263 ( | |
264 NSSSlot *slot | |
265 ); | |
266 | |
267 NSS_EXTERN PRBool | |
268 nssSlot_IsLoggedIn | |
269 ( | |
270 NSSSlot *slot | |
271 ); | |
272 | |
273 NSS_EXTERN PRStatus | |
274 nssSlot_Refresh | |
275 ( | |
276 NSSSlot *slot | |
277 ); | |
278 | |
279 NSS_EXTERN PRStatus | |
280 nssSlot_Login | |
281 ( | |
282 NSSSlot *slot, | |
283 NSSCallback *pwcb | |
284 ); | |
285 extern const NSSError NSS_ERROR_INVALID_PASSWORD; | |
286 extern const NSSError NSS_ERROR_USER_CANCELED; | |
287 | |
288 NSS_EXTERN PRStatus | |
289 nssSlot_Logout | |
290 ( | |
291 NSSSlot *slot, | |
292 nssSession *sessionOpt | |
293 ); | |
294 | |
295 NSS_EXTERN void | |
296 nssSlot_EnterMonitor | |
297 ( | |
298 NSSSlot *slot | |
299 ); | |
300 | |
301 NSS_EXTERN void | |
302 nssSlot_ExitMonitor | |
303 ( | |
304 NSSSlot *slot | |
305 ); | |
306 | |
307 #define NSSSLOT_ASK_PASSWORD_FIRST_TIME -1 | |
308 #define NSSSLOT_ASK_PASSWORD_EVERY_TIME 0 | |
309 NSS_EXTERN void | |
310 nssSlot_SetPasswordDefaults | |
311 ( | |
312 NSSSlot *slot, | |
313 PRInt32 askPasswordTimeout | |
314 ); | |
315 | |
316 NSS_EXTERN PRStatus | |
317 nssSlot_SetPassword | |
318 ( | |
319 NSSSlot *slot, | |
320 NSSUTF8 *oldPasswordOpt, | |
321 NSSUTF8 *newPassword | |
322 ); | |
323 extern const NSSError NSS_ERROR_INVALID_PASSWORD; | |
324 extern const NSSError NSS_ERROR_USER_CANCELED; | |
325 | |
326 /* | |
327 * nssSlot_IsLoggedIn | |
328 */ | |
329 | |
330 NSS_EXTERN nssSession * | |
331 nssSlot_CreateSession | |
332 ( | |
333 NSSSlot *slot, | |
334 NSSArena *arenaOpt, | |
335 PRBool readWrite /* so far, this is the only flag used */ | |
336 ); | |
337 | |
338 /* NSSToken | |
339 * | |
340 * nssToken_Destroy | |
341 * nssToken_AddRef | |
342 * nssToken_GetName | |
343 * nssToken_GetModule | |
344 * nssToken_GetSlot | |
345 * nssToken_NeedsPINInitialization | |
346 * nssToken_ImportCertificate | |
347 * nssToken_ImportTrust | |
348 * nssToken_ImportCRL | |
349 * nssToken_GenerateKeyPair | |
350 * nssToken_GenerateSymmetricKey | |
351 * nssToken_DeleteStoredObject | |
352 * nssToken_FindObjects | |
353 * nssToken_FindCertificatesBySubject | |
354 * nssToken_FindCertificatesByNickname | |
355 * nssToken_FindCertificatesByEmail | |
356 * nssToken_FindCertificateByIssuerAndSerialNumber | |
357 * nssToken_FindCertificateByEncodedCertificate | |
358 * nssToken_FindTrustForCertificate | |
359 * nssToken_FindCRLsBySubject | |
360 * nssToken_FindPrivateKeys | |
361 * nssToken_FindPrivateKeyByID | |
362 * nssToken_Digest | |
363 * nssToken_BeginDigest | |
364 * nssToken_ContinueDigest | |
365 * nssToken_FinishDigest | |
366 */ | |
367 | |
368 NSS_EXTERN PRStatus | |
369 nssToken_Destroy | |
370 ( | |
371 NSSToken *tok | |
372 ); | |
373 | |
374 NSS_EXTERN NSSToken * | |
375 nssToken_AddRef | |
376 ( | |
377 NSSToken *tok | |
378 ); | |
379 | |
380 NSS_EXTERN NSSUTF8 * | |
381 nssToken_GetName | |
382 ( | |
383 NSSToken *tok | |
384 ); | |
385 | |
386 NSS_EXTERN NSSModule * | |
387 nssToken_GetModule | |
388 ( | |
389 NSSToken *token | |
390 ); | |
391 | |
392 NSS_EXTERN NSSSlot * | |
393 nssToken_GetSlot | |
394 ( | |
395 NSSToken *tok | |
396 ); | |
397 | |
398 NSS_EXTERN PRBool | |
399 nssToken_NeedsPINInitialization | |
400 ( | |
401 NSSToken *token | |
402 ); | |
403 | |
404 NSS_EXTERN nssCryptokiObject * | |
405 nssToken_ImportCertificate | |
406 ( | |
407 NSSToken *tok, | |
408 nssSession *sessionOpt, | |
409 NSSCertificateType certType, | |
410 NSSItem *id, | |
411 const NSSUTF8 *nickname, | |
412 NSSDER *encoding, | |
413 NSSDER *issuer, | |
414 NSSDER *subject, | |
415 NSSDER *serial, | |
416 NSSASCII7 *emailAddr, | |
417 PRBool asTokenObject | |
418 ); | |
419 | |
420 NSS_EXTERN nssCryptokiObject * | |
421 nssToken_ImportTrust | |
422 ( | |
423 NSSToken *tok, | |
424 nssSession *sessionOpt, | |
425 NSSDER *certEncoding, | |
426 NSSDER *certIssuer, | |
427 NSSDER *certSerial, | |
428 nssTrustLevel serverAuth, | |
429 nssTrustLevel clientAuth, | |
430 nssTrustLevel codeSigning, | |
431 nssTrustLevel emailProtection, | |
432 PRBool stepUpApproved, | |
433 PRBool asTokenObject | |
434 ); | |
435 | |
436 NSS_EXTERN nssCryptokiObject * | |
437 nssToken_ImportCRL | |
438 ( | |
439 NSSToken *token, | |
440 nssSession *sessionOpt, | |
441 NSSDER *subject, | |
442 NSSDER *encoding, | |
443 PRBool isKRL, | |
444 NSSUTF8 *url, | |
445 PRBool asTokenObject | |
446 ); | |
447 | |
448 /* Permanently remove an object from the token. */ | |
449 NSS_EXTERN PRStatus | |
450 nssToken_DeleteStoredObject | |
451 ( | |
452 nssCryptokiObject *instance | |
453 ); | |
454 | |
455 NSS_EXTERN nssCryptokiObject ** | |
456 nssToken_FindObjects | |
457 ( | |
458 NSSToken *token, | |
459 nssSession *sessionOpt, | |
460 CK_OBJECT_CLASS objclass, | |
461 nssTokenSearchType searchType, | |
462 PRUint32 maximumOpt, | |
463 PRStatus *statusOpt | |
464 ); | |
465 | |
466 NSS_EXTERN nssCryptokiObject ** | |
467 nssToken_FindCertificatesBySubject | |
468 ( | |
469 NSSToken *token, | |
470 nssSession *sessionOpt, | |
471 NSSDER *subject, | |
472 nssTokenSearchType searchType, | |
473 PRUint32 maximumOpt, | |
474 PRStatus *statusOpt | |
475 ); | |
476 | |
477 NSS_EXTERN nssCryptokiObject ** | |
478 nssToken_FindCertificatesByNickname | |
479 ( | |
480 NSSToken *token, | |
481 nssSession *sessionOpt, | |
482 const NSSUTF8 *name, | |
483 nssTokenSearchType searchType, | |
484 PRUint32 maximumOpt, | |
485 PRStatus *statusOpt | |
486 ); | |
487 | |
488 NSS_EXTERN nssCryptokiObject ** | |
489 nssToken_FindCertificatesByEmail | |
490 ( | |
491 NSSToken *token, | |
492 nssSession *sessionOpt, | |
493 NSSASCII7 *email, | |
494 nssTokenSearchType searchType, | |
495 PRUint32 maximumOpt, | |
496 PRStatus *statusOpt | |
497 ); | |
498 | |
499 NSS_EXTERN nssCryptokiObject ** | |
500 nssToken_FindCertificatesByID | |
501 ( | |
502 NSSToken *token, | |
503 nssSession *sessionOpt, | |
504 NSSItem *id, | |
505 nssTokenSearchType searchType, | |
506 PRUint32 maximumOpt, | |
507 PRStatus *statusOpt | |
508 ); | |
509 | |
510 NSS_EXTERN nssCryptokiObject * | |
511 nssToken_FindCertificateByIssuerAndSerialNumber | |
512 ( | |
513 NSSToken *token, | |
514 nssSession *sessionOpt, | |
515 NSSDER *issuer, | |
516 NSSDER *serial, | |
517 nssTokenSearchType searchType, | |
518 PRStatus *statusOpt | |
519 ); | |
520 | |
521 NSS_EXTERN nssCryptokiObject * | |
522 nssToken_FindCertificateByEncodedCertificate | |
523 ( | |
524 NSSToken *token, | |
525 nssSession *sessionOpt, | |
526 NSSBER *encodedCertificate, | |
527 nssTokenSearchType searchType, | |
528 PRStatus *statusOpt | |
529 ); | |
530 | |
531 NSS_EXTERN nssCryptokiObject * | |
532 nssToken_FindTrustForCertificate | |
533 ( | |
534 NSSToken *token, | |
535 nssSession *sessionOpt, | |
536 NSSDER *certEncoding, | |
537 NSSDER *certIssuer, | |
538 NSSDER *certSerial, | |
539 nssTokenSearchType searchType | |
540 ); | |
541 | |
542 NSS_EXTERN nssCryptokiObject ** | |
543 nssToken_FindCRLsBySubject | |
544 ( | |
545 NSSToken *token, | |
546 nssSession *sessionOpt, | |
547 NSSDER *subject, | |
548 nssTokenSearchType searchType, | |
549 PRUint32 maximumOpt, | |
550 PRStatus *statusOpt | |
551 ); | |
552 | |
553 NSS_EXTERN nssCryptokiObject ** | |
554 nssToken_FindPrivateKeys | |
555 ( | |
556 NSSToken *token, | |
557 nssSession *sessionOpt, | |
558 nssTokenSearchType searchType, | |
559 PRUint32 maximumOpt, | |
560 PRStatus *statusOpt | |
561 ); | |
562 | |
563 NSS_EXTERN nssCryptokiObject * | |
564 nssToken_FindPrivateKeyByID | |
565 ( | |
566 NSSToken *token, | |
567 nssSession *sessionOpt, | |
568 NSSItem *keyID | |
569 ); | |
570 | |
571 NSS_EXTERN nssCryptokiObject * | |
572 nssToken_FindPublicKeyByID | |
573 ( | |
574 NSSToken *token, | |
575 nssSession *sessionOpt, | |
576 NSSItem *keyID | |
577 ); | |
578 | |
579 NSS_EXTERN NSSItem * | |
580 nssToken_Digest | |
581 ( | |
582 NSSToken *tok, | |
583 nssSession *sessionOpt, | |
584 NSSAlgorithmAndParameters *ap, | |
585 NSSItem *data, | |
586 NSSItem *rvOpt, | |
587 NSSArena *arenaOpt | |
588 ); | |
589 | |
590 NSS_EXTERN PRStatus | |
591 nssToken_BeginDigest | |
592 ( | |
593 NSSToken *tok, | |
594 nssSession *sessionOpt, | |
595 NSSAlgorithmAndParameters *ap | |
596 ); | |
597 | |
598 NSS_EXTERN PRStatus | |
599 nssToken_ContinueDigest | |
600 ( | |
601 NSSToken *tok, | |
602 nssSession *sessionOpt, | |
603 NSSItem *item | |
604 ); | |
605 | |
606 NSS_EXTERN NSSItem * | |
607 nssToken_FinishDigest | |
608 ( | |
609 NSSToken *tok, | |
610 nssSession *sessionOpt, | |
611 NSSItem *rvOpt, | |
612 NSSArena *arenaOpt | |
613 ); | |
614 | |
615 /* nssSession | |
616 * | |
617 * nssSession_Destroy | |
618 * nssSession_EnterMonitor | |
619 * nssSession_ExitMonitor | |
620 * nssSession_IsReadWrite | |
621 */ | |
622 | |
623 NSS_EXTERN PRStatus | |
624 nssSession_Destroy | |
625 ( | |
626 nssSession *s | |
627 ); | |
628 | |
629 /* would like to inline */ | |
630 NSS_EXTERN PRStatus | |
631 nssSession_EnterMonitor | |
632 ( | |
633 nssSession *s | |
634 ); | |
635 | |
636 /* would like to inline */ | |
637 NSS_EXTERN PRStatus | |
638 nssSession_ExitMonitor | |
639 ( | |
640 nssSession *s | |
641 ); | |
642 | |
643 /* would like to inline */ | |
644 NSS_EXTERN PRBool | |
645 nssSession_IsReadWrite | |
646 ( | |
647 nssSession *s | |
648 ); | |
649 | |
650 /* nssCryptokiObject | |
651 * | |
652 * An object living on a cryptoki token. | |
653 * Not really proper to mix up the object types just because | |
654 * nssCryptokiObject itself is generic, but doing so anyway. | |
655 * | |
656 * nssCryptokiObject_Destroy | |
657 * nssCryptokiObject_Equal | |
658 * nssCryptokiObject_Clone | |
659 * nssCryptokiCertificate_GetAttributes | |
660 * nssCryptokiPrivateKey_GetAttributes | |
661 * nssCryptokiPublicKey_GetAttributes | |
662 * nssCryptokiTrust_GetAttributes | |
663 * nssCryptokiCRL_GetAttributes | |
664 */ | |
665 | |
666 NSS_EXTERN void | |
667 nssCryptokiObject_Destroy | |
668 ( | |
669 nssCryptokiObject *object | |
670 ); | |
671 | |
672 NSS_EXTERN PRBool | |
673 nssCryptokiObject_Equal | |
674 ( | |
675 nssCryptokiObject *object1, | |
676 nssCryptokiObject *object2 | |
677 ); | |
678 | |
679 NSS_EXTERN nssCryptokiObject * | |
680 nssCryptokiObject_Clone | |
681 ( | |
682 nssCryptokiObject *object | |
683 ); | |
684 | |
685 NSS_EXTERN PRStatus | |
686 nssCryptokiCertificate_GetAttributes | |
687 ( | |
688 nssCryptokiObject *object, | |
689 nssSession *sessionOpt, | |
690 NSSArena *arenaOpt, | |
691 NSSCertificateType *certTypeOpt, | |
692 NSSItem *idOpt, | |
693 NSSDER *encodingOpt, | |
694 NSSDER *issuerOpt, | |
695 NSSDER *serialOpt, | |
696 NSSDER *subjectOpt | |
697 ); | |
698 | |
699 NSS_EXTERN PRStatus | |
700 nssCryptokiTrust_GetAttributes | |
701 ( | |
702 nssCryptokiObject *trustObject, | |
703 nssSession *sessionOpt, | |
704 NSSItem *sha1_hash, | |
705 nssTrustLevel *serverAuth, | |
706 nssTrustLevel *clientAuth, | |
707 nssTrustLevel *codeSigning, | |
708 nssTrustLevel *emailProtection, | |
709 PRBool *stepUpApproved | |
710 ); | |
711 | |
712 NSS_EXTERN PRStatus | |
713 nssCryptokiCRL_GetAttributes | |
714 ( | |
715 nssCryptokiObject *crlObject, | |
716 nssSession *sessionOpt, | |
717 NSSArena *arenaOpt, | |
718 NSSItem *encodingOpt, | |
719 NSSItem * subjectOpt, | |
720 CK_ULONG * crl_class, | |
721 NSSUTF8 **urlOpt, | |
722 PRBool *isKRLOpt | |
723 ); | |
724 | |
725 /* I'm including this to handle import of certificates in NSS 3.5. This | |
726 * function will set the cert-related attributes of a key, in order to | |
727 * associate it with a cert. Does it stay like this for 4.0? | |
728 */ | |
729 NSS_EXTERN PRStatus | |
730 nssCryptokiPrivateKey_SetCertificate | |
731 ( | |
732 nssCryptokiObject *keyObject, | |
733 nssSession *sessionOpt, | |
734 const NSSUTF8 *nickname, | |
735 NSSItem *id, | |
736 NSSDER *subject | |
737 ); | |
738 | |
739 NSS_EXTERN void | |
740 nssModuleArray_Destroy | |
741 ( | |
742 NSSModule **modules | |
743 ); | |
744 | |
745 /* nssSlotArray | |
746 * | |
747 * nssSlotArray_Destroy | |
748 */ | |
749 | |
750 NSS_EXTERN void | |
751 nssSlotArray_Destroy | |
752 ( | |
753 NSSSlot **slots | |
754 ); | |
755 | |
756 /* nssTokenArray | |
757 * | |
758 * nssTokenArray_Destroy | |
759 */ | |
760 | |
761 NSS_EXTERN void | |
762 nssTokenArray_Destroy | |
763 ( | |
764 NSSToken **tokens | |
765 ); | |
766 | |
767 /* nssCryptokiObjectArray | |
768 * | |
769 * nssCryptokiObjectArray_Destroy | |
770 */ | |
771 NSS_EXTERN void | |
772 nssCryptokiObjectArray_Destroy | |
773 ( | |
774 nssCryptokiObject **object | |
775 ); | |
776 | |
777 /* nssSlotList | |
778 * | |
779 * An ordered list of slots. The order can be anything, it is set in the | |
780 * Add methods. Perhaps it should be CreateInCertOrder, ...? | |
781 * | |
782 * nssSlotList_Create | |
783 * nssSlotList_Destroy | |
784 * nssSlotList_Add | |
785 * nssSlotList_AddModuleSlots | |
786 * nssSlotList_GetSlots | |
787 * nssSlotList_FindSlotByName | |
788 * nssSlotList_FindTokenByName | |
789 * nssSlotList_GetBestSlot | |
790 * nssSlotList_GetBestSlotForAlgorithmAndParameters | |
791 * nssSlotList_GetBestSlotForAlgorithmsAndParameters | |
792 */ | |
793 | |
794 /* nssSlotList_Create | |
795 */ | |
796 NSS_EXTERN nssSlotList * | |
797 nssSlotList_Create | |
798 ( | |
799 NSSArena *arenaOpt | |
800 ); | |
801 | |
802 /* nssSlotList_Destroy | |
803 */ | |
804 NSS_EXTERN void | |
805 nssSlotList_Destroy | |
806 ( | |
807 nssSlotList *slotList | |
808 ); | |
809 | |
810 /* nssSlotList_Add | |
811 * | |
812 * Add the given slot in the given order. | |
813 */ | |
814 NSS_EXTERN PRStatus | |
815 nssSlotList_Add | |
816 ( | |
817 nssSlotList *slotList, | |
818 NSSSlot *slot, | |
819 PRUint32 order | |
820 ); | |
821 | |
822 /* nssSlotList_AddModuleSlots | |
823 * | |
824 * Add all slots in the module, in the given order (the slots will have | |
825 * equal weight). | |
826 */ | |
827 NSS_EXTERN PRStatus | |
828 nssSlotList_AddModuleSlots | |
829 ( | |
830 nssSlotList *slotList, | |
831 NSSModule *module, | |
832 PRUint32 order | |
833 ); | |
834 | |
835 /* nssSlotList_GetSlots | |
836 */ | |
837 NSS_EXTERN NSSSlot ** | |
838 nssSlotList_GetSlots | |
839 ( | |
840 nssSlotList *slotList | |
841 ); | |
842 | |
843 /* nssSlotList_FindSlotByName | |
844 */ | |
845 NSS_EXTERN NSSSlot * | |
846 nssSlotList_FindSlotByName | |
847 ( | |
848 nssSlotList *slotList, | |
849 NSSUTF8 *slotName | |
850 ); | |
851 | |
852 /* nssSlotList_FindTokenByName | |
853 */ | |
854 NSS_EXTERN NSSToken * | |
855 nssSlotList_FindTokenByName | |
856 ( | |
857 nssSlotList *slotList, | |
858 NSSUTF8 *tokenName | |
859 ); | |
860 | |
861 /* nssSlotList_GetBestSlot | |
862 * | |
863 * The best slot is the highest ranking in order, i.e., the first in the | |
864 * list. | |
865 */ | |
866 NSS_EXTERN NSSSlot * | |
867 nssSlotList_GetBestSlot | |
868 ( | |
869 nssSlotList *slotList | |
870 ); | |
871 | |
872 /* nssSlotList_GetBestSlotForAlgorithmAndParameters | |
873 * | |
874 * Highest-ranking slot than can handle algorithm/parameters. | |
875 */ | |
876 NSS_EXTERN NSSSlot * | |
877 nssSlotList_GetBestSlotForAlgorithmAndParameters | |
878 ( | |
879 nssSlotList *slotList, | |
880 NSSAlgorithmAndParameters *ap | |
881 ); | |
882 | |
883 /* nssSlotList_GetBestSlotForAlgorithmsAndParameters | |
884 * | |
885 * Highest-ranking slot than can handle all algorithms/parameters. | |
886 */ | |
887 NSS_EXTERN NSSSlot * | |
888 nssSlotList_GetBestSlotForAlgorithmsAndParameters | |
889 ( | |
890 nssSlotList *slotList, | |
891 NSSAlgorithmAndParameters **ap | |
892 ); | |
893 | |
894 NSS_EXTERN PRBool | |
895 nssToken_IsPresent | |
896 ( | |
897 NSSToken *token | |
898 ); | |
899 | |
900 NSS_EXTERN nssSession * | |
901 nssToken_GetDefaultSession | |
902 ( | |
903 NSSToken *token | |
904 ); | |
905 | |
906 NSS_EXTERN PRStatus | |
907 nssToken_GetTrustOrder | |
908 ( | |
909 NSSToken *tok | |
910 ); | |
911 | |
912 NSS_EXTERN PRStatus | |
913 nssToken_NotifyCertsNotVisible | |
914 ( | |
915 NSSToken *tok | |
916 ); | |
917 | |
918 NSS_EXTERN PRStatus | |
919 nssToken_TraverseCertificates | |
920 ( | |
921 NSSToken *token, | |
922 nssSession *sessionOpt, | |
923 nssTokenSearchType searchType, | |
924 PRStatus (* callback)(nssCryptokiObject *instance, void *arg), | |
925 void *arg | |
926 ); | |
927 | |
928 NSS_EXTERN PRBool | |
929 nssToken_IsPrivateKeyAvailable | |
930 ( | |
931 NSSToken *token, | |
932 NSSCertificate *c, | |
933 nssCryptokiObject *instance | |
934 ); | |
935 | |
936 PR_END_EXTERN_C | |
937 | |
938 #endif /* DEV_H */ |