xref: /freebsd/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cert.html (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
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 certificate 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 certificate 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__cert.html#g1aa420f664ce5933f8af4cf6c37fd6f6">hx509_cert_init</a> (hx509_context context, const Certificate *c, hx509_cert *cert)</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__cert.html#g479d8c1bf22aa8fdfa448bed1ec54d7b">hx509_cert_init_data</a> (hx509_context context, const void *ptr, size_t len, hx509_cert *cert)</td></tr>
28
29<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gd2f9bb0ddc4babb26a8ccd983db8c948">hx509_cert_free</a> (hx509_cert cert)</td></tr>
30
31<tr><td class="memItemLeft" nowrap align="right" valign="top">hx509_cert&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g1870b485d4e8e53f75690f35f4526fcc">hx509_cert_ref</a> (hx509_cert cert)</td></tr>
32
33<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gfb8063ac0396ad60392b8b9554c6b896">hx509_verify_ctx_f_allow_default_trustanchors</a> (hx509_verify_ctx ctx, int boolean)</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__cert.html#g49e7c45c70442dcb81d394093d9cbe29">hx509_cert_find_subjectAltName_otherName</a> (hx509_context context, hx509_cert cert, const heim_oid *oid, hx509_octet_string_list *list)</td></tr>
36
37<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gb84ed704b59c7965a598ef9c7c353216">hx509_cert_cmp</a> (hx509_cert p, hx509_cert q)</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__cert.html#g3c61a21c5a802b2f366c9610ff89fa90">hx509_cert_get_issuer</a> (hx509_cert p, hx509_name *name)</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__cert.html#g9f64bb8083bb535ccba007b723c73619">hx509_cert_get_subject</a> (hx509_cert p, hx509_name *name)</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__cert.html#g5e8e38603eb13753912b0075aab276cf">hx509_cert_get_base_subject</a> (hx509_context context, hx509_cert c, 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__cert.html#g2960bea38768b49c8b949fe2ea5320e3">hx509_cert_get_serialnumber</a> (hx509_cert p, heim_integer *i)</td></tr>
46
47<tr><td class="memItemLeft" nowrap align="right" valign="top">time_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g2e36444c1bce8995ee193013364ce852">hx509_cert_get_notBefore</a> (hx509_cert p)</td></tr>
48
49<tr><td class="memItemLeft" nowrap align="right" valign="top">time_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gd3e8410e9bb4d0bf61bc3e926a4049eb">hx509_cert_get_notAfter</a> (hx509_cert p)</td></tr>
50
51<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gc9e328025dd91339cf73eecdeec4ffd6">hx509_cert_get_SPKI</a> (hx509_context context, hx509_cert p, SubjectPublicKeyInfo *spki)</td></tr>
52
53<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gc2fd6cd8b1fbe0d470a88143a359c395">hx509_cert_get_SPKI_AlgorithmIdentifier</a> (hx509_context context, hx509_cert p, AlgorithmIdentifier *alg)</td></tr>
54
55<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gc88fb8bf53b3e105f728251f6d4d4b1f">hx509_cert_get_issuer_unique_id</a> (hx509_context context, hx509_cert p, heim_bit_string *issuer)</td></tr>
56
57<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gc7184f4f0249842866d51b17e4b101fb">hx509_cert_get_subject_unique_id</a> (hx509_context context, hx509_cert p, heim_bit_string *subject)</td></tr>
58
59<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g5dc160f02aeffffb0eea58b6203c856a">hx509_verify_hostname</a> (hx509_context context, const hx509_cert cert, int flags, hx509_hostname_type type, const char *hostname, const struct sockaddr *sa, int sa_size)</td></tr>
60
61<tr><td class="memItemLeft" nowrap align="right" valign="top">hx509_cert_attribute&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g2038342b93f828789a241a7fee26f4c8">hx509_cert_get_attribute</a> (hx509_cert cert, const heim_oid *oid)</td></tr>
62
63<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g972768dbcc822fed1b74e7686b407f78">hx509_cert_set_friendly_name</a> (hx509_cert cert, const char *name)</td></tr>
64
65<tr><td class="memItemLeft" nowrap align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#ge2a1de96837304d68216c309e698c3fd">hx509_cert_get_friendly_name</a> (hx509_cert cert)</td></tr>
66
67<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g5833168d3181e12883b51284fd069543">hx509_query_alloc</a> (hx509_context context, hx509_query **q)</td></tr>
68
69<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gc708daef26edff5fd36f4587e61a9914">hx509_query_match_option</a> (hx509_query *q, hx509_query_option option)</td></tr>
70
71<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gd5d7a68cc8ca4c948ae99b7eb6f5bc2e">hx509_query_match_issuer_serial</a> (hx509_query *q, const Name *issuer, const heim_integer *serialNumber)</td></tr>
72
73<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g5be7b5ece155f2577335b5575f141362">hx509_query_match_friendly_name</a> (hx509_query *q, const char *name)</td></tr>
74
75<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g5a7e01c75b7b8243356048a88133c2df">hx509_query_match_eku</a> (hx509_query *q, const heim_oid *eku)</td></tr>
76
77<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#ge1660c0cf5a41f17db72a8c18e79c684">hx509_query_match_cmp_func</a> (hx509_query *q, int(*func)(hx509_context, hx509_cert, void *), void *ctx)</td></tr>
78
79<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g6aafd01e9215fef980a572b2c7289d8c">hx509_query_free</a> (hx509_context context, hx509_query *q)</td></tr>
80
81<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g94b4aa7d907d34914e161831e74440a8">hx509_query_statistic_file</a> (hx509_context context, const char *fn)</td></tr>
82
83<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g522fb2a85515ce8debea860cdfeb94c0">hx509_query_unparse_stats</a> (hx509_context context, int printtype, FILE *out)</td></tr>
84
85<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g1b329c40d7c17cc1b099ec0bd24d4dc9">hx509_cert_check_eku</a> (hx509_context context, hx509_cert cert, const heim_oid *eku, int allow_any_eku)</td></tr>
86
87<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#gfa02f22b6db5ca3c19a488066fea5d7a">hx509_cert_binary</a> (hx509_context context, hx509_cert c, heim_octet_string *os)</td></tr>
88
89<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__cert.html#g32a804b17d97d71af17602fdf6b1c891">hx509_print_cert</a> (hx509_context context, hx509_cert cert, FILE *out)</td></tr>
90
91</table>
92<hr><a name="_details"></a><h2>Detailed Description</h2>
93See the <a class="el" href="page_cert.html">The basic certificate</a> for description and examples. <hr><h2>Function Documentation</h2>
94<a class="anchor" name="gfa02f22b6db5ca3c19a488066fea5d7a"></a><!-- doxytag: member="cert.c::hx509_cert_binary" ref="gfa02f22b6db5ca3c19a488066fea5d7a" args="(hx509_context context, hx509_cert c, heim_octet_string *os)" -->
95<div class="memitem">
96<div class="memproto">
97      <table class="memname">
98        <tr>
99          <td class="memname">int hx509_cert_binary           </td>
100          <td>(</td>
101          <td class="paramtype">hx509_context&nbsp;</td>
102          <td class="paramname"> <em>context</em>, </td>
103        </tr>
104        <tr>
105          <td class="paramkey"></td>
106          <td></td>
107          <td class="paramtype">hx509_cert&nbsp;</td>
108          <td class="paramname"> <em>c</em>, </td>
109        </tr>
110        <tr>
111          <td class="paramkey"></td>
112          <td></td>
113          <td class="paramtype">heim_octet_string *&nbsp;</td>
114          <td class="paramname"> <em>os</em></td><td>&nbsp;</td>
115        </tr>
116        <tr>
117          <td></td>
118          <td>)</td>
119          <td></td><td></td><td></td>
120        </tr>
121      </table>
122</div>
123<div class="memdoc">
124
125<p>
126Encodes the hx509 certificate as a DER encode binary.<p>
127<dl compact><dt><b>Parameters:</b></dt><dd>
128  <table border="0" cellspacing="2" cellpadding="0">
129    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
130    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>the certificate to encode. </td></tr>
131    <tr><td valign="top"></td><td valign="top"><em>os</em>&nbsp;</td><td>the encode certificate, set to NULL, 0 on case of error. Free the os-&gt;data with <a class="el" href="group__hx509__misc.html#gba6d3eb6abde539a3191269f785e3e61">hx509_xfree()</a>.</td></tr>
132  </table>
133</dl>
134<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>
135
136</div>
137</div><p>
138<a class="anchor" name="g1b329c40d7c17cc1b099ec0bd24d4dc9"></a><!-- doxytag: member="cert.c::hx509_cert_check_eku" ref="g1b329c40d7c17cc1b099ec0bd24d4dc9" args="(hx509_context context, hx509_cert cert, const heim_oid *eku, int allow_any_eku)" -->
139<div class="memitem">
140<div class="memproto">
141      <table class="memname">
142        <tr>
143          <td class="memname">int hx509_cert_check_eku           </td>
144          <td>(</td>
145          <td class="paramtype">hx509_context&nbsp;</td>
146          <td class="paramname"> <em>context</em>, </td>
147        </tr>
148        <tr>
149          <td class="paramkey"></td>
150          <td></td>
151          <td class="paramtype">hx509_cert&nbsp;</td>
152          <td class="paramname"> <em>cert</em>, </td>
153        </tr>
154        <tr>
155          <td class="paramkey"></td>
156          <td></td>
157          <td class="paramtype">const heim_oid *&nbsp;</td>
158          <td class="paramname"> <em>eku</em>, </td>
159        </tr>
160        <tr>
161          <td class="paramkey"></td>
162          <td></td>
163          <td class="paramtype">int&nbsp;</td>
164          <td class="paramname"> <em>allow_any_eku</em></td><td>&nbsp;</td>
165        </tr>
166        <tr>
167          <td></td>
168          <td>)</td>
169          <td></td><td></td><td></td>
170        </tr>
171      </table>
172</div>
173<div class="memdoc">
174
175<p>
176Check the extended key usage on the hx509 certificate.<p>
177<dl compact><dt><b>Parameters:</b></dt><dd>
178  <table border="0" cellspacing="2" cellpadding="0">
179    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
180    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>A hx509 context. </td></tr>
181    <tr><td valign="top"></td><td valign="top"><em>eku</em>&nbsp;</td><td>the EKU to check for </td></tr>
182    <tr><td valign="top"></td><td valign="top"><em>allow_any_eku</em>&nbsp;</td><td>if the any EKU is set, allow that to be a substitute.</td></tr>
183  </table>
184</dl>
185<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>
186
187</div>
188</div><p>
189<a class="anchor" name="gb84ed704b59c7965a598ef9c7c353216"></a><!-- doxytag: member="cert.c::hx509_cert_cmp" ref="gb84ed704b59c7965a598ef9c7c353216" args="(hx509_cert p, hx509_cert q)" -->
190<div class="memitem">
191<div class="memproto">
192      <table class="memname">
193        <tr>
194          <td class="memname">int hx509_cert_cmp           </td>
195          <td>(</td>
196          <td class="paramtype">hx509_cert&nbsp;</td>
197          <td class="paramname"> <em>p</em>, </td>
198        </tr>
199        <tr>
200          <td class="paramkey"></td>
201          <td></td>
202          <td class="paramtype">hx509_cert&nbsp;</td>
203          <td class="paramname"> <em>q</em></td><td>&nbsp;</td>
204        </tr>
205        <tr>
206          <td></td>
207          <td>)</td>
208          <td></td><td></td><td></td>
209        </tr>
210      </table>
211</div>
212<div class="memdoc">
213
214<p>
215Compare to hx509 certificate object, useful for sorting.<p>
216<dl compact><dt><b>Parameters:</b></dt><dd>
217  <table border="0" cellspacing="2" cellpadding="0">
218    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
219    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>a hx509 certificate object.</td></tr>
220  </table>
221</dl>
222<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 the objects are the same, returns &gt; 0 is p is "larger" then q, &lt; 0 if p is "smaller" then q. </dd></dl>
223
224</div>
225</div><p>
226<a class="anchor" name="g49e7c45c70442dcb81d394093d9cbe29"></a><!-- doxytag: member="cert.c::hx509_cert_find_subjectAltName_otherName" ref="g49e7c45c70442dcb81d394093d9cbe29" args="(hx509_context context, hx509_cert cert, const heim_oid *oid, hx509_octet_string_list *list)" -->
227<div class="memitem">
228<div class="memproto">
229      <table class="memname">
230        <tr>
231          <td class="memname">int hx509_cert_find_subjectAltName_otherName           </td>
232          <td>(</td>
233          <td class="paramtype">hx509_context&nbsp;</td>
234          <td class="paramname"> <em>context</em>, </td>
235        </tr>
236        <tr>
237          <td class="paramkey"></td>
238          <td></td>
239          <td class="paramtype">hx509_cert&nbsp;</td>
240          <td class="paramname"> <em>cert</em>, </td>
241        </tr>
242        <tr>
243          <td class="paramkey"></td>
244          <td></td>
245          <td class="paramtype">const heim_oid *&nbsp;</td>
246          <td class="paramname"> <em>oid</em>, </td>
247        </tr>
248        <tr>
249          <td class="paramkey"></td>
250          <td></td>
251          <td class="paramtype">hx509_octet_string_list *&nbsp;</td>
252          <td class="paramname"> <em>list</em></td><td>&nbsp;</td>
253        </tr>
254        <tr>
255          <td></td>
256          <td>)</td>
257          <td></td><td></td><td></td>
258        </tr>
259      </table>
260</div>
261<div class="memdoc">
262
263<p>
264Return a list of subjectAltNames specified by oid in the certificate. On error the<p>
265The returned list of octet string should be freed with <a class="el" href="group__hx509__misc.html#ga39b9443f688a6d9152ff6dc05f3be8e">hx509_free_octet_string_list()</a>.<p>
266<dl compact><dt><b>Parameters:</b></dt><dd>
267  <table border="0" cellspacing="2" cellpadding="0">
268    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
269    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
270    <tr><td valign="top"></td><td valign="top"><em>oid</em>&nbsp;</td><td>an oid to for SubjectAltName. </td></tr>
271    <tr><td valign="top"></td><td valign="top"><em>list</em>&nbsp;</td><td>list of matching SubjectAltName.</td></tr>
272  </table>
273</dl>
274<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>
275
276</div>
277</div><p>
278<a class="anchor" name="gd2f9bb0ddc4babb26a8ccd983db8c948"></a><!-- doxytag: member="cert.c::hx509_cert_free" ref="gd2f9bb0ddc4babb26a8ccd983db8c948" args="(hx509_cert cert)" -->
279<div class="memitem">
280<div class="memproto">
281      <table class="memname">
282        <tr>
283          <td class="memname">void hx509_cert_free           </td>
284          <td>(</td>
285          <td class="paramtype">hx509_cert&nbsp;</td>
286          <td class="paramname"> <em>cert</em>          </td>
287          <td>&nbsp;)&nbsp;</td>
288          <td></td>
289        </tr>
290      </table>
291</div>
292<div class="memdoc">
293
294<p>
295Free reference to the hx509 certificate object, if the refcounter reaches 0, the object if freed. Its allowed to pass in NULL.<p>
296<dl compact><dt><b>Parameters:</b></dt><dd>
297  <table border="0" cellspacing="2" cellpadding="0">
298    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>the cert to free. </td></tr>
299  </table>
300</dl>
301
302</div>
303</div><p>
304<a class="anchor" name="g2038342b93f828789a241a7fee26f4c8"></a><!-- doxytag: member="cert.c::hx509_cert_get_attribute" ref="g2038342b93f828789a241a7fee26f4c8" args="(hx509_cert cert, const heim_oid *oid)" -->
305<div class="memitem">
306<div class="memproto">
307      <table class="memname">
308        <tr>
309          <td class="memname">hx509_cert_attribute hx509_cert_get_attribute           </td>
310          <td>(</td>
311          <td class="paramtype">hx509_cert&nbsp;</td>
312          <td class="paramname"> <em>cert</em>, </td>
313        </tr>
314        <tr>
315          <td class="paramkey"></td>
316          <td></td>
317          <td class="paramtype">const heim_oid *&nbsp;</td>
318          <td class="paramname"> <em>oid</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>
330Get an external attribute for the certificate, examples are friendly name and id.<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>cert</em>&nbsp;</td><td>hx509 certificate object to search </td></tr>
334    <tr><td valign="top"></td><td valign="top"><em>oid</em>&nbsp;</td><td>an oid to search for.</td></tr>
335  </table>
336</dl>
337<dl class="return" compact><dt><b>Returns:</b></dt><dd>an hx509_cert_attribute, only valid as long as the certificate is referenced. </dd></dl>
338
339</div>
340</div><p>
341<a class="anchor" name="g5e8e38603eb13753912b0075aab276cf"></a><!-- doxytag: member="cert.c::hx509_cert_get_base_subject" ref="g5e8e38603eb13753912b0075aab276cf" args="(hx509_context context, hx509_cert c, hx509_name *name)" -->
342<div class="memitem">
343<div class="memproto">
344      <table class="memname">
345        <tr>
346          <td class="memname">int hx509_cert_get_base_subject           </td>
347          <td>(</td>
348          <td class="paramtype">hx509_context&nbsp;</td>
349          <td class="paramname"> <em>context</em>, </td>
350        </tr>
351        <tr>
352          <td class="paramkey"></td>
353          <td></td>
354          <td class="paramtype">hx509_cert&nbsp;</td>
355          <td class="paramname"> <em>c</em>, </td>
356        </tr>
357        <tr>
358          <td class="paramkey"></td>
359          <td></td>
360          <td class="paramtype">hx509_name *&nbsp;</td>
361          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
362        </tr>
363        <tr>
364          <td></td>
365          <td>)</td>
366          <td></td><td></td><td></td>
367        </tr>
368      </table>
369</div>
370<div class="memdoc">
371
372<p>
373Return the name of the base subject of the hx509 certificate. If the certiicate is a verified proxy certificate, the this function return the base certificate (root of the proxy chain). If the proxy certificate is not verified with the base certificate HX509_PROXY_CERTIFICATE_NOT_CANONICALIZED is returned.<p>
374<dl compact><dt><b>Parameters:</b></dt><dd>
375  <table border="0" cellspacing="2" cellpadding="0">
376    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
377    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
378    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>a pointer to a hx509 name, should be freed by <a class="el" href="group__hx509__name.html#gaf351931efb02fc7aea736af9977155e">hx509_name_free()</a>. See also <a class="el" href="group__hx509__cert.html#g9f64bb8083bb535ccba007b723c73619">hx509_cert_get_subject()</a>.</td></tr>
379  </table>
380</dl>
381<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>
382
383</div>
384</div><p>
385<a class="anchor" name="ge2a1de96837304d68216c309e698c3fd"></a><!-- doxytag: member="cert.c::hx509_cert_get_friendly_name" ref="ge2a1de96837304d68216c309e698c3fd" args="(hx509_cert cert)" -->
386<div class="memitem">
387<div class="memproto">
388      <table class="memname">
389        <tr>
390          <td class="memname">const char* hx509_cert_get_friendly_name           </td>
391          <td>(</td>
392          <td class="paramtype">hx509_cert&nbsp;</td>
393          <td class="paramname"> <em>cert</em>          </td>
394          <td>&nbsp;)&nbsp;</td>
395          <td></td>
396        </tr>
397      </table>
398</div>
399<div class="memdoc">
400
401<p>
402Get friendly name of the certificate.<p>
403<dl compact><dt><b>Parameters:</b></dt><dd>
404  <table border="0" cellspacing="2" cellpadding="0">
405    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>cert to get the friendly name from.</td></tr>
406  </table>
407</dl>
408<dl class="return" compact><dt><b>Returns:</b></dt><dd>an friendly name or NULL if there is. The friendly name is only valid as long as the certificate is referenced. </dd></dl>
409
410</div>
411</div><p>
412<a class="anchor" name="g3c61a21c5a802b2f366c9610ff89fa90"></a><!-- doxytag: member="cert.c::hx509_cert_get_issuer" ref="g3c61a21c5a802b2f366c9610ff89fa90" args="(hx509_cert p, hx509_name *name)" -->
413<div class="memitem">
414<div class="memproto">
415      <table class="memname">
416        <tr>
417          <td class="memname">int hx509_cert_get_issuer           </td>
418          <td>(</td>
419          <td class="paramtype">hx509_cert&nbsp;</td>
420          <td class="paramname"> <em>p</em>, </td>
421        </tr>
422        <tr>
423          <td class="paramkey"></td>
424          <td></td>
425          <td class="paramtype">hx509_name *&nbsp;</td>
426          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
427        </tr>
428        <tr>
429          <td></td>
430          <td>)</td>
431          <td></td><td></td><td></td>
432        </tr>
433      </table>
434</div>
435<div class="memdoc">
436
437<p>
438Return the name of the issuer of the hx509 certificate.<p>
439<dl compact><dt><b>Parameters:</b></dt><dd>
440  <table border="0" cellspacing="2" cellpadding="0">
441    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
442    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>a pointer to a hx509 name, should be freed by <a class="el" href="group__hx509__name.html#gaf351931efb02fc7aea736af9977155e">hx509_name_free()</a>.</td></tr>
443  </table>
444</dl>
445<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>
446
447</div>
448</div><p>
449<a class="anchor" name="gc88fb8bf53b3e105f728251f6d4d4b1f"></a><!-- doxytag: member="cert.c::hx509_cert_get_issuer_unique_id" ref="gc88fb8bf53b3e105f728251f6d4d4b1f" args="(hx509_context context, hx509_cert p, heim_bit_string *issuer)" -->
450<div class="memitem">
451<div class="memproto">
452      <table class="memname">
453        <tr>
454          <td class="memname">int hx509_cert_get_issuer_unique_id           </td>
455          <td>(</td>
456          <td class="paramtype">hx509_context&nbsp;</td>
457          <td class="paramname"> <em>context</em>, </td>
458        </tr>
459        <tr>
460          <td class="paramkey"></td>
461          <td></td>
462          <td class="paramtype">hx509_cert&nbsp;</td>
463          <td class="paramname"> <em>p</em>, </td>
464        </tr>
465        <tr>
466          <td class="paramkey"></td>
467          <td></td>
468          <td class="paramtype">heim_bit_string *&nbsp;</td>
469          <td class="paramname"> <em>issuer</em></td><td>&nbsp;</td>
470        </tr>
471        <tr>
472          <td></td>
473          <td>)</td>
474          <td></td><td></td><td></td>
475        </tr>
476      </table>
477</div>
478<div class="memdoc">
479
480<p>
481Get a copy of the Issuer Unique ID<p>
482<dl compact><dt><b>Parameters:</b></dt><dd>
483  <table border="0" cellspacing="2" cellpadding="0">
484    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509_context </td></tr>
485    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate </td></tr>
486    <tr><td valign="top"></td><td valign="top"><em>issuer</em>&nbsp;</td><td>the issuer id returned, free with der_free_bit_string()</td></tr>
487  </table>
488</dl>
489<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>. The error code HX509_EXTENSION_NOT_FOUND is returned if the certificate doesn't have a issuerUniqueID </dd></dl>
490
491</div>
492</div><p>
493<a class="anchor" name="gd3e8410e9bb4d0bf61bc3e926a4049eb"></a><!-- doxytag: member="cert.c::hx509_cert_get_notAfter" ref="gd3e8410e9bb4d0bf61bc3e926a4049eb" args="(hx509_cert p)" -->
494<div class="memitem">
495<div class="memproto">
496      <table class="memname">
497        <tr>
498          <td class="memname">time_t hx509_cert_get_notAfter           </td>
499          <td>(</td>
500          <td class="paramtype">hx509_cert&nbsp;</td>
501          <td class="paramname"> <em>p</em>          </td>
502          <td>&nbsp;)&nbsp;</td>
503          <td></td>
504        </tr>
505      </table>
506</div>
507<div class="memdoc">
508
509<p>
510Get notAfter time of the certificate.<p>
511<dl compact><dt><b>Parameters:</b></dt><dd>
512  <table border="0" cellspacing="2" cellpadding="0">
513    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object.</td></tr>
514  </table>
515</dl>
516<dl class="return" compact><dt><b>Returns:</b></dt><dd>return not after time. </dd></dl>
517
518</div>
519</div><p>
520<a class="anchor" name="g2e36444c1bce8995ee193013364ce852"></a><!-- doxytag: member="cert.c::hx509_cert_get_notBefore" ref="g2e36444c1bce8995ee193013364ce852" args="(hx509_cert p)" -->
521<div class="memitem">
522<div class="memproto">
523      <table class="memname">
524        <tr>
525          <td class="memname">time_t hx509_cert_get_notBefore           </td>
526          <td>(</td>
527          <td class="paramtype">hx509_cert&nbsp;</td>
528          <td class="paramname"> <em>p</em>          </td>
529          <td>&nbsp;)&nbsp;</td>
530          <td></td>
531        </tr>
532      </table>
533</div>
534<div class="memdoc">
535
536<p>
537Get notBefore time of the certificate.<p>
538<dl compact><dt><b>Parameters:</b></dt><dd>
539  <table border="0" cellspacing="2" cellpadding="0">
540    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object.</td></tr>
541  </table>
542</dl>
543<dl class="return" compact><dt><b>Returns:</b></dt><dd>return not before time </dd></dl>
544
545</div>
546</div><p>
547<a class="anchor" name="g2960bea38768b49c8b949fe2ea5320e3"></a><!-- doxytag: member="cert.c::hx509_cert_get_serialnumber" ref="g2960bea38768b49c8b949fe2ea5320e3" args="(hx509_cert p, heim_integer *i)" -->
548<div class="memitem">
549<div class="memproto">
550      <table class="memname">
551        <tr>
552          <td class="memname">int hx509_cert_get_serialnumber           </td>
553          <td>(</td>
554          <td class="paramtype">hx509_cert&nbsp;</td>
555          <td class="paramname"> <em>p</em>, </td>
556        </tr>
557        <tr>
558          <td class="paramkey"></td>
559          <td></td>
560          <td class="paramtype">heim_integer *&nbsp;</td>
561          <td class="paramname"> <em>i</em></td><td>&nbsp;</td>
562        </tr>
563        <tr>
564          <td></td>
565          <td>)</td>
566          <td></td><td></td><td></td>
567        </tr>
568      </table>
569</div>
570<div class="memdoc">
571
572<p>
573Get serial number of the certificate.<p>
574<dl compact><dt><b>Parameters:</b></dt><dd>
575  <table border="0" cellspacing="2" cellpadding="0">
576    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
577    <tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>serial number, should be freed ith der_free_heim_integer().</td></tr>
578  </table>
579</dl>
580<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>
581
582</div>
583</div><p>
584<a class="anchor" name="gc9e328025dd91339cf73eecdeec4ffd6"></a><!-- doxytag: member="cert.c::hx509_cert_get_SPKI" ref="gc9e328025dd91339cf73eecdeec4ffd6" args="(hx509_context context, hx509_cert p, SubjectPublicKeyInfo *spki)" -->
585<div class="memitem">
586<div class="memproto">
587      <table class="memname">
588        <tr>
589          <td class="memname">int hx509_cert_get_SPKI           </td>
590          <td>(</td>
591          <td class="paramtype">hx509_context&nbsp;</td>
592          <td class="paramname"> <em>context</em>, </td>
593        </tr>
594        <tr>
595          <td class="paramkey"></td>
596          <td></td>
597          <td class="paramtype">hx509_cert&nbsp;</td>
598          <td class="paramname"> <em>p</em>, </td>
599        </tr>
600        <tr>
601          <td class="paramkey"></td>
602          <td></td>
603          <td class="paramtype">SubjectPublicKeyInfo *&nbsp;</td>
604          <td class="paramname"> <em>spki</em></td><td>&nbsp;</td>
605        </tr>
606        <tr>
607          <td></td>
608          <td>)</td>
609          <td></td><td></td><td></td>
610        </tr>
611      </table>
612</div>
613<div class="memdoc">
614
615<p>
616Get the SubjectPublicKeyInfo structure from the hx509 certificate.<p>
617<dl compact><dt><b>Parameters:</b></dt><dd>
618  <table border="0" cellspacing="2" cellpadding="0">
619    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
620    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
621    <tr><td valign="top"></td><td valign="top"><em>spki</em>&nbsp;</td><td>SubjectPublicKeyInfo, should be freed with free_SubjectPublicKeyInfo().</td></tr>
622  </table>
623</dl>
624<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>
625
626</div>
627</div><p>
628<a class="anchor" name="gc2fd6cd8b1fbe0d470a88143a359c395"></a><!-- doxytag: member="cert.c::hx509_cert_get_SPKI_AlgorithmIdentifier" ref="gc2fd6cd8b1fbe0d470a88143a359c395" args="(hx509_context context, hx509_cert p, AlgorithmIdentifier *alg)" -->
629<div class="memitem">
630<div class="memproto">
631      <table class="memname">
632        <tr>
633          <td class="memname">int hx509_cert_get_SPKI_AlgorithmIdentifier           </td>
634          <td>(</td>
635          <td class="paramtype">hx509_context&nbsp;</td>
636          <td class="paramname"> <em>context</em>, </td>
637        </tr>
638        <tr>
639          <td class="paramkey"></td>
640          <td></td>
641          <td class="paramtype">hx509_cert&nbsp;</td>
642          <td class="paramname"> <em>p</em>, </td>
643        </tr>
644        <tr>
645          <td class="paramkey"></td>
646          <td></td>
647          <td class="paramtype">AlgorithmIdentifier *&nbsp;</td>
648          <td class="paramname"> <em>alg</em></td><td>&nbsp;</td>
649        </tr>
650        <tr>
651          <td></td>
652          <td>)</td>
653          <td></td><td></td><td></td>
654        </tr>
655      </table>
656</div>
657<div class="memdoc">
658
659<p>
660Get the AlgorithmIdentifier from the hx509 certificate.<p>
661<dl compact><dt><b>Parameters:</b></dt><dd>
662  <table border="0" cellspacing="2" cellpadding="0">
663    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
664    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
665    <tr><td valign="top"></td><td valign="top"><em>alg</em>&nbsp;</td><td>AlgorithmIdentifier, should be freed with free_AlgorithmIdentifier(). The algorithmidentifier is typicly rsaEncryption, or id-ecPublicKey, or some other public key mechanism.</td></tr>
666  </table>
667</dl>
668<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>
669
670</div>
671</div><p>
672<a class="anchor" name="g9f64bb8083bb535ccba007b723c73619"></a><!-- doxytag: member="cert.c::hx509_cert_get_subject" ref="g9f64bb8083bb535ccba007b723c73619" args="(hx509_cert p, hx509_name *name)" -->
673<div class="memitem">
674<div class="memproto">
675      <table class="memname">
676        <tr>
677          <td class="memname">int hx509_cert_get_subject           </td>
678          <td>(</td>
679          <td class="paramtype">hx509_cert&nbsp;</td>
680          <td class="paramname"> <em>p</em>, </td>
681        </tr>
682        <tr>
683          <td class="paramkey"></td>
684          <td></td>
685          <td class="paramtype">hx509_name *&nbsp;</td>
686          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
687        </tr>
688        <tr>
689          <td></td>
690          <td>)</td>
691          <td></td><td></td><td></td>
692        </tr>
693      </table>
694</div>
695<div class="memdoc">
696
697<p>
698Return the name of the subject of the hx509 certificate.<p>
699<dl compact><dt><b>Parameters:</b></dt><dd>
700  <table border="0" cellspacing="2" cellpadding="0">
701    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate object. </td></tr>
702    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>a pointer to a hx509 name, should be freed by <a class="el" href="group__hx509__name.html#gaf351931efb02fc7aea736af9977155e">hx509_name_free()</a>. See also <a class="el" href="group__hx509__cert.html#g5e8e38603eb13753912b0075aab276cf">hx509_cert_get_base_subject()</a>.</td></tr>
703  </table>
704</dl>
705<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>
706
707</div>
708</div><p>
709<a class="anchor" name="gc7184f4f0249842866d51b17e4b101fb"></a><!-- doxytag: member="cert.c::hx509_cert_get_subject_unique_id" ref="gc7184f4f0249842866d51b17e4b101fb" args="(hx509_context context, hx509_cert p, heim_bit_string *subject)" -->
710<div class="memitem">
711<div class="memproto">
712      <table class="memname">
713        <tr>
714          <td class="memname">int hx509_cert_get_subject_unique_id           </td>
715          <td>(</td>
716          <td class="paramtype">hx509_context&nbsp;</td>
717          <td class="paramname"> <em>context</em>, </td>
718        </tr>
719        <tr>
720          <td class="paramkey"></td>
721          <td></td>
722          <td class="paramtype">hx509_cert&nbsp;</td>
723          <td class="paramname"> <em>p</em>, </td>
724        </tr>
725        <tr>
726          <td class="paramkey"></td>
727          <td></td>
728          <td class="paramtype">heim_bit_string *&nbsp;</td>
729          <td class="paramname"> <em>subject</em></td><td>&nbsp;</td>
730        </tr>
731        <tr>
732          <td></td>
733          <td>)</td>
734          <td></td><td></td><td></td>
735        </tr>
736      </table>
737</div>
738<div class="memdoc">
739
740<p>
741Get a copy of the Subect Unique ID<p>
742<dl compact><dt><b>Parameters:</b></dt><dd>
743  <table border="0" cellspacing="2" cellpadding="0">
744    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509_context </td></tr>
745    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>a hx509 certificate </td></tr>
746    <tr><td valign="top"></td><td valign="top"><em>subject</em>&nbsp;</td><td>the subject id returned, free with der_free_bit_string()</td></tr>
747  </table>
748</dl>
749<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>. The error code HX509_EXTENSION_NOT_FOUND is returned if the certificate doesn't have a subjectUniqueID </dd></dl>
750
751</div>
752</div><p>
753<a class="anchor" name="g1aa420f664ce5933f8af4cf6c37fd6f6"></a><!-- doxytag: member="cert.c::hx509_cert_init" ref="g1aa420f664ce5933f8af4cf6c37fd6f6" args="(hx509_context context, const Certificate *c, hx509_cert *cert)" -->
754<div class="memitem">
755<div class="memproto">
756      <table class="memname">
757        <tr>
758          <td class="memname">int hx509_cert_init           </td>
759          <td>(</td>
760          <td class="paramtype">hx509_context&nbsp;</td>
761          <td class="paramname"> <em>context</em>, </td>
762        </tr>
763        <tr>
764          <td class="paramkey"></td>
765          <td></td>
766          <td class="paramtype">const Certificate *&nbsp;</td>
767          <td class="paramname"> <em>c</em>, </td>
768        </tr>
769        <tr>
770          <td class="paramkey"></td>
771          <td></td>
772          <td class="paramtype">hx509_cert *&nbsp;</td>
773          <td class="paramname"> <em>cert</em></td><td>&nbsp;</td>
774        </tr>
775        <tr>
776          <td></td>
777          <td>)</td>
778          <td></td><td></td><td></td>
779        </tr>
780      </table>
781</div>
782<div class="memdoc">
783
784<p>
785Allocate and init an hx509 certificate object from the decoded certificate `c´.<p>
786<dl compact><dt><b>Parameters:</b></dt><dd>
787  <table border="0" cellspacing="2" cellpadding="0">
788    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
789    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td></td></tr>
790    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td></td></tr>
791  </table>
792</dl>
793<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
794
795</div>
796</div><p>
797<a class="anchor" name="g479d8c1bf22aa8fdfa448bed1ec54d7b"></a><!-- doxytag: member="cert.c::hx509_cert_init_data" ref="g479d8c1bf22aa8fdfa448bed1ec54d7b" args="(hx509_context context, const void *ptr, size_t len, hx509_cert *cert)" -->
798<div class="memitem">
799<div class="memproto">
800      <table class="memname">
801        <tr>
802          <td class="memname">int hx509_cert_init_data           </td>
803          <td>(</td>
804          <td class="paramtype">hx509_context&nbsp;</td>
805          <td class="paramname"> <em>context</em>, </td>
806        </tr>
807        <tr>
808          <td class="paramkey"></td>
809          <td></td>
810          <td class="paramtype">const void *&nbsp;</td>
811          <td class="paramname"> <em>ptr</em>, </td>
812        </tr>
813        <tr>
814          <td class="paramkey"></td>
815          <td></td>
816          <td class="paramtype">size_t&nbsp;</td>
817          <td class="paramname"> <em>len</em>, </td>
818        </tr>
819        <tr>
820          <td class="paramkey"></td>
821          <td></td>
822          <td class="paramtype">hx509_cert *&nbsp;</td>
823          <td class="paramname"> <em>cert</em></td><td>&nbsp;</td>
824        </tr>
825        <tr>
826          <td></td>
827          <td>)</td>
828          <td></td><td></td><td></td>
829        </tr>
830      </table>
831</div>
832<div class="memdoc">
833
834<p>
835Just like <a class="el" href="group__hx509__cert.html#g1aa420f664ce5933f8af4cf6c37fd6f6">hx509_cert_init()</a>, but instead of a decode certificate takes an pointer and length to a memory region that contains a DER/BER encoded certificate.<p>
836If the memory region doesn't contain just the certificate and nothing more the function will fail with HX509_EXTRA_DATA_AFTER_STRUCTURE.<p>
837<dl compact><dt><b>Parameters:</b></dt><dd>
838  <table border="0" cellspacing="2" cellpadding="0">
839    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
840    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>pointer to memory region containing encoded certificate. </td></tr>
841    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>length of memory region. </td></tr>
842    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>a return pointer to a hx509 certificate object, will contain NULL on error.</td></tr>
843  </table>
844</dl>
845<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>
846
847</div>
848</div><p>
849<a class="anchor" name="g1870b485d4e8e53f75690f35f4526fcc"></a><!-- doxytag: member="cert.c::hx509_cert_ref" ref="g1870b485d4e8e53f75690f35f4526fcc" args="(hx509_cert cert)" -->
850<div class="memitem">
851<div class="memproto">
852      <table class="memname">
853        <tr>
854          <td class="memname">hx509_cert hx509_cert_ref           </td>
855          <td>(</td>
856          <td class="paramtype">hx509_cert&nbsp;</td>
857          <td class="paramname"> <em>cert</em>          </td>
858          <td>&nbsp;)&nbsp;</td>
859          <td></td>
860        </tr>
861      </table>
862</div>
863<div class="memdoc">
864
865<p>
866Add a reference to a hx509 certificate object.<p>
867<dl compact><dt><b>Parameters:</b></dt><dd>
868  <table border="0" cellspacing="2" cellpadding="0">
869    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>a pointer to an hx509 certificate object.</td></tr>
870  </table>
871</dl>
872<dl class="return" compact><dt><b>Returns:</b></dt><dd>the same object as is passed in. </dd></dl>
873
874</div>
875</div><p>
876<a class="anchor" name="g972768dbcc822fed1b74e7686b407f78"></a><!-- doxytag: member="cert.c::hx509_cert_set_friendly_name" ref="g972768dbcc822fed1b74e7686b407f78" args="(hx509_cert cert, const char *name)" -->
877<div class="memitem">
878<div class="memproto">
879      <table class="memname">
880        <tr>
881          <td class="memname">int hx509_cert_set_friendly_name           </td>
882          <td>(</td>
883          <td class="paramtype">hx509_cert&nbsp;</td>
884          <td class="paramname"> <em>cert</em>, </td>
885        </tr>
886        <tr>
887          <td class="paramkey"></td>
888          <td></td>
889          <td class="paramtype">const char *&nbsp;</td>
890          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
891        </tr>
892        <tr>
893          <td></td>
894          <td>)</td>
895          <td></td><td></td><td></td>
896        </tr>
897      </table>
898</div>
899<div class="memdoc">
900
901<p>
902Set the friendly name on the certificate.<p>
903<dl compact><dt><b>Parameters:</b></dt><dd>
904  <table border="0" cellspacing="2" cellpadding="0">
905    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>The certificate to set the friendly name on </td></tr>
906    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>Friendly name.</td></tr>
907  </table>
908</dl>
909<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>
910
911</div>
912</div><p>
913<a class="anchor" name="g32a804b17d97d71af17602fdf6b1c891"></a><!-- doxytag: member="cert.c::hx509_print_cert" ref="g32a804b17d97d71af17602fdf6b1c891" args="(hx509_context context, hx509_cert cert, FILE *out)" -->
914<div class="memitem">
915<div class="memproto">
916      <table class="memname">
917        <tr>
918          <td class="memname">int hx509_print_cert           </td>
919          <td>(</td>
920          <td class="paramtype">hx509_context&nbsp;</td>
921          <td class="paramname"> <em>context</em>, </td>
922        </tr>
923        <tr>
924          <td class="paramkey"></td>
925          <td></td>
926          <td class="paramtype">hx509_cert&nbsp;</td>
927          <td class="paramname"> <em>cert</em>, </td>
928        </tr>
929        <tr>
930          <td class="paramkey"></td>
931          <td></td>
932          <td class="paramtype">FILE *&nbsp;</td>
933          <td class="paramname"> <em>out</em></td><td>&nbsp;</td>
934        </tr>
935        <tr>
936          <td></td>
937          <td>)</td>
938          <td></td><td></td><td></td>
939        </tr>
940      </table>
941</div>
942<div class="memdoc">
943
944<p>
945Print a simple representation of a certificate<p>
946<dl compact><dt><b>Parameters:</b></dt><dd>
947  <table border="0" cellspacing="2" cellpadding="0">
948    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context, can be NULL </td></tr>
949    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>certificate to print </td></tr>
950    <tr><td valign="top"></td><td valign="top"><em>out</em>&nbsp;</td><td>the stdio output stream, if NULL, stdout is used</td></tr>
951  </table>
952</dl>
953<dl class="return" compact><dt><b>Returns:</b></dt><dd>An hx509 error code </dd></dl>
954
955</div>
956</div><p>
957<a class="anchor" name="g5833168d3181e12883b51284fd069543"></a><!-- doxytag: member="cert.c::hx509_query_alloc" ref="g5833168d3181e12883b51284fd069543" args="(hx509_context context, hx509_query **q)" -->
958<div class="memitem">
959<div class="memproto">
960      <table class="memname">
961        <tr>
962          <td class="memname">int hx509_query_alloc           </td>
963          <td>(</td>
964          <td class="paramtype">hx509_context&nbsp;</td>
965          <td class="paramname"> <em>context</em>, </td>
966        </tr>
967        <tr>
968          <td class="paramkey"></td>
969          <td></td>
970          <td class="paramtype">hx509_query **&nbsp;</td>
971          <td class="paramname"> <em>q</em></td><td>&nbsp;</td>
972        </tr>
973        <tr>
974          <td></td>
975          <td>)</td>
976          <td></td><td></td><td></td>
977        </tr>
978      </table>
979</div>
980<div class="memdoc">
981
982<p>
983Allocate an query controller. Free using <a class="el" href="group__hx509__cert.html#g6aafd01e9215fef980a572b2c7289d8c">hx509_query_free()</a>.<p>
984<dl compact><dt><b>Parameters:</b></dt><dd>
985  <table border="0" cellspacing="2" cellpadding="0">
986    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
987    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>return pointer to a hx509_query.</td></tr>
988  </table>
989</dl>
990<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>
991
992</div>
993</div><p>
994<a class="anchor" name="g6aafd01e9215fef980a572b2c7289d8c"></a><!-- doxytag: member="cert.c::hx509_query_free" ref="g6aafd01e9215fef980a572b2c7289d8c" args="(hx509_context context, hx509_query *q)" -->
995<div class="memitem">
996<div class="memproto">
997      <table class="memname">
998        <tr>
999          <td class="memname">void hx509_query_free           </td>
1000          <td>(</td>
1001          <td class="paramtype">hx509_context&nbsp;</td>
1002          <td class="paramname"> <em>context</em>, </td>
1003        </tr>
1004        <tr>
1005          <td class="paramkey"></td>
1006          <td></td>
1007          <td class="paramtype">hx509_query *&nbsp;</td>
1008          <td class="paramname"> <em>q</em></td><td>&nbsp;</td>
1009        </tr>
1010        <tr>
1011          <td></td>
1012          <td>)</td>
1013          <td></td><td></td><td></td>
1014        </tr>
1015      </table>
1016</div>
1017<div class="memdoc">
1018
1019<p>
1020Free the query controller.<p>
1021<dl compact><dt><b>Parameters:</b></dt><dd>
1022  <table border="0" cellspacing="2" cellpadding="0">
1023    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
1024    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>a pointer to the query controller. </td></tr>
1025  </table>
1026</dl>
1027
1028</div>
1029</div><p>
1030<a class="anchor" name="ge1660c0cf5a41f17db72a8c18e79c684"></a><!-- doxytag: member="cert.c::hx509_query_match_cmp_func" ref="ge1660c0cf5a41f17db72a8c18e79c684" args="(hx509_query *q, int(*func)(hx509_context, hx509_cert, void *), void *ctx)" -->
1031<div class="memitem">
1032<div class="memproto">
1033      <table class="memname">
1034        <tr>
1035          <td class="memname">int hx509_query_match_cmp_func           </td>
1036          <td>(</td>
1037          <td class="paramtype">hx509_query *&nbsp;</td>
1038          <td class="paramname"> <em>q</em>, </td>
1039        </tr>
1040        <tr>
1041          <td class="paramkey"></td>
1042          <td></td>
1043          <td class="paramtype">int(*)(hx509_context, hx509_cert, void *)&nbsp;</td>
1044          <td class="paramname"> <em>func</em>, </td>
1045        </tr>
1046        <tr>
1047          <td class="paramkey"></td>
1048          <td></td>
1049          <td class="paramtype">void *&nbsp;</td>
1050          <td class="paramname"> <em>ctx</em></td><td>&nbsp;</td>
1051        </tr>
1052        <tr>
1053          <td></td>
1054          <td>)</td>
1055          <td></td><td></td><td></td>
1056        </tr>
1057      </table>
1058</div>
1059<div class="memdoc">
1060
1061<p>
1062Set the query controller to match using a specific match function.<p>
1063<dl compact><dt><b>Parameters:</b></dt><dd>
1064  <table border="0" cellspacing="2" cellpadding="0">
1065    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>a hx509 query controller. </td></tr>
1066    <tr><td valign="top"></td><td valign="top"><em>func</em>&nbsp;</td><td>function to use for matching, if the argument is NULL, the match function is removed. </td></tr>
1067    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>context passed to the function.</td></tr>
1068  </table>
1069</dl>
1070<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>
1071
1072</div>
1073</div><p>
1074<a class="anchor" name="g5a7e01c75b7b8243356048a88133c2df"></a><!-- doxytag: member="cert.c::hx509_query_match_eku" ref="g5a7e01c75b7b8243356048a88133c2df" args="(hx509_query *q, const heim_oid *eku)" -->
1075<div class="memitem">
1076<div class="memproto">
1077      <table class="memname">
1078        <tr>
1079          <td class="memname">int hx509_query_match_eku           </td>
1080          <td>(</td>
1081          <td class="paramtype">hx509_query *&nbsp;</td>
1082          <td class="paramname"> <em>q</em>, </td>
1083        </tr>
1084        <tr>
1085          <td class="paramkey"></td>
1086          <td></td>
1087          <td class="paramtype">const heim_oid *&nbsp;</td>
1088          <td class="paramname"> <em>eku</em></td><td>&nbsp;</td>
1089        </tr>
1090        <tr>
1091          <td></td>
1092          <td>)</td>
1093          <td></td><td></td><td></td>
1094        </tr>
1095      </table>
1096</div>
1097<div class="memdoc">
1098
1099<p>
1100Set the query controller to require an one specific EKU (extended key usage). Any previous EKU matching is overwitten. If NULL is passed in as the eku, the EKU requirement is reset.<p>
1101<dl compact><dt><b>Parameters:</b></dt><dd>
1102  <table border="0" cellspacing="2" cellpadding="0">
1103    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>a hx509 query controller. </td></tr>
1104    <tr><td valign="top"></td><td valign="top"><em>eku</em>&nbsp;</td><td>an EKU to match on.</td></tr>
1105  </table>
1106</dl>
1107<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>
1108
1109</div>
1110</div><p>
1111<a class="anchor" name="g5be7b5ece155f2577335b5575f141362"></a><!-- doxytag: member="cert.c::hx509_query_match_friendly_name" ref="g5be7b5ece155f2577335b5575f141362" args="(hx509_query *q, const char *name)" -->
1112<div class="memitem">
1113<div class="memproto">
1114      <table class="memname">
1115        <tr>
1116          <td class="memname">int hx509_query_match_friendly_name           </td>
1117          <td>(</td>
1118          <td class="paramtype">hx509_query *&nbsp;</td>
1119          <td class="paramname"> <em>q</em>, </td>
1120        </tr>
1121        <tr>
1122          <td class="paramkey"></td>
1123          <td></td>
1124          <td class="paramtype">const char *&nbsp;</td>
1125          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
1126        </tr>
1127        <tr>
1128          <td></td>
1129          <td>)</td>
1130          <td></td><td></td><td></td>
1131        </tr>
1132      </table>
1133</div>
1134<div class="memdoc">
1135
1136<p>
1137Set the query controller to match on a friendly name<p>
1138<dl compact><dt><b>Parameters:</b></dt><dd>
1139  <table border="0" cellspacing="2" cellpadding="0">
1140    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>a hx509 query controller. </td></tr>
1141    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>a friendly name to match on</td></tr>
1142  </table>
1143</dl>
1144<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>
1145
1146</div>
1147</div><p>
1148<a class="anchor" name="gd5d7a68cc8ca4c948ae99b7eb6f5bc2e"></a><!-- doxytag: member="cert.c::hx509_query_match_issuer_serial" ref="gd5d7a68cc8ca4c948ae99b7eb6f5bc2e" args="(hx509_query *q, const Name *issuer, const heim_integer *serialNumber)" -->
1149<div class="memitem">
1150<div class="memproto">
1151      <table class="memname">
1152        <tr>
1153          <td class="memname">int hx509_query_match_issuer_serial           </td>
1154          <td>(</td>
1155          <td class="paramtype">hx509_query *&nbsp;</td>
1156          <td class="paramname"> <em>q</em>, </td>
1157        </tr>
1158        <tr>
1159          <td class="paramkey"></td>
1160          <td></td>
1161          <td class="paramtype">const Name *&nbsp;</td>
1162          <td class="paramname"> <em>issuer</em>, </td>
1163        </tr>
1164        <tr>
1165          <td class="paramkey"></td>
1166          <td></td>
1167          <td class="paramtype">const heim_integer *&nbsp;</td>
1168          <td class="paramname"> <em>serialNumber</em></td><td>&nbsp;</td>
1169        </tr>
1170        <tr>
1171          <td></td>
1172          <td>)</td>
1173          <td></td><td></td><td></td>
1174        </tr>
1175      </table>
1176</div>
1177<div class="memdoc">
1178
1179<p>
1180Set the issuer and serial number of match in the query controller. The function make copies of the isser and serial number.<p>
1181<dl compact><dt><b>Parameters:</b></dt><dd>
1182  <table border="0" cellspacing="2" cellpadding="0">
1183    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>a hx509 query controller </td></tr>
1184    <tr><td valign="top"></td><td valign="top"><em>issuer</em>&nbsp;</td><td>issuer to search for </td></tr>
1185    <tr><td valign="top"></td><td valign="top"><em>serialNumber</em>&nbsp;</td><td>the serialNumber of the issuer.</td></tr>
1186  </table>
1187</dl>
1188<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>
1189
1190</div>
1191</div><p>
1192<a class="anchor" name="gc708daef26edff5fd36f4587e61a9914"></a><!-- doxytag: member="cert.c::hx509_query_match_option" ref="gc708daef26edff5fd36f4587e61a9914" args="(hx509_query *q, hx509_query_option option)" -->
1193<div class="memitem">
1194<div class="memproto">
1195      <table class="memname">
1196        <tr>
1197          <td class="memname">void hx509_query_match_option           </td>
1198          <td>(</td>
1199          <td class="paramtype">hx509_query *&nbsp;</td>
1200          <td class="paramname"> <em>q</em>, </td>
1201        </tr>
1202        <tr>
1203          <td class="paramkey"></td>
1204          <td></td>
1205          <td class="paramtype">hx509_query_option&nbsp;</td>
1206          <td class="paramname"> <em>option</em></td><td>&nbsp;</td>
1207        </tr>
1208        <tr>
1209          <td></td>
1210          <td>)</td>
1211          <td></td><td></td><td></td>
1212        </tr>
1213      </table>
1214</div>
1215<div class="memdoc">
1216
1217<p>
1218Set match options for the hx509 query controller.<p>
1219<dl compact><dt><b>Parameters:</b></dt><dd>
1220  <table border="0" cellspacing="2" cellpadding="0">
1221    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>query controller. </td></tr>
1222    <tr><td valign="top"></td><td valign="top"><em>option</em>&nbsp;</td><td>options to control the query controller.</td></tr>
1223  </table>
1224</dl>
1225<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>
1226
1227</div>
1228</div><p>
1229<a class="anchor" name="g94b4aa7d907d34914e161831e74440a8"></a><!-- doxytag: member="cert.c::hx509_query_statistic_file" ref="g94b4aa7d907d34914e161831e74440a8" args="(hx509_context context, const char *fn)" -->
1230<div class="memitem">
1231<div class="memproto">
1232      <table class="memname">
1233        <tr>
1234          <td class="memname">void hx509_query_statistic_file           </td>
1235          <td>(</td>
1236          <td class="paramtype">hx509_context&nbsp;</td>
1237          <td class="paramname"> <em>context</em>, </td>
1238        </tr>
1239        <tr>
1240          <td class="paramkey"></td>
1241          <td></td>
1242          <td class="paramtype">const char *&nbsp;</td>
1243          <td class="paramname"> <em>fn</em></td><td>&nbsp;</td>
1244        </tr>
1245        <tr>
1246          <td></td>
1247          <td>)</td>
1248          <td></td><td></td><td></td>
1249        </tr>
1250      </table>
1251</div>
1252<div class="memdoc">
1253
1254<p>
1255Set a statistic file for the query statistics.<p>
1256<dl compact><dt><b>Parameters:</b></dt><dd>
1257  <table border="0" cellspacing="2" cellpadding="0">
1258    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
1259    <tr><td valign="top"></td><td valign="top"><em>fn</em>&nbsp;</td><td>statistics file name </td></tr>
1260  </table>
1261</dl>
1262
1263</div>
1264</div><p>
1265<a class="anchor" name="g522fb2a85515ce8debea860cdfeb94c0"></a><!-- doxytag: member="cert.c::hx509_query_unparse_stats" ref="g522fb2a85515ce8debea860cdfeb94c0" args="(hx509_context context, int printtype, FILE *out)" -->
1266<div class="memitem">
1267<div class="memproto">
1268      <table class="memname">
1269        <tr>
1270          <td class="memname">void hx509_query_unparse_stats           </td>
1271          <td>(</td>
1272          <td class="paramtype">hx509_context&nbsp;</td>
1273          <td class="paramname"> <em>context</em>, </td>
1274        </tr>
1275        <tr>
1276          <td class="paramkey"></td>
1277          <td></td>
1278          <td class="paramtype">int&nbsp;</td>
1279          <td class="paramname"> <em>printtype</em>, </td>
1280        </tr>
1281        <tr>
1282          <td class="paramkey"></td>
1283          <td></td>
1284          <td class="paramtype">FILE *&nbsp;</td>
1285          <td class="paramname"> <em>out</em></td><td>&nbsp;</td>
1286        </tr>
1287        <tr>
1288          <td></td>
1289          <td>)</td>
1290          <td></td><td></td><td></td>
1291        </tr>
1292      </table>
1293</div>
1294<div class="memdoc">
1295
1296<p>
1297Unparse the statistics file and print the result on a FILE descriptor.<p>
1298<dl compact><dt><b>Parameters:</b></dt><dd>
1299  <table border="0" cellspacing="2" cellpadding="0">
1300    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
1301    <tr><td valign="top"></td><td valign="top"><em>printtype</em>&nbsp;</td><td>tyep to print </td></tr>
1302    <tr><td valign="top"></td><td valign="top"><em>out</em>&nbsp;</td><td>the FILE to write the data on. </td></tr>
1303  </table>
1304</dl>
1305
1306</div>
1307</div><p>
1308<a class="anchor" name="gfb8063ac0396ad60392b8b9554c6b896"></a><!-- doxytag: member="cert.c::hx509_verify_ctx_f_allow_default_trustanchors" ref="gfb8063ac0396ad60392b8b9554c6b896" args="(hx509_verify_ctx ctx, int boolean)" -->
1309<div class="memitem">
1310<div class="memproto">
1311      <table class="memname">
1312        <tr>
1313          <td class="memname">void hx509_verify_ctx_f_allow_default_trustanchors           </td>
1314          <td>(</td>
1315          <td class="paramtype">hx509_verify_ctx&nbsp;</td>
1316          <td class="paramname"> <em>ctx</em>, </td>
1317        </tr>
1318        <tr>
1319          <td class="paramkey"></td>
1320          <td></td>
1321          <td class="paramtype">int&nbsp;</td>
1322          <td class="paramname"> <em>boolean</em></td><td>&nbsp;</td>
1323        </tr>
1324        <tr>
1325          <td></td>
1326          <td>)</td>
1327          <td></td><td></td><td></td>
1328        </tr>
1329      </table>
1330</div>
1331<div class="memdoc">
1332
1333<p>
1334Allow using the operating system builtin trust anchors if no other trust anchors are configured.<p>
1335<dl compact><dt><b>Parameters:</b></dt><dd>
1336  <table border="0" cellspacing="2" cellpadding="0">
1337    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>a verification context </td></tr>
1338    <tr><td valign="top"></td><td valign="top"><em>boolean</em>&nbsp;</td><td>if non zero, useing the operating systems builtin trust anchors.</td></tr>
1339  </table>
1340</dl>
1341<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>
1342
1343</div>
1344</div><p>
1345<a class="anchor" name="g5dc160f02aeffffb0eea58b6203c856a"></a><!-- doxytag: member="cert.c::hx509_verify_hostname" ref="g5dc160f02aeffffb0eea58b6203c856a" args="(hx509_context context, const hx509_cert cert, int flags, hx509_hostname_type type, const char *hostname, const struct sockaddr *sa, int sa_size)" -->
1346<div class="memitem">
1347<div class="memproto">
1348      <table class="memname">
1349        <tr>
1350          <td class="memname">int hx509_verify_hostname           </td>
1351          <td>(</td>
1352          <td class="paramtype">hx509_context&nbsp;</td>
1353          <td class="paramname"> <em>context</em>, </td>
1354        </tr>
1355        <tr>
1356          <td class="paramkey"></td>
1357          <td></td>
1358          <td class="paramtype">const hx509_cert&nbsp;</td>
1359          <td class="paramname"> <em>cert</em>, </td>
1360        </tr>
1361        <tr>
1362          <td class="paramkey"></td>
1363          <td></td>
1364          <td class="paramtype">int&nbsp;</td>
1365          <td class="paramname"> <em>flags</em>, </td>
1366        </tr>
1367        <tr>
1368          <td class="paramkey"></td>
1369          <td></td>
1370          <td class="paramtype">hx509_hostname_type&nbsp;</td>
1371          <td class="paramname"> <em>type</em>, </td>
1372        </tr>
1373        <tr>
1374          <td class="paramkey"></td>
1375          <td></td>
1376          <td class="paramtype">const char *&nbsp;</td>
1377          <td class="paramname"> <em>hostname</em>, </td>
1378        </tr>
1379        <tr>
1380          <td class="paramkey"></td>
1381          <td></td>
1382          <td class="paramtype">const struct sockaddr *&nbsp;</td>
1383          <td class="paramname"> <em>sa</em>, </td>
1384        </tr>
1385        <tr>
1386          <td class="paramkey"></td>
1387          <td></td>
1388          <td class="paramtype">int&nbsp;</td>
1389          <td class="paramname"> <em>sa_size</em></td><td>&nbsp;</td>
1390        </tr>
1391        <tr>
1392          <td></td>
1393          <td>)</td>
1394          <td></td><td></td><td></td>
1395        </tr>
1396      </table>
1397</div>
1398<div class="memdoc">
1399
1400<p>
1401Verify that the certificate is allowed to be used for the hostname and address.<p>
1402<dl compact><dt><b>Parameters:</b></dt><dd>
1403  <table border="0" cellspacing="2" cellpadding="0">
1404    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
1405    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>the certificate to match with </td></tr>
1406    <tr><td valign="top"></td><td valign="top"><em>flags</em>&nbsp;</td><td>Flags to modify the behavior:<ul>
1407<li>HX509_VHN_F_ALLOW_NO_MATCH no match is ok </li></ul>
1408</td></tr>
1409    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>type of hostname:<ul>
1410<li>HX509_HN_HOSTNAME for plain hostname.</li><li>HX509_HN_DNSSRV for DNS SRV names. </li></ul>
1411</td></tr>
1412    <tr><td valign="top"></td><td valign="top"><em>hostname</em>&nbsp;</td><td>the hostname to check </td></tr>
1413    <tr><td valign="top"></td><td valign="top"><em>sa</em>&nbsp;</td><td>address of the host </td></tr>
1414    <tr><td valign="top"></td><td valign="top"><em>sa_size</em>&nbsp;</td><td>length of address</td></tr>
1415  </table>
1416</dl>
1417<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>
1418
1419</div>
1420</div><p>
1421</div>
1422<hr size="1"><address style="text-align: right;"><small>
1423Generated 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>
1424</body>
1425</html>
1426