xref: /freebsd/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__keyset.html (revision 6a068746777241722b2b32c5d0bc443a2a64d80b)
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 store 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 store 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__keyset.html#g38cec16ab23ae65a6113f6e323a38032">hx509_certs_init</a> (hx509_context context, const char *name, int flags, hx509_lock lock, hx509_certs *certs)</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__keyset.html#g1dbde45fbffbaf909cd99b339f8641bd">hx509_certs_store</a> (hx509_context context, hx509_certs certs, int flags, hx509_lock lock)</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__keyset.html#ga3df96cfe4137beaea7e7b87b95dbe3f">hx509_certs_free</a> (hx509_certs *certs)</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__keyset.html#g8734f5269e166329c0b66d546187a4a9">hx509_certs_start_seq</a> (hx509_context context, hx509_certs certs, hx509_cursor *cursor)</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__keyset.html#g63c38b4729df8a074f191db831ac9db7">hx509_certs_next_cert</a> (hx509_context context, hx509_certs certs, hx509_cursor cursor, hx509_cert *cert)</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__keyset.html#g9f05c59f97dcfade924a72fe82cf9a16">hx509_certs_end_seq</a> (hx509_context context, hx509_certs certs, hx509_cursor cursor)</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__keyset.html#g4ba1d8deb9545c59b8f6bde86585014b">hx509_certs_iter_f</a> (hx509_context context, hx509_certs certs, int(*func)(hx509_context, void *, hx509_cert), void *ctx)</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__keyset.html#gee9789b91e1b425c17ddd6a5c1f2a834">hx509_ci_print_names</a> (hx509_context context, void *ctx, hx509_cert c)</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__keyset.html#g4ebe1ee219223b590bdf3e58dc2182da">hx509_certs_add</a> (hx509_context context, hx509_certs certs, hx509_cert cert)</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__keyset.html#g5f0c737b4dddb2a8c7bbab05b04ceb7a">hx509_certs_find</a> (hx509_context context, hx509_certs certs, const hx509_query *q, hx509_cert *r)</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__keyset.html#g1a7b21b477dc3a43286fd1ff96163609">hx509_certs_filter</a> (hx509_context context, hx509_certs certs, const hx509_query *q, hx509_certs *result)</td></tr>
46
47<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__keyset.html#g201bbf3425e451337abb26589202d9fe">hx509_certs_merge</a> (hx509_context context, hx509_certs to, hx509_certs from)</td></tr>
48
49<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__keyset.html#g5aa16e2f2d1bd1349e0586fdb53b85e6">hx509_certs_append</a> (hx509_context context, hx509_certs to, hx509_lock lock, const char *name)</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__keyset.html#g0457faff2ddddfbae50fa62ec1369072">hx509_get_one_cert</a> (hx509_context context, hx509_certs certs, hx509_cert *c)</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__keyset.html#g82fc84cff0a174d58e763ffe2c2a0aad">hx509_certs_info</a> (hx509_context context, hx509_certs certs, int(*func)(void *, const char *), void *ctx)</td></tr>
54
55</table>
56<hr><a name="_details"></a><h2>Detailed Description</h2>
57See the <a class="el" href="page_keyset.html">Certificate store operations</a> for description and examples. <hr><h2>Function Documentation</h2>
58<a class="anchor" name="g4ebe1ee219223b590bdf3e58dc2182da"></a><!-- doxytag: member="keyset.c::hx509_certs_add" ref="g4ebe1ee219223b590bdf3e58dc2182da" args="(hx509_context context, hx509_certs certs, hx509_cert cert)" -->
59<div class="memitem">
60<div class="memproto">
61      <table class="memname">
62        <tr>
63          <td class="memname">int hx509_certs_add           </td>
64          <td>(</td>
65          <td class="paramtype">hx509_context&nbsp;</td>
66          <td class="paramname"> <em>context</em>, </td>
67        </tr>
68        <tr>
69          <td class="paramkey"></td>
70          <td></td>
71          <td class="paramtype">hx509_certs&nbsp;</td>
72          <td class="paramname"> <em>certs</em>, </td>
73        </tr>
74        <tr>
75          <td class="paramkey"></td>
76          <td></td>
77          <td class="paramtype">hx509_cert&nbsp;</td>
78          <td class="paramname"> <em>cert</em></td><td>&nbsp;</td>
79        </tr>
80        <tr>
81          <td></td>
82          <td>)</td>
83          <td></td><td></td><td></td>
84        </tr>
85      </table>
86</div>
87<div class="memdoc">
88
89<p>
90Add a certificate to the certificiate store.<p>
91The receiving keyset certs will either increase reference counter of the cert or make a deep copy, either way, the caller needs to free the cert itself.<p>
92<dl compact><dt><b>Parameters:</b></dt><dd>
93  <table border="0" cellspacing="2" cellpadding="0">
94    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
95    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to add the certificate to. </td></tr>
96    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>certificate to add.</td></tr>
97  </table>
98</dl>
99<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
100
101</div>
102</div><p>
103<a class="anchor" name="g5aa16e2f2d1bd1349e0586fdb53b85e6"></a><!-- doxytag: member="keyset.c::hx509_certs_append" ref="g5aa16e2f2d1bd1349e0586fdb53b85e6" args="(hx509_context context, hx509_certs to, hx509_lock lock, const char *name)" -->
104<div class="memitem">
105<div class="memproto">
106      <table class="memname">
107        <tr>
108          <td class="memname">int hx509_certs_append           </td>
109          <td>(</td>
110          <td class="paramtype">hx509_context&nbsp;</td>
111          <td class="paramname"> <em>context</em>, </td>
112        </tr>
113        <tr>
114          <td class="paramkey"></td>
115          <td></td>
116          <td class="paramtype">hx509_certs&nbsp;</td>
117          <td class="paramname"> <em>to</em>, </td>
118        </tr>
119        <tr>
120          <td class="paramkey"></td>
121          <td></td>
122          <td class="paramtype">hx509_lock&nbsp;</td>
123          <td class="paramname"> <em>lock</em>, </td>
124        </tr>
125        <tr>
126          <td class="paramkey"></td>
127          <td></td>
128          <td class="paramtype">const char *&nbsp;</td>
129          <td class="paramname"> <em>name</em></td><td>&nbsp;</td>
130        </tr>
131        <tr>
132          <td></td>
133          <td>)</td>
134          <td></td><td></td><td></td>
135        </tr>
136      </table>
137</div>
138<div class="memdoc">
139
140<p>
141Same a <a class="el" href="group__hx509__keyset.html#g201bbf3425e451337abb26589202d9fe">hx509_certs_merge()</a> but use a lock and name to describe the from source.<p>
142<dl compact><dt><b>Parameters:</b></dt><dd>
143  <table border="0" cellspacing="2" cellpadding="0">
144    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
145    <tr><td valign="top"></td><td valign="top"><em>to</em>&nbsp;</td><td>the store to merge into. </td></tr>
146    <tr><td valign="top"></td><td valign="top"><em>lock</em>&nbsp;</td><td>a lock that unlocks the certificates store, use NULL to select no password/certifictes/prompt lock (see <a class="el" href="page_lock.html">Locking and unlocking certificates and encrypted data.</a>). </td></tr>
147    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>name of the source store</td></tr>
148  </table>
149</dl>
150<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
151
152</div>
153</div><p>
154<a class="anchor" name="g9f05c59f97dcfade924a72fe82cf9a16"></a><!-- doxytag: member="keyset.c::hx509_certs_end_seq" ref="g9f05c59f97dcfade924a72fe82cf9a16" args="(hx509_context context, hx509_certs certs, hx509_cursor cursor)" -->
155<div class="memitem">
156<div class="memproto">
157      <table class="memname">
158        <tr>
159          <td class="memname">int hx509_certs_end_seq           </td>
160          <td>(</td>
161          <td class="paramtype">hx509_context&nbsp;</td>
162          <td class="paramname"> <em>context</em>, </td>
163        </tr>
164        <tr>
165          <td class="paramkey"></td>
166          <td></td>
167          <td class="paramtype">hx509_certs&nbsp;</td>
168          <td class="paramname"> <em>certs</em>, </td>
169        </tr>
170        <tr>
171          <td class="paramkey"></td>
172          <td></td>
173          <td class="paramtype">hx509_cursor&nbsp;</td>
174          <td class="paramname"> <em>cursor</em></td><td>&nbsp;</td>
175        </tr>
176        <tr>
177          <td></td>
178          <td>)</td>
179          <td></td><td></td><td></td>
180        </tr>
181      </table>
182</div>
183<div class="memdoc">
184
185<p>
186End the iteration over certificates.<p>
187<dl compact><dt><b>Parameters:</b></dt><dd>
188  <table border="0" cellspacing="2" cellpadding="0">
189    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
190    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to iterate over. </td></tr>
191    <tr><td valign="top"></td><td valign="top"><em>cursor</em>&nbsp;</td><td>cursor that will keep track of progress, freed.</td></tr>
192  </table>
193</dl>
194<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
195
196</div>
197</div><p>
198<a class="anchor" name="g1a7b21b477dc3a43286fd1ff96163609"></a><!-- doxytag: member="keyset.c::hx509_certs_filter" ref="g1a7b21b477dc3a43286fd1ff96163609" args="(hx509_context context, hx509_certs certs, const hx509_query *q, hx509_certs *result)" -->
199<div class="memitem">
200<div class="memproto">
201      <table class="memname">
202        <tr>
203          <td class="memname">int hx509_certs_filter           </td>
204          <td>(</td>
205          <td class="paramtype">hx509_context&nbsp;</td>
206          <td class="paramname"> <em>context</em>, </td>
207        </tr>
208        <tr>
209          <td class="paramkey"></td>
210          <td></td>
211          <td class="paramtype">hx509_certs&nbsp;</td>
212          <td class="paramname"> <em>certs</em>, </td>
213        </tr>
214        <tr>
215          <td class="paramkey"></td>
216          <td></td>
217          <td class="paramtype">const hx509_query *&nbsp;</td>
218          <td class="paramname"> <em>q</em>, </td>
219        </tr>
220        <tr>
221          <td class="paramkey"></td>
222          <td></td>
223          <td class="paramtype">hx509_certs *&nbsp;</td>
224          <td class="paramname"> <em>result</em></td><td>&nbsp;</td>
225        </tr>
226        <tr>
227          <td></td>
228          <td>)</td>
229          <td></td><td></td><td></td>
230        </tr>
231      </table>
232</div>
233<div class="memdoc">
234
235<p>
236Filter certificate matching the query.<p>
237<dl compact><dt><b>Parameters:</b></dt><dd>
238  <table border="0" cellspacing="2" cellpadding="0">
239    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
240    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to search. </td></tr>
241    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>query allocated with <a class="el" href="group__hx509__query.html">hx509 query functions</a> functions. </td></tr>
242    <tr><td valign="top"></td><td valign="top"><em>result</em>&nbsp;</td><td>the filtered certificate store, caller must free with <a class="el" href="group__hx509__keyset.html#ga3df96cfe4137beaea7e7b87b95dbe3f">hx509_certs_free()</a>.</td></tr>
243  </table>
244</dl>
245<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
246
247<p>
248Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query.
249</div>
250</div><p>
251<a class="anchor" name="g5f0c737b4dddb2a8c7bbab05b04ceb7a"></a><!-- doxytag: member="keyset.c::hx509_certs_find" ref="g5f0c737b4dddb2a8c7bbab05b04ceb7a" args="(hx509_context context, hx509_certs certs, const hx509_query *q, hx509_cert *r)" -->
252<div class="memitem">
253<div class="memproto">
254      <table class="memname">
255        <tr>
256          <td class="memname">int hx509_certs_find           </td>
257          <td>(</td>
258          <td class="paramtype">hx509_context&nbsp;</td>
259          <td class="paramname"> <em>context</em>, </td>
260        </tr>
261        <tr>
262          <td class="paramkey"></td>
263          <td></td>
264          <td class="paramtype">hx509_certs&nbsp;</td>
265          <td class="paramname"> <em>certs</em>, </td>
266        </tr>
267        <tr>
268          <td class="paramkey"></td>
269          <td></td>
270          <td class="paramtype">const hx509_query *&nbsp;</td>
271          <td class="paramname"> <em>q</em>, </td>
272        </tr>
273        <tr>
274          <td class="paramkey"></td>
275          <td></td>
276          <td class="paramtype">hx509_cert *&nbsp;</td>
277          <td class="paramname"> <em>r</em></td><td>&nbsp;</td>
278        </tr>
279        <tr>
280          <td></td>
281          <td>)</td>
282          <td></td><td></td><td></td>
283        </tr>
284      </table>
285</div>
286<div class="memdoc">
287
288<p>
289Find a certificate matching the query.<p>
290<dl compact><dt><b>Parameters:</b></dt><dd>
291  <table border="0" cellspacing="2" cellpadding="0">
292    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
293    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to search. </td></tr>
294    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>query allocated with <a class="el" href="group__hx509__query.html">hx509 query functions</a> functions. </td></tr>
295    <tr><td valign="top"></td><td valign="top"><em>r</em>&nbsp;</td><td>return certificate (or NULL on error), should be freed with <a class="el" href="group__hx509__cert.html#gd2f9bb0ddc4babb26a8ccd983db8c948">hx509_cert_free()</a>.</td></tr>
296  </table>
297</dl>
298<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
299
300<p>
301Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query.
302</div>
303</div><p>
304<a class="anchor" name="ga3df96cfe4137beaea7e7b87b95dbe3f"></a><!-- doxytag: member="keyset.c::hx509_certs_free" ref="ga3df96cfe4137beaea7e7b87b95dbe3f" args="(hx509_certs *certs)" -->
305<div class="memitem">
306<div class="memproto">
307      <table class="memname">
308        <tr>
309          <td class="memname">void hx509_certs_free           </td>
310          <td>(</td>
311          <td class="paramtype">hx509_certs *&nbsp;</td>
312          <td class="paramname"> <em>certs</em>          </td>
313          <td>&nbsp;)&nbsp;</td>
314          <td></td>
315        </tr>
316      </table>
317</div>
318<div class="memdoc">
319
320<p>
321Free a certificate store.<p>
322<dl compact><dt><b>Parameters:</b></dt><dd>
323  <table border="0" cellspacing="2" cellpadding="0">
324    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to free. </td></tr>
325  </table>
326</dl>
327
328</div>
329</div><p>
330<a class="anchor" name="g82fc84cff0a174d58e763ffe2c2a0aad"></a><!-- doxytag: member="keyset.c::hx509_certs_info" ref="g82fc84cff0a174d58e763ffe2c2a0aad" args="(hx509_context context, hx509_certs certs, int(*func)(void *, const char *), void *ctx)" -->
331<div class="memitem">
332<div class="memproto">
333      <table class="memname">
334        <tr>
335          <td class="memname">int hx509_certs_info           </td>
336          <td>(</td>
337          <td class="paramtype">hx509_context&nbsp;</td>
338          <td class="paramname"> <em>context</em>, </td>
339        </tr>
340        <tr>
341          <td class="paramkey"></td>
342          <td></td>
343          <td class="paramtype">hx509_certs&nbsp;</td>
344          <td class="paramname"> <em>certs</em>, </td>
345        </tr>
346        <tr>
347          <td class="paramkey"></td>
348          <td></td>
349          <td class="paramtype">int(*)(void *, const char *)&nbsp;</td>
350          <td class="paramname"> <em>func</em>, </td>
351        </tr>
352        <tr>
353          <td class="paramkey"></td>
354          <td></td>
355          <td class="paramtype">void *&nbsp;</td>
356          <td class="paramname"> <em>ctx</em></td><td>&nbsp;</td>
357        </tr>
358        <tr>
359          <td></td>
360          <td>)</td>
361          <td></td><td></td><td></td>
362        </tr>
363      </table>
364</div>
365<div class="memdoc">
366
367<p>
368Print some info about the certificate store.<p>
369<dl compact><dt><b>Parameters:</b></dt><dd>
370  <table border="0" cellspacing="2" cellpadding="0">
371    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
372    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to print information about. </td></tr>
373    <tr><td valign="top"></td><td valign="top"><em>func</em>&nbsp;</td><td>function that will get each line of the information, if NULL is used the data is printed on a FILE descriptor that should be passed in ctx, if ctx also is NULL, stdout is used. </td></tr>
374    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>parameter to func.</td></tr>
375  </table>
376</dl>
377<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
378
379</div>
380</div><p>
381<a class="anchor" name="g38cec16ab23ae65a6113f6e323a38032"></a><!-- doxytag: member="keyset.c::hx509_certs_init" ref="g38cec16ab23ae65a6113f6e323a38032" args="(hx509_context context, const char *name, int flags, hx509_lock lock, hx509_certs *certs)" -->
382<div class="memitem">
383<div class="memproto">
384      <table class="memname">
385        <tr>
386          <td class="memname">int hx509_certs_init           </td>
387          <td>(</td>
388          <td class="paramtype">hx509_context&nbsp;</td>
389          <td class="paramname"> <em>context</em>, </td>
390        </tr>
391        <tr>
392          <td class="paramkey"></td>
393          <td></td>
394          <td class="paramtype">const char *&nbsp;</td>
395          <td class="paramname"> <em>name</em>, </td>
396        </tr>
397        <tr>
398          <td class="paramkey"></td>
399          <td></td>
400          <td class="paramtype">int&nbsp;</td>
401          <td class="paramname"> <em>flags</em>, </td>
402        </tr>
403        <tr>
404          <td class="paramkey"></td>
405          <td></td>
406          <td class="paramtype">hx509_lock&nbsp;</td>
407          <td class="paramname"> <em>lock</em>, </td>
408        </tr>
409        <tr>
410          <td class="paramkey"></td>
411          <td></td>
412          <td class="paramtype">hx509_certs *&nbsp;</td>
413          <td class="paramname"> <em>certs</em></td><td>&nbsp;</td>
414        </tr>
415        <tr>
416          <td></td>
417          <td>)</td>
418          <td></td><td></td><td></td>
419        </tr>
420      </table>
421</div>
422<div class="memdoc">
423
424<p>
425Open or creates a new hx509 certificate store.<p>
426<dl compact><dt><b>Parameters:</b></dt><dd>
427  <table border="0" cellspacing="2" cellpadding="0">
428    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context </td></tr>
429    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>name of the store, format is TYPE:type-specific-string, if NULL is used the MEMORY store is used. </td></tr>
430    <tr><td valign="top"></td><td valign="top"><em>flags</em>&nbsp;</td><td>list of flags:<ul>
431<li>HX509_CERTS_CREATE create a new keystore of the specific TYPE.</li><li>HX509_CERTS_UNPROTECT_ALL fails if any private key failed to be extracted. </li></ul>
432</td></tr>
433    <tr><td valign="top"></td><td valign="top"><em>lock</em>&nbsp;</td><td>a lock that unlocks the certificates store, use NULL to select no password/certifictes/prompt lock (see <a class="el" href="page_lock.html">Locking and unlocking certificates and encrypted data.</a>). </td></tr>
434    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>return pointer, free with <a class="el" href="group__hx509__keyset.html#ga3df96cfe4137beaea7e7b87b95dbe3f">hx509_certs_free()</a>. </td></tr>
435  </table>
436</dl>
437
438</div>
439</div><p>
440<a class="anchor" name="g4ba1d8deb9545c59b8f6bde86585014b"></a><!-- doxytag: member="keyset.c::hx509_certs_iter_f" ref="g4ba1d8deb9545c59b8f6bde86585014b" args="(hx509_context context, hx509_certs certs, int(*func)(hx509_context, void *, hx509_cert), void *ctx)" -->
441<div class="memitem">
442<div class="memproto">
443      <table class="memname">
444        <tr>
445          <td class="memname">int hx509_certs_iter_f           </td>
446          <td>(</td>
447          <td class="paramtype">hx509_context&nbsp;</td>
448          <td class="paramname"> <em>context</em>, </td>
449        </tr>
450        <tr>
451          <td class="paramkey"></td>
452          <td></td>
453          <td class="paramtype">hx509_certs&nbsp;</td>
454          <td class="paramname"> <em>certs</em>, </td>
455        </tr>
456        <tr>
457          <td class="paramkey"></td>
458          <td></td>
459          <td class="paramtype">int(*)(hx509_context, void *, hx509_cert)&nbsp;</td>
460          <td class="paramname"> <em>func</em>, </td>
461        </tr>
462        <tr>
463          <td class="paramkey"></td>
464          <td></td>
465          <td class="paramtype">void *&nbsp;</td>
466          <td class="paramname"> <em>ctx</em></td><td>&nbsp;</td>
467        </tr>
468        <tr>
469          <td></td>
470          <td>)</td>
471          <td></td><td></td><td></td>
472        </tr>
473      </table>
474</div>
475<div class="memdoc">
476
477<p>
478Iterate over all certificates in a keystore and call an function for each fo them.<p>
479<dl compact><dt><b>Parameters:</b></dt><dd>
480  <table border="0" cellspacing="2" cellpadding="0">
481    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
482    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to iterate over. </td></tr>
483    <tr><td valign="top"></td><td valign="top"><em>func</em>&nbsp;</td><td>function to call for each certificate. The function should return non-zero to abort the iteration, that value is passed back to the caller of <a class="el" href="group__hx509__keyset.html#g4ba1d8deb9545c59b8f6bde86585014b">hx509_certs_iter_f()</a>. </td></tr>
484    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>context variable that will passed to the function.</td></tr>
485  </table>
486</dl>
487<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
488
489</div>
490</div><p>
491<a class="anchor" name="g201bbf3425e451337abb26589202d9fe"></a><!-- doxytag: member="keyset.c::hx509_certs_merge" ref="g201bbf3425e451337abb26589202d9fe" args="(hx509_context context, hx509_certs to, hx509_certs from)" -->
492<div class="memitem">
493<div class="memproto">
494      <table class="memname">
495        <tr>
496          <td class="memname">int hx509_certs_merge           </td>
497          <td>(</td>
498          <td class="paramtype">hx509_context&nbsp;</td>
499          <td class="paramname"> <em>context</em>, </td>
500        </tr>
501        <tr>
502          <td class="paramkey"></td>
503          <td></td>
504          <td class="paramtype">hx509_certs&nbsp;</td>
505          <td class="paramname"> <em>to</em>, </td>
506        </tr>
507        <tr>
508          <td class="paramkey"></td>
509          <td></td>
510          <td class="paramtype">hx509_certs&nbsp;</td>
511          <td class="paramname"> <em>from</em></td><td>&nbsp;</td>
512        </tr>
513        <tr>
514          <td></td>
515          <td>)</td>
516          <td></td><td></td><td></td>
517        </tr>
518      </table>
519</div>
520<div class="memdoc">
521
522<p>
523Merge a certificate store into another. The from store is keep intact.<p>
524<dl compact><dt><b>Parameters:</b></dt><dd>
525  <table border="0" cellspacing="2" cellpadding="0">
526    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
527    <tr><td valign="top"></td><td valign="top"><em>to</em>&nbsp;</td><td>the store to merge into. </td></tr>
528    <tr><td valign="top"></td><td valign="top"><em>from</em>&nbsp;</td><td>the store to copy the object from.</td></tr>
529  </table>
530</dl>
531<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
532
533</div>
534</div><p>
535<a class="anchor" name="g63c38b4729df8a074f191db831ac9db7"></a><!-- doxytag: member="keyset.c::hx509_certs_next_cert" ref="g63c38b4729df8a074f191db831ac9db7" args="(hx509_context context, hx509_certs certs, hx509_cursor cursor, hx509_cert *cert)" -->
536<div class="memitem">
537<div class="memproto">
538      <table class="memname">
539        <tr>
540          <td class="memname">int hx509_certs_next_cert           </td>
541          <td>(</td>
542          <td class="paramtype">hx509_context&nbsp;</td>
543          <td class="paramname"> <em>context</em>, </td>
544        </tr>
545        <tr>
546          <td class="paramkey"></td>
547          <td></td>
548          <td class="paramtype">hx509_certs&nbsp;</td>
549          <td class="paramname"> <em>certs</em>, </td>
550        </tr>
551        <tr>
552          <td class="paramkey"></td>
553          <td></td>
554          <td class="paramtype">hx509_cursor&nbsp;</td>
555          <td class="paramname"> <em>cursor</em>, </td>
556        </tr>
557        <tr>
558          <td class="paramkey"></td>
559          <td></td>
560          <td class="paramtype">hx509_cert *&nbsp;</td>
561          <td class="paramname"> <em>cert</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 next ceritificate from the certificate keystore pointed out by cursor.<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>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
577    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to iterate over. </td></tr>
578    <tr><td valign="top"></td><td valign="top"><em>cursor</em>&nbsp;</td><td>cursor that keeps track of progress. </td></tr>
579    <tr><td valign="top"></td><td valign="top"><em>cert</em>&nbsp;</td><td>return certificate next in store, NULL if the store contains no more certificates. Free with <a class="el" href="group__hx509__cert.html#gd2f9bb0ddc4babb26a8ccd983db8c948">hx509_cert_free()</a>.</td></tr>
580  </table>
581</dl>
582<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
583
584</div>
585</div><p>
586<a class="anchor" name="g8734f5269e166329c0b66d546187a4a9"></a><!-- doxytag: member="keyset.c::hx509_certs_start_seq" ref="g8734f5269e166329c0b66d546187a4a9" args="(hx509_context context, hx509_certs certs, hx509_cursor *cursor)" -->
587<div class="memitem">
588<div class="memproto">
589      <table class="memname">
590        <tr>
591          <td class="memname">int hx509_certs_start_seq           </td>
592          <td>(</td>
593          <td class="paramtype">hx509_context&nbsp;</td>
594          <td class="paramname"> <em>context</em>, </td>
595        </tr>
596        <tr>
597          <td class="paramkey"></td>
598          <td></td>
599          <td class="paramtype">hx509_certs&nbsp;</td>
600          <td class="paramname"> <em>certs</em>, </td>
601        </tr>
602        <tr>
603          <td class="paramkey"></td>
604          <td></td>
605          <td class="paramtype">hx509_cursor *&nbsp;</td>
606          <td class="paramname"> <em>cursor</em></td><td>&nbsp;</td>
607        </tr>
608        <tr>
609          <td></td>
610          <td>)</td>
611          <td></td><td></td><td></td>
612        </tr>
613      </table>
614</div>
615<div class="memdoc">
616
617<p>
618Start the integration<p>
619<dl compact><dt><b>Parameters:</b></dt><dd>
620  <table border="0" cellspacing="2" cellpadding="0">
621    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
622    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to iterate over </td></tr>
623    <tr><td valign="top"></td><td valign="top"><em>cursor</em>&nbsp;</td><td>cursor that will keep track of progress, free with <a class="el" href="group__hx509__keyset.html#g9f05c59f97dcfade924a72fe82cf9a16">hx509_certs_end_seq()</a>.</td></tr>
624  </table>
625</dl>
626<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. HX509_UNSUPPORTED_OPERATION is returned if the certificate store doesn't support the iteration operation. </dd></dl>
627
628</div>
629</div><p>
630<a class="anchor" name="g1dbde45fbffbaf909cd99b339f8641bd"></a><!-- doxytag: member="keyset.c::hx509_certs_store" ref="g1dbde45fbffbaf909cd99b339f8641bd" args="(hx509_context context, hx509_certs certs, int flags, hx509_lock lock)" -->
631<div class="memitem">
632<div class="memproto">
633      <table class="memname">
634        <tr>
635          <td class="memname">int hx509_certs_store           </td>
636          <td>(</td>
637          <td class="paramtype">hx509_context&nbsp;</td>
638          <td class="paramname"> <em>context</em>, </td>
639        </tr>
640        <tr>
641          <td class="paramkey"></td>
642          <td></td>
643          <td class="paramtype">hx509_certs&nbsp;</td>
644          <td class="paramname"> <em>certs</em>, </td>
645        </tr>
646        <tr>
647          <td class="paramkey"></td>
648          <td></td>
649          <td class="paramtype">int&nbsp;</td>
650          <td class="paramname"> <em>flags</em>, </td>
651        </tr>
652        <tr>
653          <td class="paramkey"></td>
654          <td></td>
655          <td class="paramtype">hx509_lock&nbsp;</td>
656          <td class="paramname"> <em>lock</em></td><td>&nbsp;</td>
657        </tr>
658        <tr>
659          <td></td>
660          <td>)</td>
661          <td></td><td></td><td></td>
662        </tr>
663      </table>
664</div>
665<div class="memdoc">
666
667<p>
668Write the certificate store to stable storage.<p>
669<dl compact><dt><b>Parameters:</b></dt><dd>
670  <table border="0" cellspacing="2" cellpadding="0">
671    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>A hx509 context. </td></tr>
672    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>a certificate store to store. </td></tr>
673    <tr><td valign="top"></td><td valign="top"><em>flags</em>&nbsp;</td><td>currently unused, use 0. </td></tr>
674    <tr><td valign="top"></td><td valign="top"><em>lock</em>&nbsp;</td><td>a lock that unlocks the certificates store, use NULL to select no password/certifictes/prompt lock (see <a class="el" href="page_lock.html">Locking and unlocking certificates and encrypted data.</a>).</td></tr>
675  </table>
676</dl>
677<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. HX509_UNSUPPORTED_OPERATION if the certificate store doesn't support the store operation. </dd></dl>
678
679</div>
680</div><p>
681<a class="anchor" name="gee9789b91e1b425c17ddd6a5c1f2a834"></a><!-- doxytag: member="keyset.c::hx509_ci_print_names" ref="gee9789b91e1b425c17ddd6a5c1f2a834" args="(hx509_context context, void *ctx, hx509_cert c)" -->
682<div class="memitem">
683<div class="memproto">
684      <table class="memname">
685        <tr>
686          <td class="memname">int hx509_ci_print_names           </td>
687          <td>(</td>
688          <td class="paramtype">hx509_context&nbsp;</td>
689          <td class="paramname"> <em>context</em>, </td>
690        </tr>
691        <tr>
692          <td class="paramkey"></td>
693          <td></td>
694          <td class="paramtype">void *&nbsp;</td>
695          <td class="paramname"> <em>ctx</em>, </td>
696        </tr>
697        <tr>
698          <td class="paramkey"></td>
699          <td></td>
700          <td class="paramtype">hx509_cert&nbsp;</td>
701          <td class="paramname"> <em>c</em></td><td>&nbsp;</td>
702        </tr>
703        <tr>
704          <td></td>
705          <td>)</td>
706          <td></td><td></td><td></td>
707        </tr>
708      </table>
709</div>
710<div class="memdoc">
711
712<p>
713Iterate over all certificates in a keystore and call an function for each fo them.<p>
714<dl compact><dt><b>Parameters:</b></dt><dd>
715  <table border="0" cellspacing="2" cellpadding="0">
716    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
717    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>certificate store to iterate over. </td></tr>
718    <tr><td valign="top"></td><td valign="top"><em>func</em>&nbsp;</td><td>function to call for each certificate. The function should return non-zero to abort the iteration, that value is passed back to the caller of hx509_certs_iter().</td></tr>
719  </table>
720</dl>
721<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. Function to use to <a class="el" href="group__hx509__keyset.html#g4ba1d8deb9545c59b8f6bde86585014b">hx509_certs_iter_f()</a> as a function argument, the ctx variable to <a class="el" href="group__hx509__keyset.html#g4ba1d8deb9545c59b8f6bde86585014b">hx509_certs_iter_f()</a> should be a FILE file descriptor.</dd></dl>
722<dl compact><dt><b>Parameters:</b></dt><dd>
723  <table border="0" cellspacing="2" cellpadding="0">
724    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
725    <tr><td valign="top"></td><td valign="top"><em>ctx</em>&nbsp;</td><td>used by <a class="el" href="group__hx509__keyset.html#g4ba1d8deb9545c59b8f6bde86585014b">hx509_certs_iter_f()</a>. </td></tr>
726    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>a certificate</td></tr>
727  </table>
728</dl>
729<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
730
731</div>
732</div><p>
733<a class="anchor" name="g0457faff2ddddfbae50fa62ec1369072"></a><!-- doxytag: member="keyset.c::hx509_get_one_cert" ref="g0457faff2ddddfbae50fa62ec1369072" args="(hx509_context context, hx509_certs certs, hx509_cert *c)" -->
734<div class="memitem">
735<div class="memproto">
736      <table class="memname">
737        <tr>
738          <td class="memname">int hx509_get_one_cert           </td>
739          <td>(</td>
740          <td class="paramtype">hx509_context&nbsp;</td>
741          <td class="paramname"> <em>context</em>, </td>
742        </tr>
743        <tr>
744          <td class="paramkey"></td>
745          <td></td>
746          <td class="paramtype">hx509_certs&nbsp;</td>
747          <td class="paramname"> <em>certs</em>, </td>
748        </tr>
749        <tr>
750          <td class="paramkey"></td>
751          <td></td>
752          <td class="paramtype">hx509_cert *&nbsp;</td>
753          <td class="paramname"> <em>c</em></td><td>&nbsp;</td>
754        </tr>
755        <tr>
756          <td></td>
757          <td>)</td>
758          <td></td><td></td><td></td>
759        </tr>
760      </table>
761</div>
762<div class="memdoc">
763
764<p>
765Get one random certificate from the certificate store.<p>
766<dl compact><dt><b>Parameters:</b></dt><dd>
767  <table border="0" cellspacing="2" cellpadding="0">
768    <tr><td valign="top"></td><td valign="top"><em>context</em>&nbsp;</td><td>a hx509 context. </td></tr>
769    <tr><td valign="top"></td><td valign="top"><em>certs</em>&nbsp;</td><td>a certificate store to get the certificate from. </td></tr>
770    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>return certificate, should be freed with <a class="el" href="group__hx509__cert.html#gd2f9bb0ddc4babb26a8ccd983db8c948">hx509_cert_free()</a>.</td></tr>
771  </table>
772</dl>
773<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
774
775</div>
776</div><p>
777</div>
778<hr size="1"><address style="text-align: right;"><small>
779Generated 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>
780</body>
781</html>
782