OLD | NEW |
| (Empty) |
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 _GENAME_H_ | |
6 #define _GENAME_H_ | |
7 | |
8 #include "plarena.h" | |
9 #include "seccomon.h" | |
10 #include "secoidt.h" | |
11 #include "secasn1.h" | |
12 #include "secder.h" | |
13 #include "certt.h" | |
14 | |
15 /************************************************************************/ | |
16 SEC_BEGIN_PROTOS | |
17 | |
18 extern const SEC_ASN1Template CERT_GeneralNamesTemplate[]; | |
19 | |
20 extern SECItem ** | |
21 cert_EncodeGeneralNames(PRArenaPool *arena, CERTGeneralName *names); | |
22 | |
23 extern CERTGeneralName * | |
24 cert_DecodeGeneralNames(PRArenaPool *arena, SECItem **encodedGenName); | |
25 | |
26 extern SECStatus | |
27 cert_DestroyGeneralNames(CERTGeneralName *name); | |
28 | |
29 extern SECStatus | |
30 cert_EncodeNameConstraints(CERTNameConstraints *constraints, PRArenaPool *arena, | |
31 SECItem *dest); | |
32 | |
33 extern CERTNameConstraints * | |
34 cert_DecodeNameConstraints(PRArenaPool *arena, SECItem *encodedConstraints); | |
35 | |
36 extern CERTGeneralName * | |
37 cert_CombineNamesLists(CERTGeneralName *list1, CERTGeneralName *list2); | |
38 | |
39 extern CERTNameConstraint * | |
40 cert_CombineConstraintsLists(CERTNameConstraint *list1, CERTNameConstraint *list
2); | |
41 | |
42 /*********************************************************************/ | |
43 /* A thread safe implementation of General Names */ | |
44 /*********************************************************************/ | |
45 | |
46 /* Destroy a Single CERTGeneralName */ | |
47 void | |
48 CERT_DestroyGeneralName(CERTGeneralName *name); | |
49 | |
50 SECStatus | |
51 CERT_CompareGeneralName(CERTGeneralName *a, CERTGeneralName *b); | |
52 | |
53 SECStatus | |
54 CERT_CopyGeneralName(PRArenaPool *arena, | |
55 CERTGeneralName *dest, | |
56 CERTGeneralName *src); | |
57 | |
58 /* General Name Lists are a thread safe, reference counting layer to | |
59 * general names */ | |
60 | |
61 /* Destroys a CERTGeneralNameList */ | |
62 void | |
63 CERT_DestroyGeneralNameList(CERTGeneralNameList *list); | |
64 | |
65 /* Creates a CERTGeneralNameList */ | |
66 CERTGeneralNameList * | |
67 CERT_CreateGeneralNameList(CERTGeneralName *name); | |
68 | |
69 /* Compares two CERTGeneralNameList */ | |
70 SECStatus | |
71 CERT_CompareGeneralNameLists(CERTGeneralNameList *a, CERTGeneralNameList *b); | |
72 | |
73 /* returns a copy of the first name of the type requested */ | |
74 void * | |
75 CERT_GetGeneralNameFromListByType(CERTGeneralNameList *list, | |
76 CERTGeneralNameType type, | |
77 PRArenaPool *arena); | |
78 | |
79 /* Adds a name to the tail of the list */ | |
80 void | |
81 CERT_AddGeneralNameToList(CERTGeneralNameList *list, | |
82 CERTGeneralNameType type, | |
83 void *data, SECItem *oid); | |
84 | |
85 /* returns a duplicate of the CERTGeneralNameList */ | |
86 CERTGeneralNameList * | |
87 CERT_DupGeneralNameList(CERTGeneralNameList *list); | |
88 | |
89 /* returns the number of CERTGeneralName objects in the doubly linked | |
90 ** list of which *names is a member. | |
91 */ | |
92 extern int | |
93 CERT_GetNamesLength(CERTGeneralName *names); | |
94 | |
95 /************************************************************************/ | |
96 | |
97 SECStatus | |
98 CERT_CompareNameSpace(CERTCertificate *cert, | |
99 CERTGeneralName *namesList, | |
100 CERTCertificate **certsList, | |
101 PRArenaPool *reqArena, | |
102 CERTCertificate **pBadCert); | |
103 | |
104 SEC_END_PROTOS | |
105 | |
106 #endif | |
OLD | NEW |