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

<refnamediv>
<refname>app</refname>
<refpurpose>Application functions implementation for OpenSSL.</refpurpose>
</refnamediv>

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

<synopsis>
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppInit">xmlSecOpenSSLAppInit</link>                (const <link linkend="char">char</link> *config);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppShutdown">xmlSecOpenSSLAppShutdown</link>            (void);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppDefaultKeysMngrInit">xmlSecOpenSSLAppDefaultKeysMngrInit</link> (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppDefaultKeysMngrAdoptKey">xmlSecOpenSSLAppDefaultKeysMngrAdoptKey</link>
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKey">xmlSecKeyPtr</link> key);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppDefaultKeysMngrLoad">xmlSecOpenSSLAppDefaultKeysMngrLoad</link> (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *uri);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppDefaultKeysMngrSave">xmlSecOpenSSLAppDefaultKeysMngrSave</link> (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeysMngrCertLoad">xmlSecOpenSSLAppKeysMngrCertLoad</link>    (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeysMngrCertLoadMemory">xmlSecOpenSSLAppKeysMngrCertLoadMemory</link>
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeysMngrCertLoadBIO">xmlSecOpenSSLAppKeysMngrCertLoadBIO</link> (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeysMngrAddCertsPath">xmlSecOpenSSLAppKeysMngrAddCertsPath</link>
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *path);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeysMngrAddCertsFile">xmlSecOpenSSLAppKeysMngrAddCertsFile</link>
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *file);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppKeyLoad">xmlSecOpenSSLAppKeyLoad</link>             (const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppKeyLoadMemory">xmlSecOpenSSLAppKeyLoadMemory</link>       (const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppKeyLoadBIO">xmlSecOpenSSLAppKeyLoadBIO</link>          (<link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppPkcs12Load">xmlSecOpenSSLAppPkcs12Load</link>          (const <link linkend="char">char</link> *filename,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppPkcs12LoadMemory">xmlSecOpenSSLAppPkcs12LoadMemory</link>    (const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppPkcs12LoadBIO">xmlSecOpenSSLAppPkcs12LoadBIO</link>       (<link linkend="BIO--CAPS">BIO</link> *bio,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeyCertLoad">xmlSecOpenSSLAppKeyCertLoad</link>         (<link linkend="xmlSecKey">xmlSecKeyPtr</link> key,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeyCertLoadMemory">xmlSecOpenSSLAppKeyCertLoadMemory</link>   (<link linkend="xmlSecKey">xmlSecKeyPtr</link> key,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);
<link linkend="int">int</link>                 <link linkend="xmlSecOpenSSLAppKeyCertLoadBIO">xmlSecOpenSSLAppKeyCertLoadBIO</link>      (<link linkend="xmlSecKey">xmlSecKeyPtr</link> key,
                                                         <link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);
<link linkend="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecOpenSSLAppKeyFromCertLoadBIO">xmlSecOpenSSLAppKeyFromCertLoadBIO</link>  (<link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);
<link linkend="void">void</link>*               <link linkend="xmlSecOpenSSLAppGetDefaultPwdCallback">xmlSecOpenSSLAppGetDefaultPwdCallback</link>
                                                        (void);
</synopsis>
</refsynopsisdiv>









<refsect1 id="xmlsec-openssl-app.description" role="desc">
<title role="desc.title">Description</title>
<para>
Application functions implementation for OpenSSL.
</para>
</refsect1>

<refsect1 id="xmlsec-openssl-app.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="xmlSecOpenSSLAppInit" role="function">
<title>xmlSecOpenSSLAppInit ()</title>
<indexterm zone="xmlSecOpenSSLAppInit"><primary sortas="xmlSecOpenSSLAppInit">xmlSecOpenSSLAppInit</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppInit                (const <link linkend="char">char</link> *config);</programlisting>
<para>
General crypto engine initialization. This function is used
by XMLSec command line utility and called before
<parameter>xmlSecInit</parameter> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>config</parameter>&#160;:</term>
<listitem><simpara>             the path to certs.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppShutdown" role="function">
<title>xmlSecOpenSSLAppShutdown ()</title>
<indexterm zone="xmlSecOpenSSLAppShutdown"><primary sortas="xmlSecOpenSSLAppShutdown">xmlSecOpenSSLAppShutdown</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppShutdown            (void);</programlisting>
<para>
General crypto engine shutdown. This function is used
by XMLSec command line utility and called after
<parameter>xmlSecShutdown</parameter> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppDefaultKeysMngrInit" role="function">
<title>xmlSecOpenSSLAppDefaultKeysMngrInit ()</title>
<indexterm zone="xmlSecOpenSSLAppDefaultKeysMngrInit"><primary sortas="xmlSecOpenSSLAppDefaultKeysMngrInit">xmlSecOpenSSLAppDefaultKeysMngrInit</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppDefaultKeysMngrInit (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);</programlisting>
<para>
Initializes <parameter>mngr</parameter> with simple keys store <link linkend="xmlSecSimpleKeysStoreId"><type>xmlSecSimpleKeysStoreId</type></link>
and a default OpenSSL crypto key data stores.</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> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppDefaultKeysMngrAdoptKey" role="function">
<title>xmlSecOpenSSLAppDefaultKeysMngrAdoptKey ()</title>
<indexterm zone="xmlSecOpenSSLAppDefaultKeysMngrAdoptKey"><primary sortas="xmlSecOpenSSLAppDefaultKeysMngrAdoptKey">xmlSecOpenSSLAppDefaultKeysMngrAdoptKey</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppDefaultKeysMngrAdoptKey
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKey">xmlSecKeyPtr</link> key);</programlisting>
<para>
Adds <parameter>key</parameter> to the keys manager <parameter>mngr</parameter> created with <link linkend="xmlSecOpenSSLAppDefaultKeysMngrInit"><type>xmlSecOpenSSLAppDefaultKeysMngrInit</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>
<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 otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppDefaultKeysMngrLoad" role="function">
<title>xmlSecOpenSSLAppDefaultKeysMngrLoad ()</title>
<indexterm zone="xmlSecOpenSSLAppDefaultKeysMngrLoad"><primary sortas="xmlSecOpenSSLAppDefaultKeysMngrLoad">xmlSecOpenSSLAppDefaultKeysMngrLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppDefaultKeysMngrLoad (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *uri);</programlisting>
<para>
Loads XML keys file from <parameter>uri</parameter> to the keys manager <parameter>mngr</parameter> created
with <link linkend="xmlSecOpenSSLAppDefaultKeysMngrInit"><type>xmlSecOpenSSLAppDefaultKeysMngrInit</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>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>                the uri.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppDefaultKeysMngrSave" role="function">
<title>xmlSecOpenSSLAppDefaultKeysMngrSave ()</title>
<indexterm zone="xmlSecOpenSSLAppDefaultKeysMngrSave"><primary sortas="xmlSecOpenSSLAppDefaultKeysMngrSave">xmlSecOpenSSLAppDefaultKeysMngrSave</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppDefaultKeysMngrSave (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);</programlisting>
<para>
Saves keys from <parameter>mngr</parameter> to  XML keys file.</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>filename</parameter>&#160;:</term>
<listitem><simpara>           the destination filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>               the type of keys to save (public/private/symmetric).
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeysMngrCertLoad" role="function">
<title>xmlSecOpenSSLAppKeysMngrCertLoad ()</title>
<indexterm zone="xmlSecOpenSSLAppKeysMngrCertLoad"><primary sortas="xmlSecOpenSSLAppKeysMngrCertLoad">xmlSecOpenSSLAppKeysMngrCertLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeysMngrCertLoad    (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);</programlisting>
<para>
Reads cert from <parameter>filename</parameter> and adds to the list of trusted or known
untrusted certs in <parameter>store</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara>           the certificate file.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the certificate file format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>               the flag that indicates is the certificate in <parameter>filename</parameter>
                     trusted or not.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeysMngrCertLoadMemory" role="function">
<title>xmlSecOpenSSLAppKeysMngrCertLoadMemory ()</title>
<indexterm zone="xmlSecOpenSSLAppKeysMngrCertLoadMemory"><primary sortas="xmlSecOpenSSLAppKeysMngrCertLoadMemory">xmlSecOpenSSLAppKeysMngrCertLoadMemory</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeysMngrCertLoadMemory
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);</programlisting>
<para>
Reads cert from binary buffer <parameter>data</parameter> and adds to the list of trusted or known
untrusted certs in <parameter>store</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>               the certificate binary data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>           the certificate binary data size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the certificate file format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>               the flag that indicates is the certificate trusted or not.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeysMngrCertLoadBIO" role="function">
<title>xmlSecOpenSSLAppKeysMngrCertLoadBIO ()</title>
<indexterm zone="xmlSecOpenSSLAppKeysMngrCertLoadBIO"><primary sortas="xmlSecOpenSSLAppKeysMngrCertLoadBIO">xmlSecOpenSSLAppKeysMngrCertLoadBIO</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeysMngrCertLoadBIO (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         <link linkend="xmlSecKeyDataType">xmlSecKeyDataType</link> type);</programlisting>
<para>
Reads cert from an OpenSSL BIO object and adds to the list of trusted or known
untrusted certs in <parameter>store</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>bio</parameter>&#160;:</term>
<listitem><simpara>                the certificate BIO.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the certificate file format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>               the flag that indicates is the certificate trusted or not.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeysMngrAddCertsPath" role="function">
<title>xmlSecOpenSSLAppKeysMngrAddCertsPath ()</title>
<indexterm zone="xmlSecOpenSSLAppKeysMngrAddCertsPath"><primary sortas="xmlSecOpenSSLAppKeysMngrAddCertsPath">xmlSecOpenSSLAppKeysMngrAddCertsPath</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeysMngrAddCertsPath
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *path);</programlisting>
<para>
Reads cert from <parameter>path</parameter> and adds to the list of trusted certificates.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>path</parameter>&#160;:</term>
<listitem><simpara>               the path to trusted certificates.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeysMngrAddCertsFile" role="function">
<title>xmlSecOpenSSLAppKeysMngrAddCertsFile ()</title>
<indexterm zone="xmlSecOpenSSLAppKeysMngrAddCertsFile"><primary sortas="xmlSecOpenSSLAppKeysMngrAddCertsFile">xmlSecOpenSSLAppKeysMngrAddCertsFile</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeysMngrAddCertsFile
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *file);</programlisting>
<para>
Reads certs from <parameter>file</parameter> and adds to the list of trusted certificates.
It is possible for <parameter>file</parameter> to contain multiple certs.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mngr</parameter>&#160;:</term>
<listitem><simpara>               the keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file</parameter>&#160;:</term>
<listitem><simpara>               the file containing trusted certificates.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyLoad" role="function">
<title>xmlSecOpenSSLAppKeyLoad ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyLoad"><primary sortas="xmlSecOpenSSLAppKeyLoad">xmlSecOpenSSLAppKeyLoad</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppKeyLoad             (const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);</programlisting>
<para>
Reads key from the a file.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara>           the key filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the key file format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwd</parameter>&#160;:</term>
<listitem><simpara>                the key file password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallback</parameter>&#160;:</term>
<listitem><simpara>        the key password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallbackCtx</parameter>&#160;:</term>
<listitem><simpara>     the user context for password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyLoadMemory" role="function">
<title>xmlSecOpenSSLAppKeyLoadMemory ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyLoadMemory"><primary sortas="xmlSecOpenSSLAppKeyLoadMemory">xmlSecOpenSSLAppKeyLoadMemory</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppKeyLoadMemory       (const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);</programlisting>
<para>
Reads key from the memory buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>               the binary key data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>           the size of binary key.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the key file format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwd</parameter>&#160;:</term>
<listitem><simpara>                the key file password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallback</parameter>&#160;:</term>
<listitem><simpara>        the key password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallbackCtx</parameter>&#160;:</term>
<listitem><simpara>     the user context for password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyLoadBIO" role="function">
<title>xmlSecOpenSSLAppKeyLoadBIO ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyLoadBIO"><primary sortas="xmlSecOpenSSLAppKeyLoadBIO">xmlSecOpenSSLAppKeyLoadBIO</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppKeyLoadBIO          (<link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);</programlisting>
<para>
Reads key from the an OpenSSL BIO object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bio</parameter>&#160;:</term>
<listitem><simpara>                the key BIO.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the key file format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwd</parameter>&#160;:</term>
<listitem><simpara>                the key file password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallback</parameter>&#160;:</term>
<listitem><simpara>        the key password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallbackCtx</parameter>&#160;:</term>
<listitem><simpara>     the user context for password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppPkcs12Load" role="function">
<title>xmlSecOpenSSLAppPkcs12Load ()</title>
<indexterm zone="xmlSecOpenSSLAppPkcs12Load"><primary sortas="xmlSecOpenSSLAppPkcs12Load">xmlSecOpenSSLAppPkcs12Load</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppPkcs12Load          (const <link linkend="char">char</link> *filename,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);</programlisting>
<para>
Reads key and all associated certificates from the PKCS12 file.
For uniformity, call xmlSecOpenSSLAppKeyLoad instead of this function. Pass
in format=xmlSecKeyDataFormatPkcs12.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara>           the PKCS12 key filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwd</parameter>&#160;:</term>
<listitem><simpara>                the PKCS12 file password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallback</parameter>&#160;:</term>
<listitem><simpara>        the password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallbackCtx</parameter>&#160;:</term>
<listitem><simpara>     the user context for password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppPkcs12LoadMemory" role="function">
<title>xmlSecOpenSSLAppPkcs12LoadMemory ()</title>
<indexterm zone="xmlSecOpenSSLAppPkcs12LoadMemory"><primary sortas="xmlSecOpenSSLAppPkcs12LoadMemory">xmlSecOpenSSLAppPkcs12LoadMemory</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppPkcs12LoadMemory    (const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);</programlisting>
<para>
Reads key and all associated certificates from the PKCS12 data in memory buffer.
For uniformity, call xmlSecOpenSSLAppKeyLoad instead of this function. Pass
in format=xmlSecKeyDataFormatPkcs12.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>               the PKCS12 binary data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>           the PKCS12 binary data size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwd</parameter>&#160;:</term>
<listitem><simpara>                the PKCS12 file password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallback</parameter>&#160;:</term>
<listitem><simpara>        the password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallbackCtx</parameter>&#160;:</term>
<listitem><simpara>     the user context for password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppPkcs12LoadBIO" role="function">
<title>xmlSecOpenSSLAppPkcs12LoadBIO ()</title>
<indexterm zone="xmlSecOpenSSLAppPkcs12LoadBIO"><primary sortas="xmlSecOpenSSLAppPkcs12LoadBIO">xmlSecOpenSSLAppPkcs12LoadBIO</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppPkcs12LoadBIO       (<link linkend="BIO--CAPS">BIO</link> *bio,
                                                         const <link linkend="char">char</link> *pwd,
                                                         <link linkend="void">void</link> *pwdCallback,
                                                         <link linkend="void">void</link> *pwdCallbackCtx);</programlisting>
<para>
Reads key and all associated certificates from the PKCS12 data in an OpenSSL BIO object.
For uniformity, call xmlSecOpenSSLAppKeyLoad instead of this function. Pass
in format=xmlSecKeyDataFormatPkcs12.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bio</parameter>&#160;:</term>
<listitem><simpara>                the PKCS12 key bio.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwd</parameter>&#160;:</term>
<listitem><simpara>                the PKCS12 file password.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallback</parameter>&#160;:</term>
<listitem><simpara>        the password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pwdCallbackCtx</parameter>&#160;:</term>
<listitem><simpara>     the user context for password callback.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to the key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyCertLoad" role="function">
<title>xmlSecOpenSSLAppKeyCertLoad ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyCertLoad"><primary sortas="xmlSecOpenSSLAppKeyCertLoad">xmlSecOpenSSLAppKeyCertLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeyCertLoad         (<link linkend="xmlSecKey">xmlSecKeyPtr</link> key,
                                                         const <link linkend="char">char</link> *filename,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);</programlisting>
<para>
Reads the certificate from $<parameter>filename</parameter> and adds it to key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara>                the pointer to key.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&#160;:</term>
<listitem><simpara>           the certificate filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the certificate file format.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyCertLoadMemory" role="function">
<title>xmlSecOpenSSLAppKeyCertLoadMemory ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyCertLoadMemory"><primary sortas="xmlSecOpenSSLAppKeyCertLoadMemory">xmlSecOpenSSLAppKeyCertLoadMemory</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeyCertLoadMemory   (<link linkend="xmlSecKey">xmlSecKeyPtr</link> key,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);</programlisting>
<para>
Reads the certificate from memory buffer and adds it to key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara>                the pointer to key.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>               the certificate binary data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>           the certificate binary data size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the certificate file format.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyCertLoadBIO" role="function">
<title>xmlSecOpenSSLAppKeyCertLoadBIO ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyCertLoadBIO"><primary sortas="xmlSecOpenSSLAppKeyCertLoadBIO">xmlSecOpenSSLAppKeyCertLoadBIO</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecOpenSSLAppKeyCertLoadBIO      (<link linkend="xmlSecKey">xmlSecKeyPtr</link> key,
                                                         <link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);</programlisting>
<para>
Reads the certificate from memory buffer and adds it to key.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara>                the pointer to key.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>bio</parameter>&#160;:</term>
<listitem><simpara>                the certificate bio.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the certificate file format.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppKeyFromCertLoadBIO" role="function">
<title>xmlSecOpenSSLAppKeyFromCertLoadBIO ()</title>
<indexterm zone="xmlSecOpenSSLAppKeyFromCertLoadBIO"><primary sortas="xmlSecOpenSSLAppKeyFromCertLoadBIO">xmlSecOpenSSLAppKeyFromCertLoadBIO</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecOpenSSLAppKeyFromCertLoadBIO  (<link linkend="BIO--CAPS">BIO</link> *bio,
                                                         <link linkend="xmlSecKeyDataFormat">xmlSecKeyDataFormat</link> format);</programlisting>
<para>
Loads public key from cert.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bio</parameter>&#160;:</term>
<listitem><simpara>                the BIO.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the cert format.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to key or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecOpenSSLAppGetDefaultPwdCallback" role="function">
<title>xmlSecOpenSSLAppGetDefaultPwdCallback ()</title>
<indexterm zone="xmlSecOpenSSLAppGetDefaultPwdCallback"><primary sortas="xmlSecOpenSSLAppGetDefaultPwdCallback">xmlSecOpenSSLAppGetDefaultPwdCallback</primary></indexterm><programlisting><link linkend="void">void</link>*               xmlSecOpenSSLAppGetDefaultPwdCallback
                                                        (void);</programlisting>
<para>
Gets default password callback.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> default password callback.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
