<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Heimdalx509library: hx509 certificate store functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<p>
<a href="http://www.h5l.org/"><img src="http://www.h5l.org/keyhole-heimdal.png" alt="keyhole logo"/></a>
</p>
<!-- end of header marker -->
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>hx509 certificate store functions</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__keyset.html#g38cec16ab23ae65a6113f6e323a38032">hx509_certs_init</a> (hx509_context context, const char *name, int flags, hx509_lock lock, hx509_certs *certs)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hx509__keyset.html#ga3df96cfe4137beaea7e7b87b95dbe3f">hx509_certs_free</a> (hx509_certs *certs)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </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>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
See the <a class="el" href="page_keyset.html">Certificate store operations</a> for description and examples. <hr><h2>Function Documentation</h2>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_add </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cert </td>
<td class="paramname"> <em>cert</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add a certificate to the certificiate store.<p>
The 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>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to add the certificate to. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>cert</em> </td><td>certificate to add.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_append </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>to</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_lock </td>
<td class="paramname"> <em>lock</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>name</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Same 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>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>to</em> </td><td>the store to merge into. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>lock</em> </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>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>name of the source store</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_end_seq </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cursor </td>
<td class="paramname"> <em>cursor</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
End the iteration over certificates.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to iterate over. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>cursor</em> </td><td>cursor that will keep track of progress, freed.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_filter </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const hx509_query * </td>
<td class="paramname"> <em>q</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs * </td>
<td class="paramname"> <em>result</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Filter certificate matching the query.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to search. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>q</em> </td><td>query allocated with <a class="el" href="group__hx509__query.html">hx509 query functions</a> functions. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>result</em> </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>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
<p>
Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query.
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_find </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const hx509_query * </td>
<td class="paramname"> <em>q</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cert * </td>
<td class="paramname"> <em>r</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Find a certificate matching the query.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to search. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>q</em> </td><td>query allocated with <a class="el" href="group__hx509__query.html">hx509 query functions</a> functions. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>r</em> </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>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
<p>
Return HX509_CERT_NOT_FOUND if no certificate in certs matched the query.
</div>
</div><p>
<a class="anchor" name="ga3df96cfe4137beaea7e7b87b95dbe3f"></a><!-- doxytag: member="keyset.c::hx509_certs_free" ref="ga3df96cfe4137beaea7e7b87b95dbe3f" args="(hx509_certs *certs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void hx509_certs_free </td>
<td>(</td>
<td class="paramtype">hx509_certs * </td>
<td class="paramname"> <em>certs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Free a certificate store.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to free. </td></tr>
</table>
</dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_info </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int(*)(void *, const char *) </td>
<td class="paramname"> <em>func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>ctx</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Print some info about the certificate store.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to print information about. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>func</em> </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>
<tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>parameter to func.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_init </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_lock </td>
<td class="paramname"> <em>lock</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs * </td>
<td class="paramname"> <em>certs</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Open or creates a new hx509 certificate store.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>A hx509 context </td></tr>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>name of the store, format is TYPE:type-specific-string, if NULL is used the MEMORY store is used. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>list of flags:<ul>
<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>
</td></tr>
<tr><td valign="top"></td><td valign="top"><em>lock</em> </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>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>return pointer, free with <a class="el" href="group__hx509__keyset.html#ga3df96cfe4137beaea7e7b87b95dbe3f">hx509_certs_free()</a>. </td></tr>
</table>
</dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_iter_f </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int(*)(hx509_context, void *, hx509_cert) </td>
<td class="paramname"> <em>func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>ctx</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Iterate over all certificates in a keystore and call an function for each fo them.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to iterate over. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>func</em> </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>
<tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>context variable that will passed to the function.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_merge </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>to</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>from</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Merge a certificate store into another. The from store is keep intact.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>to</em> </td><td>the store to merge into. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>from</em> </td><td>the store to copy the object from.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_next_cert </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cursor </td>
<td class="paramname"> <em>cursor</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cert * </td>
<td class="paramname"> <em>cert</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get next ceritificate from the certificate keystore pointed out by cursor.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to iterate over. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>cursor</em> </td><td>cursor that keeps track of progress. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>cert</em> </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>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_start_seq </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cursor * </td>
<td class="paramname"> <em>cursor</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Start the integration<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to iterate over </td></tr>
<tr><td valign="top"></td><td valign="top"><em>cursor</em> </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>
</table>
</dl>
<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>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_certs_store </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>flags</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_lock </td>
<td class="paramname"> <em>lock</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Write the certificate store to stable storage.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>A hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>a certificate store to store. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>currently unused, use 0. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>lock</em> </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>
</table>
</dl>
<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>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_ci_print_names </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cert </td>
<td class="paramname"> <em>c</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Iterate over all certificates in a keystore and call an function for each fo them.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>certificate store to iterate over. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>func</em> </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>
</table>
</dl>
<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>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ctx</em> </td><td>used by <a class="el" href="group__hx509__keyset.html#g4ba1d8deb9545c59b8f6bde86585014b">hx509_certs_iter_f()</a>. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>c</em> </td><td>a certificate</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hx509_get_one_cert </td>
<td>(</td>
<td class="paramtype">hx509_context </td>
<td class="paramname"> <em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_certs </td>
<td class="paramname"> <em>certs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hx509_cert * </td>
<td class="paramname"> <em>c</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get one random certificate from the certificate store.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>a hx509 context. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>certs</em> </td><td>a certificate store to get the certificate from. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>c</em> </td><td>return certificate, should be freed with <a class="el" href="group__hx509__cert.html#gd2f9bb0ddc4babb26a8ccd983db8c948">hx509_cert_free()</a>.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Returns an hx509 error code. </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>