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

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

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

<synopsis>
<link linkend="int">int</link>                 <link linkend="xmlSecGnuTLSAppInit">xmlSecGnuTLSAppInit</link>                 (const <link linkend="char">char</link> *config);
<link linkend="int">int</link>                 <link linkend="xmlSecGnuTLSAppShutdown">xmlSecGnuTLSAppShutdown</link>             (void);
<link linkend="int">int</link>                 <link linkend="xmlSecGnuTLSAppDefaultKeysMngrInit">xmlSecGnuTLSAppDefaultKeysMngrInit</link>  (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);
<link linkend="int">int</link>                 <link linkend="xmlSecGnuTLSAppDefaultKeysMngrAdoptKey">xmlSecGnuTLSAppDefaultKeysMngrAdoptKey</link>
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKey">xmlSecKeyPtr</link> key);
<link linkend="int">int</link>                 <link linkend="xmlSecGnuTLSAppDefaultKeysMngrLoad">xmlSecGnuTLSAppDefaultKeysMngrLoad</link>  (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *uri);
<link linkend="int">int</link>                 <link linkend="xmlSecGnuTLSAppDefaultKeysMngrSave">xmlSecGnuTLSAppDefaultKeysMngrSave</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="xmlSecGnuTLSAppKeysMngrCertLoad">xmlSecGnuTLSAppKeysMngrCertLoad</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="xmlSecGnuTLSAppKeysMngrCertLoadMemory">xmlSecGnuTLSAppKeysMngrCertLoadMemory</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="xmlSecKey">xmlSecKeyPtr</link>        <link linkend="xmlSecGnuTLSAppKeyLoad">xmlSecGnuTLSAppKeyLoad</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="xmlSecGnuTLSAppKeyLoadMemory">xmlSecGnuTLSAppKeyLoadMemory</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="xmlSecGnuTLSAppPkcs12Load">xmlSecGnuTLSAppPkcs12Load</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="xmlSecGnuTLSAppPkcs12LoadMemory">xmlSecGnuTLSAppPkcs12LoadMemory</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="int">int</link>                 <link linkend="xmlSecGnuTLSAppKeyCertLoad">xmlSecGnuTLSAppKeyCertLoad</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="xmlSecGnuTLSAppKeyCertLoadMemory">xmlSecGnuTLSAppKeyCertLoadMemory</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="void">void</link>*               <link linkend="xmlSecGnuTLSAppGetDefaultPwdCallback">xmlSecGnuTLSAppGetDefaultPwdCallback</link>
                                                        (void);
</synopsis>
</refsynopsisdiv>









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

<refsect1 id="xmlsec-gnutls-app.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="xmlSecGnuTLSAppInit" role="function">
<title>xmlSecGnuTLSAppInit ()</title>
<indexterm zone="xmlSecGnuTLSAppInit"><primary sortas="xmlSecGnuTLSAppInit">xmlSecGnuTLSAppInit</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppInit                 (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 GnuTLS configuration (unused).
</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="xmlSecGnuTLSAppShutdown" role="function">
<title>xmlSecGnuTLSAppShutdown ()</title>
<indexterm zone="xmlSecGnuTLSAppShutdown"><primary sortas="xmlSecGnuTLSAppShutdown">xmlSecGnuTLSAppShutdown</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppShutdown             (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="xmlSecGnuTLSAppDefaultKeysMngrInit" role="function">
<title>xmlSecGnuTLSAppDefaultKeysMngrInit ()</title>
<indexterm zone="xmlSecGnuTLSAppDefaultKeysMngrInit"><primary sortas="xmlSecGnuTLSAppDefaultKeysMngrInit">xmlSecGnuTLSAppDefaultKeysMngrInit</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppDefaultKeysMngrInit  (<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 GnuTLS 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="xmlSecGnuTLSAppDefaultKeysMngrAdoptKey" role="function">
<title>xmlSecGnuTLSAppDefaultKeysMngrAdoptKey ()</title>
<indexterm zone="xmlSecGnuTLSAppDefaultKeysMngrAdoptKey"><primary sortas="xmlSecGnuTLSAppDefaultKeysMngrAdoptKey">xmlSecGnuTLSAppDefaultKeysMngrAdoptKey</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppDefaultKeysMngrAdoptKey
                                                        (<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="xmlSecGnuTLSAppDefaultKeysMngrInit"><type>xmlSecGnuTLSAppDefaultKeysMngrInit</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="xmlSecGnuTLSAppDefaultKeysMngrLoad" role="function">
<title>xmlSecGnuTLSAppDefaultKeysMngrLoad ()</title>
<indexterm zone="xmlSecGnuTLSAppDefaultKeysMngrLoad"><primary sortas="xmlSecGnuTLSAppDefaultKeysMngrLoad">xmlSecGnuTLSAppDefaultKeysMngrLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppDefaultKeysMngrLoad  (<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="xmlSecGnuTLSAppDefaultKeysMngrInit"><type>xmlSecGnuTLSAppDefaultKeysMngrInit</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="xmlSecGnuTLSAppDefaultKeysMngrSave" role="function">
<title>xmlSecGnuTLSAppDefaultKeysMngrSave ()</title>
<indexterm zone="xmlSecGnuTLSAppDefaultKeysMngrSave"><primary sortas="xmlSecGnuTLSAppDefaultKeysMngrSave">xmlSecGnuTLSAppDefaultKeysMngrSave</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppDefaultKeysMngrSave  (<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="xmlSecGnuTLSAppKeysMngrCertLoad" role="function">
<title>xmlSecGnuTLSAppKeysMngrCertLoad ()</title>
<indexterm zone="xmlSecGnuTLSAppKeysMngrCertLoad"><primary sortas="xmlSecGnuTLSAppKeysMngrCertLoad">xmlSecGnuTLSAppKeysMngrCertLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppKeysMngrCertLoad     (<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="xmlSecGnuTLSAppKeysMngrCertLoadMemory" role="function">
<title>xmlSecGnuTLSAppKeysMngrCertLoadMemory ()</title>
<indexterm zone="xmlSecGnuTLSAppKeysMngrCertLoadMemory"><primary sortas="xmlSecGnuTLSAppKeysMngrCertLoadMemory">xmlSecGnuTLSAppKeysMngrCertLoadMemory</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppKeysMngrCertLoadMemory
                                                        (<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="xmlSecGnuTLSAppKeyLoad" role="function">
<title>xmlSecGnuTLSAppKeyLoad ()</title>
<indexterm zone="xmlSecGnuTLSAppKeyLoad"><primary sortas="xmlSecGnuTLSAppKeyLoad">xmlSecGnuTLSAppKeyLoad</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGnuTLSAppKeyLoad              (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="xmlSecGnuTLSAppKeyLoadMemory" role="function">
<title>xmlSecGnuTLSAppKeyLoadMemory ()</title>
<indexterm zone="xmlSecGnuTLSAppKeyLoadMemory"><primary sortas="xmlSecGnuTLSAppKeyLoadMemory">xmlSecGnuTLSAppKeyLoadMemory</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGnuTLSAppKeyLoadMemory        (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="xmlSecGnuTLSAppPkcs12Load" role="function">
<title>xmlSecGnuTLSAppPkcs12Load ()</title>
<indexterm zone="xmlSecGnuTLSAppPkcs12Load"><primary sortas="xmlSecGnuTLSAppPkcs12Load">xmlSecGnuTLSAppPkcs12Load</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGnuTLSAppPkcs12Load           (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 xmlSecGnuTLSAppKeyLoad 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="xmlSecGnuTLSAppPkcs12LoadMemory" role="function">
<title>xmlSecGnuTLSAppPkcs12LoadMemory ()</title>
<indexterm zone="xmlSecGnuTLSAppPkcs12LoadMemory"><primary sortas="xmlSecGnuTLSAppPkcs12LoadMemory">xmlSecGnuTLSAppPkcs12LoadMemory</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGnuTLSAppPkcs12LoadMemory     (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 xmlSecGnuTLSAppKeyLoadMemory 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="xmlSecGnuTLSAppKeyCertLoad" role="function">
<title>xmlSecGnuTLSAppKeyCertLoad ()</title>
<indexterm zone="xmlSecGnuTLSAppKeyCertLoad"><primary sortas="xmlSecGnuTLSAppKeyCertLoad">xmlSecGnuTLSAppKeyCertLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppKeyCertLoad          (<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="xmlSecGnuTLSAppKeyCertLoadMemory" role="function">
<title>xmlSecGnuTLSAppKeyCertLoadMemory ()</title>
<indexterm zone="xmlSecGnuTLSAppKeyCertLoadMemory"><primary sortas="xmlSecGnuTLSAppKeyCertLoadMemory">xmlSecGnuTLSAppKeyCertLoadMemory</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGnuTLSAppKeyCertLoadMemory    (<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="xmlSecGnuTLSAppGetDefaultPwdCallback" role="function">
<title>xmlSecGnuTLSAppGetDefaultPwdCallback ()</title>
<indexterm zone="xmlSecGnuTLSAppGetDefaultPwdCallback"><primary sortas="xmlSecGnuTLSAppGetDefaultPwdCallback">xmlSecGnuTLSAppGetDefaultPwdCallback</primary></indexterm><programlisting><link linkend="void">void</link>*               xmlSecGnuTLSAppGetDefaultPwdCallback
                                                        (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>
