<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Heimdalx509library: hx509 name functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<p>
<a href="http://www.h5l.org/"><img src="http://www.h5l.org/keyhole-heimdal.png" alt="keyhole logo"/></a>
</p>
<!-- end of header marker -->
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>hx509 name functions</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__name.html#gaf351931efb02fc7aea736af9977155e">hx509_name_free</a> (hx509_name *name)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
See the <a class="el" href="page_name.html">PKIX/X.509 Names</a> for description and examples. <hr><h2>Function Documentation</h2>
<a class="anchor" name="g678a0bf7676746ea1827efe951042f1e"></a><!-- doxytag: member="name.c::hx509_general_name_unparse" ref="g678a0bf7676746ea1827efe951042f1e" args="(GeneralName *name, char **str)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_general_name_unparse </td>
<td>(</td>
<td class="paramtype">GeneralName * </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char ** </td>
<td class="paramname"> <em>str</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Unparse the hx509 name in name into a string.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>the name to print </td></tr>
<tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>an allocated string returns the name in string form</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
<a class="anchor" name="g1838777e576422c1cb17093bbf7fa018"></a><!-- doxytag: member="name.c::hx509_name_binary" ref="g1838777e576422c1cb17093bbf7fa018" args="(const hx509_name name, heim_octet_string *os)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_binary </td>
<td>(</td>
<td class="paramtype">const hx509_name </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">heim_octet_string * </td>
<td class="paramname"> <em>os</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert a hx509_name object to DER encoded name.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>name to concert </td></tr>
<tr><td valign="top"></td><td valign="top"><em>os</em> </td><td>data to a DER encoded name, free the resulting octet string with hx509_xfree(os->data).</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
<a class="anchor" name="gbd49c49301d601bc53371b867a7eac54"></a><!-- doxytag: member="name.c::hx509_name_cmp" ref="gbd49c49301d601bc53371b867a7eac54" args="(hx509_name n1, hx509_name n2)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_cmp </td>
<td>(</td>
<td class="paramtype">hx509_name </td>
<td class="paramname"> <em>n1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_name </td>
<td class="paramname"> <em>n2</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Compare to hx509 name object, useful for sorting.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>n1</em> </td><td>a hx509 name object. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>n2</em> </td><td>a hx509 name object.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 the objects are the same, returns > 0 is n2 is "larger" then n2, < 0 if n1 is "smaller" then n2. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_copy </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const hx509_name </td>
<td class="paramname"> <em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_name * </td>
<td class="paramname"> <em>to</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Copy a hx509 name object.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>A hx509 cotext. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>from</em> </td><td>the name to copy from </td></tr>
<tr><td valign="top"></td><td valign="top"><em>to</em> </td><td>the name to copy to</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_expand </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_name </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_env </td>
<td class="paramname"> <em>env</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Expands variables in the name using env. Variables are on the form ${name}. Useful when dealing with certificate templates.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>A hx509 cotext. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>the name to expand. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>env</em> </td><td>environment variable to expand.</td></tr>
</table>
</dl>
<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>
<p>
Only UTF8String rdnSequence names are allowed
</div>
</div><p>
<a class="anchor" name="gaf351931efb02fc7aea736af9977155e"></a><!-- doxytag: member="name.c::hx509_name_free" ref="gaf351931efb02fc7aea736af9977155e" args="(hx509_name *name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void hx509_name_free </td>
<td>(</td>
<td class="paramtype">hx509_name * </td>
<td class="paramname"> <em>name</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Free a hx509 name object, upond return *name will be NULL.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>a hx509 name object to be freed. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="g4f6715dcabbbcb5d48512e504eae8352"></a><!-- doxytag: member="name.c::hx509_name_is_null_p" ref="g4f6715dcabbbcb5d48512e504eae8352" args="(const hx509_name name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_is_null_p </td>
<td>(</td>
<td class="paramtype">const hx509_name </td>
<td class="paramname"> <em>name</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Unparse the hx509 name in name into a string.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>the name to check if its empty/null.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>non zero if the name is empty/null. </dd></dl>
</div>
</div><p>
<a class="anchor" name="g6e65dc67aa48bb87e4fb98ecfe512fbd"></a><!-- doxytag: member="name.c::hx509_name_to_Name" ref="g6e65dc67aa48bb87e4fb98ecfe512fbd" args="(const hx509_name from, Name *to)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_to_Name </td>
<td>(</td>
<td class="paramtype">const hx509_name </td>
<td class="paramname"> <em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Name * </td>
<td class="paramname"> <em>to</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert a hx509_name into a Name.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>from</em> </td><td>the name to copy from </td></tr>
<tr><td valign="top"></td><td valign="top"><em>to</em> </td><td>the name to copy to</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
<a class="anchor" name="g1bd74b34e0aa88b083678ba231d38718"></a><!-- doxytag: member="name.c::hx509_name_to_string" ref="g1bd74b34e0aa88b083678ba231d38718" args="(const hx509_name name, char **str)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_name_to_string </td>
<td>(</td>
<td class="paramtype">const hx509_name </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char ** </td>
<td class="paramname"> <em>str</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert the hx509 name object into a printable string. The resulting string should be freed with free().<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>name to print </td></tr>
<tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>the string to return</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_parse_name </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_name * </td>
<td class="paramname"> <em>name</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Parse a string into a hx509 name object.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>A hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>a string to parse. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>the resulting object, NULL in case of error.</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_unparse_der_name </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"> <em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> <em>length</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char ** </td>
<td class="paramname"> <em>str</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert a DER encoded name info a string.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>data</em> </td><td>data to a DER/BER encoded name </td></tr>
<tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>length of data </td></tr>
<tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>the resulting string, is NULL on failure.</td></tr>
</table>
</dl>
<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>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>