<refentry id="xmlsec-keysmngr">
<refmeta>
<refentrytitle role="top_of_page" id="xmlsec-keysmngr.top_of_page">keysmngr</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>XMLSEC Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>keysmngr</refname>
<refpurpose>Keys manager object support.</refpurpose>
</refnamediv>

<refsynopsisdiv id="xmlsec-keysmngr.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link>   <link linkend="xmlSecKeysMngrCreate">xmlSecKeysMngrCreate</link>                (void);
<link linkend="void">void</link>                <link linkend="xmlSecKeysMngrDestroy">xmlSecKeysMngrDestroy</link>               (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        <link linkend="xmlSecKeysMngrFindKey">xmlSecKeysMngrFindKey</link>               (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="xmlChar">xmlChar</link> *name,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);
<link linkend="int">int</link>                 <link linkend="xmlSecKeysMngrAdoptKeysStore">xmlSecKeysMngrAdoptKeysStore</link>        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);
<link linkend="xmlSecKeyStorePtr">xmlSecKeyStorePtr</link>   <link linkend="xmlSecKeysMngrGetKeysStore">xmlSecKeysMngrGetKeysStore</link>          (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);
<link linkend="int">int</link>                 <link linkend="xmlSecKeysMngrAdoptDataStore">xmlSecKeysMngrAdoptDataStore</link>        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKeyDataStore">xmlSecKeyDataStorePtr</link> store);
<link linkend="xmlSecKeyDataStorePtr">xmlSecKeyDataStorePtr</link>  <link linkend="xmlSecKeysMngrGetDataStore">xmlSecKeysMngrGetDataStore</link>       (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKeyDataStoreId">xmlSecKeyDataStoreId</link> id);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        (<link linkend="xmlSecGetKeyCallback">*xmlSecGetKeyCallback</link>)             (<link linkend="xmlNode">xmlNodePtr</link> keyInfoNode,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);
struct              <link linkend="xmlSecKeysMngr">xmlSecKeysMngr</link>;
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        <link linkend="xmlSecKeysMngrGetKey">xmlSecKeysMngrGetKey</link>                (<link linkend="xmlNode">xmlNodePtr</link> keyInfoNode,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);
struct              <link linkend="xmlSecKeyStore">xmlSecKeyStore</link>;
<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link>   <link linkend="xmlSecKeyStoreCreate">xmlSecKeyStoreCreate</link>                (<link linkend="xmlSecKeyStoreId">xmlSecKeyStoreId</link> id);
<link linkend="void">void</link>                <link linkend="xmlSecKeyStoreDestroy">xmlSecKeyStoreDestroy</link>               (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        <link linkend="xmlSecKeyStoreFindKey">xmlSecKeyStoreFindKey</link>               (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="xmlChar">xmlChar</link> *name,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);
#define             <link linkend="xmlSecKeyStoreGetName">xmlSecKeyStoreGetName</link>               (store)
#define             <link linkend="xmlSecKeyStoreIsValid">xmlSecKeyStoreIsValid</link>               (store)
#define             <link linkend="xmlSecKeyStoreCheckId">xmlSecKeyStoreCheckId</link>               (store, storeId)
#define             <link linkend="xmlSecKeyStoreCheckSize">xmlSecKeyStoreCheckSize</link>             (store, size)
#define             <link linkend="xmlSecKeyStoreIdUnknown">xmlSecKeyStoreIdUnknown</link>
<link linkend="int">int</link>                 (<link linkend="xmlSecKeyStoreInitializeMethod">*xmlSecKeyStoreInitializeMethod</link>)   (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);
<link linkend="void">void</link>                (<link linkend="xmlSecKeyStoreFinalizeMethod">*xmlSecKeyStoreFinalizeMethod</link>)     (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        (<link linkend="xmlSecKeyStoreFindKeyMethod">*xmlSecKeyStoreFindKeyMethod</link>)      (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="xmlChar">xmlChar</link> *name,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);
struct              <link linkend="xmlSecKeyStoreKlass">xmlSecKeyStoreKlass</link>;
#define             <link linkend="xmlSecKeyStoreKlassGetName">xmlSecKeyStoreKlassGetName</link>          (klass)
#define             <link linkend="xmlSecSimpleKeysStoreId">xmlSecSimpleKeysStoreId</link>
<link linkend="xmlSecKeyStoreId">xmlSecKeyStoreId</link>    <link linkend="xmlSecSimpleKeysStoreGetKlass">xmlSecSimpleKeysStoreGetKlass</link>       (void);
<link linkend="int">int</link>                 <link linkend="xmlSecSimpleKeysStoreAdoptKey">xmlSecSimpleKeysStoreAdoptKey</link>       (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         <link linkend="xmlSecKey">xmlSecKeyPtr</link> key);
<link linkend="int">int</link>                 <link linkend="xmlSecSimpleKeysStoreLoad">xmlSecSimpleKeysStoreLoad</link>           (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> keysMngr);
<link linkend="int">int</link>                 <link linkend="xmlSecSimpleKeysStoreSave">xmlSecSimpleKeysStoreSave</link>           (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);
<link linkend="xmlSecPtrListPtr">xmlSecPtrListPtr</link>    <link linkend="xmlSecSimpleKeysStoreGetKeys">xmlSecSimpleKeysStoreGetKeys</link>        (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);
</synopsis>
</refsynopsisdiv>









<refsect1 id="xmlsec-keysmngr.description" role="desc">
<title role="desc.title">Description</title>
<para>
Keys manager object support.
</para>
</refsect1>

<refsect1 id="xmlsec-keysmngr.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="xmlSecKeysMngrCreate" role="function">
<title>xmlSecKeysMngrCreate ()</title>
<indexterm zone="xmlSecKeysMngrCreate"><primary sortas="xmlSecKeysMngrCreate">xmlSecKeysMngrCreate</primary></indexterm><programlisting><link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link>   xmlSecKeysMngrCreate                (void);</programlisting>
<para>
Creates new keys manager. Caller is responsible for freeing it with
<link linkend="xmlSecKeysMngrDestroy"><type>xmlSecKeysMngrDestroy</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to newly allocated keys manager or NULL if
an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrDestroy" role="function">
<title>xmlSecKeysMngrDestroy ()</title>
<indexterm zone="xmlSecKeysMngrDestroy"><primary sortas="xmlSecKeysMngrDestroy">xmlSecKeysMngrDestroy</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecKeysMngrDestroy               (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);</programlisting>
<para>
Destroys keys manager created with <link linkend="xmlSecKeysMngrCreate"><type>xmlSecKeysMngrCreate</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the pointer to keys manager.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrFindKey" role="function">
<title>xmlSecKeysMngrFindKey ()</title>
<indexterm zone="xmlSecKeysMngrFindKey"><primary sortas="xmlSecKeysMngrFindKey">xmlSecKeysMngrFindKey</primary></indexterm><programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        xmlSecKeysMngrFindKey               (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="xmlChar">xmlChar</link> *name,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);</programlisting>
<para>
Lookups key in the keys manager keys store. The caller is responsible
for destroying the returned key using <link linkend="xmlSecKeyDestroy"><type>xmlSecKeyDestroy</type></link> method.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>               the desired key name.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keyInfoCtx</parameter>&#160;:</term>
<listitem><simpara>         the pointer to <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to a key or NULL if key is not found or an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrAdoptKeysStore" role="function">
<title>xmlSecKeysMngrAdoptKeysStore ()</title>
<indexterm zone="xmlSecKeysMngrAdoptKeysStore"><primary sortas="xmlSecKeysMngrAdoptKeysStore">xmlSecKeysMngrAdoptKeysStore</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecKeysMngrAdoptKeysStore        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);</programlisting>
<para>
Adopts keys store in the keys manager <parameter>mngr</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to keys store.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrGetKeysStore" role="function">
<title>xmlSecKeysMngrGetKeysStore ()</title>
<indexterm zone="xmlSecKeysMngrGetKeysStore"><primary sortas="xmlSecKeysMngrGetKeysStore">xmlSecKeysMngrGetKeysStore</primary></indexterm><programlisting><link linkend="xmlSecKeyStorePtr">xmlSecKeyStorePtr</link>   xmlSecKeysMngrGetKeysStore          (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);</programlisting>
<para>
Gets the keys store.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the keys store in the keys manager <parameter>mngr</parameter> or NULL if
there is no store or an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrAdoptDataStore" role="function">
<title>xmlSecKeysMngrAdoptDataStore ()</title>
<indexterm zone="xmlSecKeysMngrAdoptDataStore"><primary sortas="xmlSecKeysMngrAdoptDataStore">xmlSecKeysMngrAdoptDataStore</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecKeysMngrAdoptDataStore        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKeyDataStore">xmlSecKeyDataStorePtr</link> store);</programlisting>
<para>
Adopts data store in the keys manager.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to data store.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrGetDataStore" role="function">
<title>xmlSecKeysMngrGetDataStore ()</title>
<indexterm zone="xmlSecKeysMngrGetDataStore"><primary sortas="xmlSecKeysMngrGetDataStore">xmlSecKeysMngrGetDataStore</primary></indexterm><programlisting><link linkend="xmlSecKeyDataStorePtr">xmlSecKeyDataStorePtr</link>  xmlSecKeysMngrGetDataStore       (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKeyDataStoreId">xmlSecKeyDataStoreId</link> id);</programlisting>
<para>
Lookups the data store of given klass <parameter>id</parameter> in the keys manager.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>id</parameter>&#160;:</term>
<listitem><simpara>                 the desired data store klass.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to data store or NULL if it is not found or an error
occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecGetKeyCallback" role="function">
<title>xmlSecGetKeyCallback ()</title>
<indexterm zone="xmlSecGetKeyCallback"><primary sortas="xmlSecGetKeyCallback">xmlSecGetKeyCallback</primary></indexterm><programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        (*xmlSecGetKeyCallback)             (<link linkend="xmlNode">xmlNodePtr</link> keyInfoNode,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);</programlisting>
<para>
Reads the <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node <parameter>keyInfoNode</parameter> and extracts the key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>keyInfoNode</parameter>&#160;:</term>
<listitem><simpara>                the pointer to <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keyInfoCtx</parameter>&#160;:</term>
<listitem><simpara>                 the pointer to <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to key or NULL if the key is not found or
an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngr" role="struct">
<title>struct xmlSecKeysMngr</title>
<indexterm zone="xmlSecKeysMngr"><primary sortas="xmlSecKeysMngr">xmlSecKeysMngr</primary></indexterm><programlisting>struct xmlSecKeysMngr {
    xmlSecKeyStorePtr           keysStore;
    xmlSecPtrList               storesList;
    xmlSecGetKeyCallback        getKey;
};
</programlisting>
<para>
The keys manager structure.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link>&#160;<structfield>keysStore</structfield>;</term>
<listitem><simpara>                  the key store (list of keys known to keys manager).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecPtrList">xmlSecPtrList</link>&#160;<structfield>storesList</structfield>;</term>
<listitem><simpara>                 the list of key data stores known to keys manager.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecGetKeyCallback">xmlSecGetKeyCallback</link>&#160;<structfield>getKey</structfield>;</term>
<listitem><simpara>                     the callback used to read <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeysMngrGetKey" role="function">
<title>xmlSecKeysMngrGetKey ()</title>
<indexterm zone="xmlSecKeysMngrGetKey"><primary sortas="xmlSecKeysMngrGetKey">xmlSecKeysMngrGetKey</primary></indexterm><programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        xmlSecKeysMngrGetKey                (<link linkend="xmlNode">xmlNodePtr</link> keyInfoNode,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);</programlisting>
<para>
Reads the <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node <parameter>keyInfoNode</parameter> and extracts the key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>keyInfoNode</parameter>&#160;:</term>
<listitem><simpara>        the pointer to <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keyInfoCtx</parameter>&#160;:</term>
<listitem><simpara>         the pointer to <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to key or NULL if the key is not found or
an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStore" role="struct">
<title>struct xmlSecKeyStore</title>
<indexterm zone="xmlSecKeyStore"><primary sortas="xmlSecKeyStore">xmlSecKeyStore</primary></indexterm><programlisting>struct xmlSecKeyStore {
    xmlSecKeyStoreId                    id;

    /* for the future */
    void*                               reserved0;
    void*                               reserved1;
};
</programlisting>
<para>
The keys store.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="xmlSecKeyStoreId">xmlSecKeyStoreId</link>&#160;<structfield>id</structfield>;</term>
<listitem><simpara>                 the store id (<link linkend="xmlSecKeyStoreId"><type>xmlSecKeyStoreId</type></link>).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="void">void</link>&#160;*<structfield>reserved0</structfield>;</term>
<listitem><simpara>          reserved for the future.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="void">void</link>&#160;*<structfield>reserved1</structfield>;</term>
<listitem><simpara>          reserved for the future.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreCreate" role="function">
<title>xmlSecKeyStoreCreate ()</title>
<indexterm zone="xmlSecKeyStoreCreate"><primary sortas="xmlSecKeyStoreCreate">xmlSecKeyStoreCreate</primary></indexterm><programlisting><link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link>   xmlSecKeyStoreCreate                (<link linkend="xmlSecKeyStoreId">xmlSecKeyStoreId</link> id);</programlisting>
<para>
Creates new store of the specified klass <parameter>klass</parameter>. Caller is responsible
for freeing the returned store by calling <link linkend="xmlSecKeyStoreDestroy"><type>xmlSecKeyStoreDestroy</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>id</parameter>&#160;:</term>
<listitem><simpara>                 the key store klass.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to newly allocated keys store or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreDestroy" role="function">
<title>xmlSecKeyStoreDestroy ()</title>
<indexterm zone="xmlSecKeyStoreDestroy"><primary sortas="xmlSecKeyStoreDestroy">xmlSecKeyStoreDestroy</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecKeyStoreDestroy               (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);</programlisting>
<para>
Destroys the store created with <link linkend="xmlSecKeyStoreCreate"><type>xmlSecKeyStoreCreate</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to keys store.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreFindKey" role="function">
<title>xmlSecKeyStoreFindKey ()</title>
<indexterm zone="xmlSecKeyStoreFindKey"><primary sortas="xmlSecKeyStoreFindKey">xmlSecKeyStoreFindKey</primary></indexterm><programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        xmlSecKeyStoreFindKey               (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="xmlChar">xmlChar</link> *name,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);</programlisting>
<para>
Lookups key in the store. The caller is responsible for destroying
the returned key using <link linkend="xmlSecKeyDestroy"><type>xmlSecKeyDestroy</type></link> method.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to keys store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>               the desired key name.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keyInfoCtx</parameter>&#160;:</term>
<listitem><simpara>         the pointer to <ulink URL="http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo">&lt;dsig:KeyInfo/&gt;</ulink> node processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to a key or NULL if key is not found or an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreGetName" role="macro">
<title>xmlSecKeyStoreGetName()</title>
<indexterm zone="xmlSecKeyStoreGetName"><primary sortas="xmlSecKeyStoreGetName">xmlSecKeyStoreGetName</primary></indexterm><programlisting>#define             xmlSecKeyStoreGetName(store)</programlisting>
<para>
Macro. Returns key store name.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to store.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreIsValid" role="macro">
<title>xmlSecKeyStoreIsValid()</title>
<indexterm zone="xmlSecKeyStoreIsValid"><primary sortas="xmlSecKeyStoreIsValid">xmlSecKeyStoreIsValid</primary></indexterm><programlisting>#define             xmlSecKeyStoreIsValid(store)</programlisting>
<para>
Macro. Returns 1 if <parameter>store</parameter> is not NULL and <parameter>store</parameter>-&gt;id is not NULL
or 0 otherwise.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to store.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreCheckId" role="macro">
<title>xmlSecKeyStoreCheckId()</title>
<indexterm zone="xmlSecKeyStoreCheckId"><primary sortas="xmlSecKeyStoreCheckId">xmlSecKeyStoreCheckId</primary></indexterm><programlisting>#define             xmlSecKeyStoreCheckId(store, storeId)</programlisting>
<para>
Macro. Returns 1 if <parameter>store</parameter> is valid and <parameter>store</parameter>'s id is equal to <parameter>storeId</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>storeId</parameter>&#160;:</term>
<listitem><simpara>            the store Id.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreCheckSize" role="macro">
<title>xmlSecKeyStoreCheckSize()</title>
<indexterm zone="xmlSecKeyStoreCheckSize"><primary sortas="xmlSecKeyStoreCheckSize">xmlSecKeyStoreCheckSize</primary></indexterm><programlisting>#define             xmlSecKeyStoreCheckSize(store, size)</programlisting>
<para>
Macro. Returns 1 if <parameter>store</parameter> is valid and <parameter>stores</parameter>'s object has at least <parameter>size</parameter> bytes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>               the expected size.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreIdUnknown" role="macro">
<title>xmlSecKeyStoreIdUnknown</title>
<indexterm zone="xmlSecKeyStoreIdUnknown"><primary sortas="xmlSecKeyStoreIdUnknown">xmlSecKeyStoreIdUnknown</primary></indexterm><programlisting>#define xmlSecKeyStoreIdUnknown                         ((xmlSecKeyDataStoreId)NULL)
</programlisting>
<para>
The "unknown" id.</para>
<para>
</para></refsect2>
<refsect2 id="xmlSecKeyStoreInitializeMethod" role="function">
<title>xmlSecKeyStoreInitializeMethod ()</title>
<indexterm zone="xmlSecKeyStoreInitializeMethod"><primary sortas="xmlSecKeyStoreInitializeMethod">xmlSecKeyStoreInitializeMethod</primary></indexterm><programlisting><link linkend="int">int</link>                 (*xmlSecKeyStoreInitializeMethod)   (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);</programlisting>
<para>
Keys store specific initialization method.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the store.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreFinalizeMethod" role="function">
<title>xmlSecKeyStoreFinalizeMethod ()</title>
<indexterm zone="xmlSecKeyStoreFinalizeMethod"><primary sortas="xmlSecKeyStoreFinalizeMethod">xmlSecKeyStoreFinalizeMethod</primary></indexterm><programlisting><link linkend="void">void</link>                (*xmlSecKeyStoreFinalizeMethod)     (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);</programlisting>
<para>
Keys store specific finalization (destroy) method.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the store.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreFindKeyMethod" role="function">
<title>xmlSecKeyStoreFindKeyMethod ()</title>
<indexterm zone="xmlSecKeyStoreFindKeyMethod"><primary sortas="xmlSecKeyStoreFindKeyMethod">xmlSecKeyStoreFindKeyMethod</primary></indexterm><programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link>        (*xmlSecKeyStoreFindKeyMethod)      (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="xmlChar">xmlChar</link> *name,
                                                         <link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtxPtr</link> keyInfoCtx);</programlisting>
<para>
Keys store specific find method. The caller is responsible for destroying
the returned key using <link linkend="xmlSecKeyDestroy"><type>xmlSecKeyDestroy</type></link> method.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara>               the desired key name.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keyInfoCtx</parameter>&#160;:</term>
<listitem><simpara>         the pointer to key info context.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the pointer to a key or NULL if key is not found or an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreKlass" role="struct">
<title>struct xmlSecKeyStoreKlass</title>
<indexterm zone="xmlSecKeyStoreKlass"><primary sortas="xmlSecKeyStoreKlass">xmlSecKeyStoreKlass</primary></indexterm><programlisting>struct xmlSecKeyStoreKlass {
    xmlSecSize                          klassSize;
    xmlSecSize                          objSize;

    /* data */
    const xmlChar*                      name;

    /* constructors/destructor */
    xmlSecKeyStoreInitializeMethod      initialize;
    xmlSecKeyStoreFinalizeMethod        finalize;
    xmlSecKeyStoreFindKeyMethod         findKey;

    /* for the future */
    void*                               reserved0;
    void*                               reserved1;
};
</programlisting>
<para>
The keys store id (klass).</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="xmlSecSize">xmlSecSize</link>&#160;<structfield>klassSize</structfield>;</term>
<listitem><simpara>          the store klass size.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecSize">xmlSecSize</link>&#160;<structfield>objSize</structfield>;</term>
<listitem><simpara>            the store obj size.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>const&#160;<link linkend="xmlChar">xmlChar</link>&#160;*<structfield>name</structfield>;</term>
<listitem><simpara>               the store's name.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecKeyStoreInitializeMethod">xmlSecKeyStoreInitializeMethod</link>&#160;<structfield>initialize</structfield>;</term>
<listitem><simpara>         the store's initialization method.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecKeyStoreFinalizeMethod">xmlSecKeyStoreFinalizeMethod</link>&#160;<structfield>finalize</structfield>;</term>
<listitem><simpara>           the store's finalization (destroy) method.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecKeyStoreFindKeyMethod">xmlSecKeyStoreFindKeyMethod</link>&#160;<structfield>findKey</structfield>;</term>
<listitem><simpara>            the store's find method.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="void">void</link>&#160;*<structfield>reserved0</structfield>;</term>
<listitem><simpara>          reserved for the future.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="void">void</link>&#160;*<structfield>reserved1</structfield>;</term>
<listitem><simpara>          reserved for the future.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecKeyStoreKlassGetName" role="macro">
<title>xmlSecKeyStoreKlassGetName()</title>
<indexterm zone="xmlSecKeyStoreKlassGetName"><primary sortas="xmlSecKeyStoreKlassGetName">xmlSecKeyStoreKlassGetName</primary></indexterm><programlisting>#define             xmlSecKeyStoreKlassGetName(klass)</programlisting>
<para>
Macro. Returns store klass name.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>klass</parameter>&#160;:</term>
<listitem><simpara>              the pointer to store klass.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecSimpleKeysStoreId" role="macro">
<title>xmlSecSimpleKeysStoreId</title>
<indexterm zone="xmlSecSimpleKeysStoreId"><primary sortas="xmlSecSimpleKeysStoreId">xmlSecSimpleKeysStoreId</primary></indexterm><programlisting>#define xmlSecSimpleKeysStoreId         xmlSecSimpleKeysStoreGetKlass()
</programlisting>
<para>
A simple keys store klass id.</para>
<para>
</para></refsect2>
<refsect2 id="xmlSecSimpleKeysStoreGetKlass" role="function">
<title>xmlSecSimpleKeysStoreGetKlass ()</title>
<indexterm zone="xmlSecSimpleKeysStoreGetKlass"><primary sortas="xmlSecSimpleKeysStoreGetKlass">xmlSecSimpleKeysStoreGetKlass</primary></indexterm><programlisting><link linkend="xmlSecKeyStoreId">xmlSecKeyStoreId</link>    xmlSecSimpleKeysStoreGetKlass       (void);</programlisting>
<para>
The simple list based keys store klass.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> simple list based keys store klass.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecSimpleKeysStoreAdoptKey" role="function">
<title>xmlSecSimpleKeysStoreAdoptKey ()</title>
<indexterm zone="xmlSecSimpleKeysStoreAdoptKey"><primary sortas="xmlSecSimpleKeysStoreAdoptKey">xmlSecSimpleKeysStoreAdoptKey</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecSimpleKeysStoreAdoptKey       (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         <link linkend="xmlSecKey">xmlSecKeyPtr</link> key);</programlisting>
<para>
Adds <parameter>key</parameter> to the <parameter>store</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to simple keys store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara>                the pointer to key.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecSimpleKeysStoreLoad" role="function">
<title>xmlSecSimpleKeysStoreLoad ()</title>
<indexterm zone="xmlSecSimpleKeysStoreLoad"><primary sortas="xmlSecSimpleKeysStoreLoad">xmlSecSimpleKeysStoreLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecSimpleKeysStoreLoad           (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> keysMngr);</programlisting>
<para>
Reads keys from an XML file.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to simple keys store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>                the filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keysMngr</parameter>&#160;:</term>
<listitem><simpara>           the pointer to associated keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecSimpleKeysStoreSave" role="function">
<title>xmlSecSimpleKeysStoreSave ()</title>
<indexterm zone="xmlSecSimpleKeysStoreSave"><primary sortas="xmlSecSimpleKeysStoreSave">xmlSecSimpleKeysStoreSave</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecSimpleKeysStoreSave           (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);</programlisting>
<para>
Writes keys from <parameter>store</parameter> to an XML file.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to simple keys store.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara>           the filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>               the saved keys type (public, private, ...).
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecSimpleKeysStoreGetKeys" role="function">
<title>xmlSecSimpleKeysStoreGetKeys ()</title>
<indexterm zone="xmlSecSimpleKeysStoreGetKeys"><primary sortas="xmlSecSimpleKeysStoreGetKeys">xmlSecSimpleKeysStoreGetKeys</primary></indexterm><programlisting><link linkend="xmlSecPtrListPtr">xmlSecPtrListPtr</link>    xmlSecSimpleKeysStoreGetKeys        (<link linkend="xmlSecKeyStore">xmlSecKeyStorePtr</link> store);</programlisting>
<para>
Gets list of keys from simple keys store.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>store</parameter>&#160;:</term>
<listitem><simpara>              the pointer to simple keys store.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the list of keys stored in the keys store or NULL
if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
