]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_apple_x509_cl/lib/clNameUtils.h
Security-58286.1.32.tar.gz
[apple/security.git] / OSX / libsecurity_apple_x509_cl / lib / clNameUtils.h
1 /*
2 * Copyright (c) 2003,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18 /*
19 * clNameUtils.h - support for Name, GeneralizedName, all sorts of names
20 */
21
22 #ifndef _CL_NAME_UTILS_H_
23 #define _CL_NAME_UTILS_H_
24
25 #include <Security/cssmtype.h>
26 #include <security_utilities/alloc.h>
27 #include <Security/x509defs.h>
28 #include <Security/certextensions.h>
29 #include <Security/X509Templates.h>
30 #include <security_asn1/SecNssCoder.h>
31
32 void CL_nssAtvToCssm(
33 const NSS_ATV &nssObj,
34 CSSM_X509_TYPE_VALUE_PAIR &cssmObj,
35 Allocator &alloc
36 #if !NSS_TAGGED_ITEMS
37 , SecNssCoder &coder
38 #endif
39 );
40 void CL_nssRdnToCssm(
41 const NSS_RDN &nssObj,
42 CSSM_X509_RDN &cssmObj,
43 Allocator &alloc,
44 SecNssCoder &coder);
45 void CL_nssNameToCssm(
46 const NSS_Name &nssObj,
47 CSSM_X509_NAME &cssmObj,
48 Allocator &alloc);
49
50 void CL_cssmAtvToNss(
51 const CSSM_X509_TYPE_VALUE_PAIR &cssmObj,
52 NSS_ATV &nssObj,
53 SecNssCoder &coder);
54 void CL_cssmRdnToNss(
55 const CSSM_X509_RDN &cssmObj,
56 NSS_RDN &nssObj,
57 SecNssCoder &coder);
58 void CL_cssmNameToNss(
59 const CSSM_X509_NAME &cssmObj,
60 NSS_Name &nssObj,
61 SecNssCoder &coder);
62
63 void CL_normalizeString(
64 char *strPtr,
65 int &strLen); // IN/OUT
66 void CL_normalizeX509NameNSS(
67 NSS_Name &nssName,
68 SecNssCoder &coder);
69
70 void CL_nssGeneralNameToCssm(
71 NSS_GeneralName &nssObj,
72 CE_GeneralName &cdsaObj,
73 SecNssCoder &coder, // for temp decoding
74 Allocator &alloc); // destination
75
76 void CL_nssGeneralNamesToCssm(
77 const NSS_GeneralNames &nssObj,
78 CE_GeneralNames &cdsaObj,
79 SecNssCoder &coder, // for temp decoding
80 Allocator &alloc); // destination
81 void CL_cssmGeneralNameToNss(
82 CE_GeneralName &cdsaObj,
83 NSS_GeneralName &nssObj, // actually an NSSTaggedItem
84 SecNssCoder &coder); // for temp decoding
85 void CL_cssmGeneralNamesToNss(
86 const CE_GeneralNames &cdsaObj,
87 NSS_GeneralNames &nssObj,
88 SecNssCoder &coder);
89
90 void clCopyOtherName(
91 const CE_OtherName &src,
92 CE_OtherName &dst,
93 Allocator &alloc);
94
95 void CL_freeAuthorityKeyId(
96 CE_AuthorityKeyID &cdsaObj,
97 Allocator &alloc);
98 void CL_freeCssmGeneralName(
99 CE_GeneralName &genName,
100 Allocator &alloc);
101 void CL_freeCssmGeneralNames(
102 CE_GeneralNames *cdsaObj,
103 Allocator &alloc);
104 void CL_freeCssmDistPointName(
105 CE_DistributionPointName *cssmDpn,
106 Allocator &alloc);
107 void CL_freeCssmDistPoints(
108 CE_CRLDistPointsSyntax *cssmDps,
109 Allocator &alloc);
110 void CL_freeX509Name(
111 CSSM_X509_NAME_PTR x509Name,
112 Allocator &alloc);
113 void CL_freeX509Rdn(
114 CSSM_X509_RDN_PTR rdn,
115 Allocator &alloc);
116 void CL_freeOtherName(
117 CE_OtherName *cssmOther,
118 Allocator &alloc);
119 void CL_freeCssmIssuingDistPoint(
120 CE_IssuingDistributionPoint *cssmIdp,
121 Allocator &alloc);
122
123
124 #endif /* _CL_NAME_UTILS_H_ */