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

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

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

<synopsis>
<link linkend="int">int</link>                 <link linkend="xmlSecGCryptAppInit">xmlSecGCryptAppInit</link>                 (const <link linkend="char">char</link> *config);
<link linkend="int">int</link>                 <link linkend="xmlSecGCryptAppShutdown">xmlSecGCryptAppShutdown</link>             (void);
<link linkend="int">int</link>                 <link linkend="xmlSecGCryptAppDefaultKeysMngrInit">xmlSecGCryptAppDefaultKeysMngrInit</link>  (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr);
<link linkend="int">int</link>                 <link linkend="xmlSecGCryptAppDefaultKeysMngrAdoptKey">xmlSecGCryptAppDefaultKeysMngrAdoptKey</link>
                                                        (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         <link linkend="xmlSecKey">xmlSecKeyPtr</link> key);
<link linkend="int">int</link>                 <link linkend="xmlSecGCryptAppDefaultKeysMngrLoad">xmlSecGCryptAppDefaultKeysMngrLoad</link>  (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> mngr,
                                                         const <link linkend="char">char</link> *uri);
<link linkend="int">int</link>                 <link linkend="xmlSecGCryptAppDefaultKeysMngrSave">xmlSecGCryptAppDefaultKeysMngrSave</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="xmlSecGCryptAppKeysMngrCertLoad">xmlSecGCryptAppKeysMngrCertLoad</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="xmlSecGCryptAppKeysMngrCertLoadMemory">xmlSecGCryptAppKeysMngrCertLoadMemory</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="xmlSecGCryptAppKeyLoad">xmlSecGCryptAppKeyLoad</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="xmlSecGCryptAppKeyLoadMemory">xmlSecGCryptAppKeyLoadMemory</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="xmlSecGCryptAppPkcs12Load">xmlSecGCryptAppPkcs12Load</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="xmlSecGCryptAppPkcs12LoadMemory">xmlSecGCryptAppPkcs12LoadMemory</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="xmlSecGCryptAppKeyCertLoad">xmlSecGCryptAppKeyCertLoad</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="xmlSecGCryptAppKeyCertLoadMemory">xmlSecGCryptAppKeyCertLoadMemory</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="xmlSecGCryptAppGetDefaultPwdCallback">xmlSecGCryptAppGetDefaultPwdCallback</link>
                                                        (void);
</synopsis>
</refsynopsisdiv>









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

<refsect1 id="xmlsec-gcrypt-app.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="xmlSecGCryptAppInit" role="function">
<title>xmlSecGCryptAppInit ()</title>
<indexterm zone="xmlSecGCryptAppInit"><primary sortas="xmlSecGCryptAppInit">xmlSecGCryptAppInit</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppInit                 (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 GCrypt 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="xmlSecGCryptAppShutdown" role="function">
<title>xmlSecGCryptAppShutdown ()</title>
<indexterm zone="xmlSecGCryptAppShutdown"><primary sortas="xmlSecGCryptAppShutdown">xmlSecGCryptAppShutdown</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppShutdown             (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="xmlSecGCryptAppDefaultKeysMngrInit" role="function">
<title>xmlSecGCryptAppDefaultKeysMngrInit ()</title>
<indexterm zone="xmlSecGCryptAppDefaultKeysMngrInit"><primary sortas="xmlSecGCryptAppDefaultKeysMngrInit">xmlSecGCryptAppDefaultKeysMngrInit</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppDefaultKeysMngrInit  (<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 GCrypt 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="xmlSecGCryptAppDefaultKeysMngrAdoptKey" role="function">
<title>xmlSecGCryptAppDefaultKeysMngrAdoptKey ()</title>
<indexterm zone="xmlSecGCryptAppDefaultKeysMngrAdoptKey"><primary sortas="xmlSecGCryptAppDefaultKeysMngrAdoptKey">xmlSecGCryptAppDefaultKeysMngrAdoptKey</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppDefaultKeysMngrAdoptKey
                                                        (<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="xmlSecGCryptAppDefaultKeysMngrInit"><type>xmlSecGCryptAppDefaultKeysMngrInit</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="xmlSecGCryptAppDefaultKeysMngrLoad" role="function">
<title>xmlSecGCryptAppDefaultKeysMngrLoad ()</title>
<indexterm zone="xmlSecGCryptAppDefaultKeysMngrLoad"><primary sortas="xmlSecGCryptAppDefaultKeysMngrLoad">xmlSecGCryptAppDefaultKeysMngrLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppDefaultKeysMngrLoad  (<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="xmlSecGCryptAppDefaultKeysMngrInit"><type>xmlSecGCryptAppDefaultKeysMngrInit</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="xmlSecGCryptAppDefaultKeysMngrSave" role="function">
<title>xmlSecGCryptAppDefaultKeysMngrSave ()</title>
<indexterm zone="xmlSecGCryptAppDefaultKeysMngrSave"><primary sortas="xmlSecGCryptAppDefaultKeysMngrSave">xmlSecGCryptAppDefaultKeysMngrSave</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppDefaultKeysMngrSave  (<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="xmlSecGCryptAppKeysMngrCertLoad" role="function">
<title>xmlSecGCryptAppKeysMngrCertLoad ()</title>
<indexterm zone="xmlSecGCryptAppKeysMngrCertLoad"><primary sortas="xmlSecGCryptAppKeysMngrCertLoad">xmlSecGCryptAppKeysMngrCertLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppKeysMngrCertLoad     (<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> (not implemented yet).</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="xmlSecGCryptAppKeysMngrCertLoadMemory" role="function">
<title>xmlSecGCryptAppKeysMngrCertLoadMemory ()</title>
<indexterm zone="xmlSecGCryptAppKeysMngrCertLoadMemory"><primary sortas="xmlSecGCryptAppKeysMngrCertLoadMemory">xmlSecGCryptAppKeysMngrCertLoadMemory</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppKeysMngrCertLoadMemory
                                                        (<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> (not implemented yet).</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="xmlSecGCryptAppKeyLoad" role="function">
<title>xmlSecGCryptAppKeyLoad ()</title>
<indexterm zone="xmlSecGCryptAppKeyLoad"><primary sortas="xmlSecGCryptAppKeyLoad">xmlSecGCryptAppKeyLoad</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGCryptAppKeyLoad              (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="xmlSecGCryptAppKeyLoadMemory" role="function">
<title>xmlSecGCryptAppKeyLoadMemory ()</title>
<indexterm zone="xmlSecGCryptAppKeyLoadMemory"><primary sortas="xmlSecGCryptAppKeyLoadMemory">xmlSecGCryptAppKeyLoadMemory</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGCryptAppKeyLoadMemory        (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="xmlSecGCryptAppPkcs12Load" role="function">
<title>xmlSecGCryptAppPkcs12Load ()</title>
<indexterm zone="xmlSecGCryptAppPkcs12Load"><primary sortas="xmlSecGCryptAppPkcs12Load">xmlSecGCryptAppPkcs12Load</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGCryptAppPkcs12Load           (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
(not implemented yet).
For uniformity, call xmlSecGCryptAppKeyLoad 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="xmlSecGCryptAppPkcs12LoadMemory" role="function">
<title>xmlSecGCryptAppPkcs12LoadMemory ()</title>
<indexterm zone="xmlSecGCryptAppPkcs12LoadMemory"><primary sortas="xmlSecGCryptAppPkcs12LoadMemory">xmlSecGCryptAppPkcs12LoadMemory</primary></indexterm><programlisting><link linkend="xmlSecKey">xmlSecKeyPtr</link>        xmlSecGCryptAppPkcs12LoadMemory     (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 xmlSecGCryptAppKeyLoadMemory instead of this function. Pass
in format=xmlSecKeyDataFormatPkcs12 (not implemented yet).</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="xmlSecGCryptAppKeyCertLoad" role="function">
<title>xmlSecGCryptAppKeyCertLoad ()</title>
<indexterm zone="xmlSecGCryptAppKeyCertLoad"><primary sortas="xmlSecGCryptAppKeyCertLoad">xmlSecGCryptAppKeyCertLoad</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppKeyCertLoad          (<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
(not implemented yet).</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="xmlSecGCryptAppKeyCertLoadMemory" role="function">
<title>xmlSecGCryptAppKeyCertLoadMemory ()</title>
<indexterm zone="xmlSecGCryptAppKeyCertLoadMemory"><primary sortas="xmlSecGCryptAppKeyCertLoadMemory">xmlSecGCryptAppKeyCertLoadMemory</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecGCryptAppKeyCertLoadMemory    (<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 (not implemented yet).</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="xmlSecGCryptAppGetDefaultPwdCallback" role="function">
<title>xmlSecGCryptAppGetDefaultPwdCallback ()</title>
<indexterm zone="xmlSecGCryptAppGetDefaultPwdCallback"><primary sortas="xmlSecGCryptAppGetDefaultPwdCallback">xmlSecGCryptAppGetDefaultPwdCallback</primary></indexterm><programlisting><link linkend="void">void</link>*               xmlSecGCryptAppGetDefaultPwdCallback
                                                        (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>
