xref: /freebsd/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__name.html (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3<title>Heimdalx509library: hx509 name functions</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<p>
8<a href="http://www.h5l.org/"><img src="http://www.h5l.org/keyhole-heimdal.png" alt="keyhole logo"/></a>
9</p>
10<!-- end of header marker -->
11<!-- Generated by Doxygen 1.5.6 -->
12<div class="navigation" id="top">
13  <div class="tabs">
14    <ul>
15      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
16      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
17      <li><a href="modules.html"><span>Modules</span></a></li>
18    </ul>
19  </div>
20</div>
21<div class="contents">
22<h1>hx509 name functions</h1><table border="0" cellpadding="0" cellspacing="0">
23<tr><td></td></tr>
24<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
25<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g1bd74b34e0aa88b083678ba231d38718">hx509_name_to_string</a> (const hx509_name name, char **str)</td></tr>
26
27<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#gbd49c49301d601bc53371b867a7eac54">hx509_name_cmp</a> (hx509_name n1, hx509_name n2)</td></tr>
28
29<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g0565f607a4e57d0911ee7081ad9548c5">hx509_parse_name</a> (hx509_context context, const char *str, hx509_name *name)</td></tr>
30
31<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#gcf9b6bfcdd810bed71e98f7e04d918ca">hx509_name_copy</a> (hx509_context context, const hx509_name from, hx509_name *to)</td></tr>
32
33<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g6e65dc67aa48bb87e4fb98ecfe512fbd">hx509_name_to_Name</a> (const hx509_name from, Name *to)</td></tr>
34
35<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g42015083c70b6aa29c4f082998dbbece">hx509_name_expand</a> (hx509_context context, hx509_name name, hx509_env env)</td></tr>
36
37<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#gaf351931efb02fc7aea736af9977155e">hx509_name_free</a> (hx509_name *name)</td></tr>
38
39<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#gf8f73e0a75da2189b1815d8c968750df">hx509_unparse_der_name</a> (const void *data, size_t length, char **str)</td></tr>
40
41<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g1838777e576422c1cb17093bbf7fa018">hx509_name_binary</a> (const hx509_name name, heim_octet_string *os)</td></tr>
42
43<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g4f6715dcabbbcb5d48512e504eae8352">hx509_name_is_null_p</a> (const hx509_name name)</td></tr>
44
45<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#g678a0bf7676746ea1827efe951042f1e">hx509_general_name_unparse</a> (GeneralName *name, char **str)</td></tr>
46
47</table>
48<hr><a name="_details"></a><h2>Detailed Description</h2>
49See the <a class="el" href="page_name.html">PKIX/X.509 Names</a> for description and examples. <hr><h2>Function Documentation</h2>
50<a class="anchor" name="g678a0bf7676746ea1827efe951042f1e"></a><!-- doxytag: member="name.c::hx509_general_name_unparse" ref="g678a0bf7676746ea1827efe951042f1e" args="(GeneralName *name, char **str)" -->
51<div class="memitem">
52<div class="memproto">
53      <table class="memname">
54        <tr>
55          <td class="memname">int hx509_general_name_unparse           </td>
56          <td>(</td>
57          <td class="paramtype">GeneralName *&nbsp;</td>
58          <td class="paramname"> <em>name</em>, </td>
59        </tr>
60        <tr>
61          <td class="paramkey"></td>
62          <td></td>
63          <td class="paramtype">char **&nbsp;</td>
64          <td class="paramname"> <em>str</em></td><td>&nbsp;</td>
65        </tr>
66        <tr>
67          <td></td>
68          <td>)</td>
69          <td></td><td></td><td></td>
70        </tr>
71      </table>
72</div>
73<div class="memdoc">
74
75<p>
76Unparse the hx509 name in name into a string.<p>
77<dl compact><dt><b>Parameters:</b></dt><dd>
78  <table border="0" cellspacing="2" cellpadding="0">
79    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name to print </td></tr>
80    <tr><td valign="top"></td><td valign="top"><em>str</em>&nbsp;</td><td>an allocated string returns the name in string form</td></tr>
81  </table>
82</dl>
83<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
84
85</div>
86</div><p>
87<a class="anchor" name="g1838777e576422c1cb17093bbf7fa018"></a><!-- doxytag: member="name.c::hx509_name_binary" ref="g1838777e576422c1cb17093bbf7fa018" args="(const hx509_name name, heim_octet_string *os)" -->
88<div class="memitem">
89<div class="memproto">
90      <table class="memname">
91        <tr>
92          <td class="memname">int hx509_name_binary           </td>
93          <td>(</td>
94          <td class="paramtype">const hx509_name&nbsp;</td>
95          <td class="paramname"> <em>name</em>, </td>
96        </tr>
97        <tr>
98          <td class="paramkey"></td>
99          <td></td>
100          <td class="paramtype">heim_octet_string *&nbsp;</td>
101          <td class="paramname"> <em>os</em></td><td>&nbsp;</td>
102        </tr>
103        <tr>
104          <td></td>
105          <td>)</td>
106          <td></td><td></td><td></td>
107        </tr>
108      </table>
109</div>
110<div class="memdoc">
111
112<p>
113Convert a hx509_name object to DER encoded name.<p>
114<dl compact><dt><b>Parameters:</b></dt><dd>
115  <table border="0" cellspacing="2" cellpadding="0">
116    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>name to concert </td></tr>
117    <tr><td valign="top"></td><td valign="top"><em>os</em>&nbsp;</td><td>data to a DER encoded name, free the resulting octet string with hx509_xfree(os-&gt;data).</td></tr>
118  </table>
119</dl>
120<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
121
122</div>
123</div><p>
124<a class="anchor" name="gbd49c49301d601bc53371b867a7eac54"></a><!-- doxytag: member="name.c::hx509_name_cmp" ref="gbd49c49301d601bc53371b867a7eac54" args="(hx509_name n1, hx509_name n2)" -->
125<div class="memitem">
126<div class="memproto">
127      <table class="memname">
128        <tr>
129          <td class="memname">int hx509_name_cmp           </td>
130          <td>(</td>
131          <td class="paramtype">hx509_name&nbsp;</td>
132          <td class="paramname"> <em>n1</em>, </td>
133        </tr>
134        <tr>
135          <td class="paramkey"></td>
136          <td></td>
137          <td class="paramtype">hx509_name&nbsp;</td>
138          <td class="paramname"> <em>n2</em></td><td>&nbsp;</td>
139        </tr>
140        <tr>
141          <td></td>
142          <td>)</td>
143          <td></td><td></td><td></td>
144        </tr>
145      </table>
146</div>
147<div class="memdoc">
148
149<p>
150Compare to hx509 name object, useful for sorting.<p>
151<dl compact><dt><b>Parameters:</b></dt><dd>
152  <table border="0" cellspacing="2" cellpadding="0">
153    <tr><td valign="top"></td><td valign="top"><em>n1</em>&nbsp;</td><td>a hx509 name object. </td></tr>
154    <tr><td valign="top"></td><td valign="top"><em>n2</em>&nbsp;</td><td>a hx509 name object.</td></tr>
155  </table>
156</dl>
157<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 the objects are the same, returns &gt; 0 is n2 is "larger" then n2, &lt; 0 if n1 is "smaller" then n2. </dd></dl>
158
159</div>
160</div><p>
161<a class="anchor" name="gcf9b6bfcdd810bed71e98f7e04d918ca"></a><!-- doxytag: member="name.c::hx509_name_copy" ref="gcf9b6bfcdd810bed71e98f7e04d918ca" args="(hx509_context context, const hx509_name from, hx509_name *to)" -->
162<div class="memitem">
163<div class="memproto">
164      <table class="memname">
165        <tr>
166          <td class="memname">int hx509_name_copy           </td>
167          <td>(</td>
168          <td class="paramtype">hx509_context&nbsp;</td>
169          <td class="paramname"> <em>context</em>, </td>
170        </tr>
171        <tr>
172          <td class="paramkey"></td>
173          <td></td>
174          <td class="paramtype">const hx509_name&nbsp;</td>
175          <td class="paramname"> <em>from</em>, </td>
176        </tr>
177        <tr>
178          <td class="paramkey"></td>
179          <td></td>
180          <td class="paramtype">hx509_name *&nbsp;</td>
181          <td class="paramname"> <em>to</em></td><td>&nbsp;</td>
182        </tr>
183        <tr>
184          <td></td>
185          <td>)</td>
186          <td></td><td></td><td></td>
187        </tr>
188      </table>
189</div>
190<div class="memdoc">
191
192<p>
193Copy a hx509 name object.<p>
194<dl compact><dt><b>Parameters:</b></dt><dd>
195  <table border="0" cellspacing="2" cellpadding="0">
196    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 cotext. </td></tr>
197    <tr><td valign="top"></td><td valign="top"><em>from</em>&nbsp;</td><td>the name to copy from </td></tr>
198    <tr><td valign="top"></td><td valign="top"><em>to</em>&nbsp;</td><td>the name to copy to</td></tr>
199  </table>
200</dl>
201<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
202
203</div>
204</div><p>
205<a class="anchor" name="g42015083c70b6aa29c4f082998dbbece"></a><!-- doxytag: member="name.c::hx509_name_expand" ref="g42015083c70b6aa29c4f082998dbbece" args="(hx509_context context, hx509_name name, hx509_env env)" -->
206<div class="memitem">
207<div class="memproto">
208      <table class="memname">
209        <tr>
210          <td class="memname">int hx509_name_expand           </td>
211          <td>(</td>
212          <td class="paramtype">hx509_context&nbsp;</td>
213          <td class="paramname"> <em>context</em>, </td>
214        </tr>
215        <tr>
216          <td class="paramkey"></td>
217          <td></td>
218          <td class="paramtype">hx509_name&nbsp;</td>
219          <td class="paramname"> <em>name</em>, </td>
220        </tr>
221        <tr>
222          <td class="paramkey"></td>
223          <td></td>
224          <td class="paramtype">hx509_env&nbsp;</td>
225          <td class="paramname"> <em>env</em></td><td>&nbsp;</td>
226        </tr>
227        <tr>
228          <td></td>
229          <td>)</td>
230          <td></td><td></td><td></td>
231        </tr>
232      </table>
233</div>
234<div class="memdoc">
235
236<p>
237Expands variables in the name using env. Variables are on the form ${name}. Useful when dealing with certificate templates.<p>
238<dl compact><dt><b>Parameters:</b></dt><dd>
239  <table border="0" cellspacing="2" cellpadding="0">
240    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 cotext. </td></tr>
241    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name to expand. </td></tr>
242    <tr><td valign="top"></td><td valign="top"><em>env</em>&nbsp;</td><td>environment variable to expand.</td></tr>
243  </table>
244</dl>
245<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
246
247<p>
248Only UTF8String rdnSequence names are allowed
249</div>
250</div><p>
251<a class="anchor" name="gaf351931efb02fc7aea736af9977155e"></a><!-- doxytag: member="name.c::hx509_name_free" ref="gaf351931efb02fc7aea736af9977155e" args="(hx509_name *name)" -->
252<div class="memitem">
253<div class="memproto">
254      <table class="memname">
255        <tr>
256          <td class="memname">void hx509_name_free           </td>
257          <td>(</td>
258          <td class="paramtype">hx509_name *&nbsp;</td>
259          <td class="paramname"> <em>name</em>          </td>
260          <td>&nbsp;)&nbsp;</td>
261          <td></td>
262        </tr>
263      </table>
264</div>
265<div class="memdoc">
266
267<p>
268Free a hx509 name object, upond return *name will be NULL.<p>
269<dl compact><dt><b>Parameters:</b></dt><dd>
270  <table border="0" cellspacing="2" cellpadding="0">
271    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>a hx509 name object to be freed. </td></tr>
272  </table>
273</dl>
274
275</div>
276</div><p>
277<a class="anchor" name="g4f6715dcabbbcb5d48512e504eae8352"></a><!-- doxytag: member="name.c::hx509_name_is_null_p" ref="g4f6715dcabbbcb5d48512e504eae8352" args="(const hx509_name name)" -->
278<div class="memitem">
279<div class="memproto">
280      <table class="memname">
281        <tr>
282          <td class="memname">int hx509_name_is_null_p           </td>
283          <td>(</td>
284          <td class="paramtype">const hx509_name&nbsp;</td>
285          <td class="paramname"> <em>name</em>          </td>
286          <td>&nbsp;)&nbsp;</td>
287          <td></td>
288        </tr>
289      </table>
290</div>
291<div class="memdoc">
292
293<p>
294Unparse the hx509 name in name into a string.<p>
295<dl compact><dt><b>Parameters:</b></dt><dd>
296  <table border="0" cellspacing="2" cellpadding="0">
297    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name to check if its empty/null.</td></tr>
298  </table>
299</dl>
300<dl class="return" compact><dt><b>Returns:</b></dt><dd>non zero if the name is empty/null. </dd></dl>
301
302</div>
303</div><p>
304<a class="anchor" name="g6e65dc67aa48bb87e4fb98ecfe512fbd"></a><!-- doxytag: member="name.c::hx509_name_to_Name" ref="g6e65dc67aa48bb87e4fb98ecfe512fbd" args="(const hx509_name from, Name *to)" -->
305<div class="memitem">
306<div class="memproto">
307      <table class="memname">
308        <tr>
309          <td class="memname">int hx509_name_to_Name           </td>
310          <td>(</td>
311          <td class="paramtype">const hx509_name&nbsp;</td>
312          <td class="paramname"> <em>from</em>, </td>
313        </tr>
314        <tr>
315          <td class="paramkey"></td>
316          <td></td>
317          <td class="paramtype">Name *&nbsp;</td>
318          <td class="paramname"> <em>to</em></td><td>&nbsp;</td>
319        </tr>
320        <tr>
321          <td></td>
322          <td>)</td>
323          <td></td><td></td><td></td>
324        </tr>
325      </table>
326</div>
327<div class="memdoc">
328
329<p>
330Convert a hx509_name into a Name.<p>
331<dl compact><dt><b>Parameters:</b></dt><dd>
332  <table border="0" cellspacing="2" cellpadding="0">
333    <tr><td valign="top"></td><td valign="top"><em>from</em>&nbsp;</td><td>the name to copy from </td></tr>
334    <tr><td valign="top"></td><td valign="top"><em>to</em>&nbsp;</td><td>the name to copy to</td></tr>
335  </table>
336</dl>
337<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
338
339</div>
340</div><p>
341<a class="anchor" name="g1bd74b34e0aa88b083678ba231d38718"></a><!-- doxytag: member="name.c::hx509_name_to_string" ref="g1bd74b34e0aa88b083678ba231d38718" args="(const hx509_name name, char **str)" -->
342<div class="memitem">
343<div class="memproto">
344      <table class="memname">
345        <tr>
346          <td class="memname">int hx509_name_to_string           </td>
347          <td>(</td>
348          <td class="paramtype">const hx509_name&nbsp;</td>
349          <td class="paramname"> <em>name</em>, </td>
350        </tr>
351        <tr>
352          <td class="paramkey"></td>
353          <td></td>
354          <td class="paramtype">char **&nbsp;</td>
355          <td class="paramname"> <em>str</em></td><td>&nbsp;</td>
356        </tr>
357        <tr>
358          <td></td>
359          <td>)</td>
360          <td></td><td></td><td></td>
361        </tr>
362      </table>
363</div>
364<div class="memdoc">
365
366<p>
367Convert the hx509 name object into a printable string. The resulting string should be freed with free().<p>
368<dl compact><dt><b>Parameters:</b></dt><dd>
369  <table border="0" cellspacing="2" cellpadding="0">
370    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>name to print </td></tr>
371    <tr><td valign="top"></td><td valign="top"><em>str</em>&nbsp;</td><td>the string to return</td></tr>
372  </table>
373</dl>
374<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
375
376</div>
377</div><p>
378<a class="anchor" name="g0565f607a4e57d0911ee7081ad9548c5"></a><!-- doxytag: member="name.c::hx509_parse_name" ref="g0565f607a4e57d0911ee7081ad9548c5" args="(hx509_context context, const char *str, hx509_name *name)" -->
379<div class="memitem">
380<div class="memproto">
381      <table class="memname">
382        <tr>
383          <td class="memname">int hx509_parse_name           </td>
384          <td>(</td>
385          <td class="paramtype">hx509_context&nbsp;</td>
386          <td class="paramname"> <em>context</em>, </td>
387        </tr>
388        <tr>
389          <td class="paramkey"></td>
390          <td></td>
391          <td class="paramtype">const char *&nbsp;</td>
392          <td class="paramname"> <em>str</em>, </td>
393        </tr>
394        <tr>
395          <td class="paramkey"></td>
396          <td></td>
397          <td class="paramtype">hx509_name *&nbsp;</td>
398          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
399        </tr>
400        <tr>
401          <td></td>
402          <td>)</td>
403          <td></td><td></td><td></td>
404        </tr>
405      </table>
406</div>
407<div class="memdoc">
408
409<p>
410Parse a string into a hx509 name object.<p>
411<dl compact><dt><b>Parameters:</b></dt><dd>
412  <table border="0" cellspacing="2" cellpadding="0">
413    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
414    <tr><td valign="top"></td><td valign="top"><em>str</em>&nbsp;</td><td>a string to parse. </td></tr>
415    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the resulting object, NULL in case of error.</td></tr>
416  </table>
417</dl>
418<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
419
420</div>
421</div><p>
422<a class="anchor" name="gf8f73e0a75da2189b1815d8c968750df"></a><!-- doxytag: member="name.c::hx509_unparse_der_name" ref="gf8f73e0a75da2189b1815d8c968750df" args="(const void *data, size_t length, char **str)" -->
423<div class="memitem">
424<div class="memproto">
425      <table class="memname">
426        <tr>
427          <td class="memname">int hx509_unparse_der_name           </td>
428          <td>(</td>
429          <td class="paramtype">const void *&nbsp;</td>
430          <td class="paramname"> <em>data</em>, </td>
431        </tr>
432        <tr>
433          <td class="paramkey"></td>
434          <td></td>
435          <td class="paramtype">size_t&nbsp;</td>
436          <td class="paramname"> <em>length</em>, </td>
437        </tr>
438        <tr>
439          <td class="paramkey"></td>
440          <td></td>
441          <td class="paramtype">char **&nbsp;</td>
442          <td class="paramname"> <em>str</em></td><td>&nbsp;</td>
443        </tr>
444        <tr>
445          <td></td>
446          <td>)</td>
447          <td></td><td></td><td></td>
448        </tr>
449      </table>
450</div>
451<div class="memdoc">
452
453<p>
454Convert a DER encoded name info a string.<p>
455<dl compact><dt><b>Parameters:</b></dt><dd>
456  <table border="0" cellspacing="2" cellpadding="0">
457    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>data to a DER/BER encoded name </td></tr>
458    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>length of data </td></tr>
459    <tr><td valign="top"></td><td valign="top"><em>str</em>&nbsp;</td><td>the resulting string, is NULL on failure.</td></tr>
460  </table>
461</dl>
462<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code, see <a class="el" href="group__hx509__error.html#g15791abff76719acb531223fdcbcac87">hx509_get_error_string()</a>. </dd></dl>
463
464</div>
465</div><p>
466</div>
467<hr size="1"><address style="text-align: right;"><small>
468Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
469</body>
470</html>
471