<refentry id="xmlsec-x509">
<refmeta>
<refentrytitle>x509.h</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>XMLSEC Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>x509.h</refname><refpurpose>The X509 certificates functions.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>



<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> <link linkend="xmlSecX509DataCreate">xmlSecX509DataCreate</link>      (void);
void        <link linkend="xmlSecX509DataDestroy">xmlSecX509DataDestroy</link>           (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
<link linkend="size-t">size_t</link>      <link linkend="xmlSecX509DataGetCertsNumber">xmlSecX509DataGetCertsNumber</link>    (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
<link linkend="size-t">size_t</link>      <link linkend="xmlSecX509DataGetCrlsNumber">xmlSecX509DataGetCrlsNumber</link>     (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
int         <link linkend="xmlSecX509DataReadDerCert">xmlSecX509DataReadDerCert</link>       (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             <link linkend="xmlChar">xmlChar</link> *buf,
                                             <link linkend="size-t">size_t</link> size,
                                             int base64);
<link linkend="xmlChar">xmlChar</link>*    <link linkend="xmlSecX509DataWriteDerCert">xmlSecX509DataWriteDerCert</link>      (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             int pos);
int         <link linkend="xmlSecX509DataReadDerCrl">xmlSecX509DataReadDerCrl</link>        (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             <link linkend="xmlChar">xmlChar</link> *buf,
                                             <link linkend="size-t">size_t</link> size,
                                             int base64);
<link linkend="xmlChar">xmlChar</link>*    <link linkend="xmlSecX509DataWriteDerCrl">xmlSecX509DataWriteDerCrl</link>       (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             int pos);
int         <link linkend="xmlSecX509DataReadPemCert">xmlSecX509DataReadPemCert</link>       (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             const char *filename);
<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> <link linkend="xmlSecX509DataDup">xmlSecX509DataDup</link>         (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <link linkend="xmlSecX509DataCreateKey">xmlSecX509DataCreateKey</link>        (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
void        <link linkend="xmlSecX509DataDebugDump">xmlSecX509DataDebugDump</link>         (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             <link linkend="FILE-CAPS">FILE</link> *output);
<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> <link linkend="xmlSecX509StoreCreate">xmlSecX509StoreCreate</link>    (void);
void        <link linkend="xmlSecX509StoreDestroy">xmlSecX509StoreDestroy</link>          (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store);
<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> <link linkend="xmlSecX509StoreFind">xmlSecX509StoreFind</link>       (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             <link linkend="xmlChar">xmlChar</link> *subjectName,
                                             <link linkend="xmlChar">xmlChar</link> *issuerName,
                                             <link linkend="xmlChar">xmlChar</link> *issuerSerial,
                                             <link linkend="xmlChar">xmlChar</link> *ski,
                                             <link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
int         <link linkend="xmlSecX509StoreVerify">xmlSecX509StoreVerify</link>           (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             <link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);
int         <link linkend="xmlSecX509StoreLoadPemCert">xmlSecX509StoreLoadPemCert</link>      (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             const char *filename,
                                             int trusted);
int         <link linkend="xmlSecX509StoreAddCertsDir">xmlSecX509StoreAddCertsDir</link>      (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             const char *path);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <link linkend="xmlSecPKCS12ReadKey">xmlSecPKCS12ReadKey</link>            (const char *filename,
                                             const char *pwd);
</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="xmlSecX509DataCreate">xmlSecX509DataCreate ()</title>
<programlisting><link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> xmlSecX509DataCreate      (void);</programlisting>
<para>
Creates new x509 data.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure
or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataDestroy">xmlSecX509DataDestroy ()</title>
<programlisting>void        xmlSecX509DataDestroy           (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Destroys x509 data.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataGetCertsNumber">xmlSecX509DataGetCertsNumber ()</title>
<programlisting><link linkend="size-t">size_t</link>      xmlSecX509DataGetCertsNumber    (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Gets the number of certs in <parameter>x509Data</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the number of certs in <parameter>x509Data</parameter>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataGetCrlsNumber">xmlSecX509DataGetCrlsNumber ()</title>
<programlisting><link linkend="size-t">size_t</link>      xmlSecX509DataGetCrlsNumber     (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Gets the number of crls in <parameter>x509Data</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the number of crls in <parameter>x509Data</parameter>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataReadDerCert">xmlSecX509DataReadDerCert ()</title>
<programlisting>int         xmlSecX509DataReadDerCert       (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             <link linkend="xmlChar">xmlChar</link> *buf,
                                             <link linkend="size-t">size_t</link> size,
                                             int base64);</programlisting>
<para>
Reads certificates the from a DER binary data in <parameter>buf</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
<entry> the pointer to binary data.
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> the size of binary data.
</entry></row>
<row><entry align="right"><parameter>base64</parameter>&nbsp;:</entry>
<entry> the flag that indicate whether the <parameter>buf</parameter> is base64 encoded or not.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataWriteDerCert">xmlSecX509DataWriteDerCert ()</title>
<programlisting><link linkend="xmlChar">xmlChar</link>*    xmlSecX509DataWriteDerCert      (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             int pos);</programlisting>
<para>
Writes <parameter>pos</parameter> certificate from <parameter>x509Data</parameter> into allocated buffer
in DER + base64 encode format. The caller is responsible for freeing
the returned buffer using <link linkend="xmlFree">xmlFree</link>() function.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><parameter>pos</parameter>&nbsp;:</entry>
<entry> the cert number.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to allocated result buffer or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataReadDerCrl">xmlSecX509DataReadDerCrl ()</title>
<programlisting>int         xmlSecX509DataReadDerCrl        (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             <link linkend="xmlChar">xmlChar</link> *buf,
                                             <link linkend="size-t">size_t</link> size,
                                             int base64);</programlisting>
<para>
Reads crls the from a DER binary data in <parameter>buf</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
<entry> the pointer to binary data.
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> the size of binary data.
</entry></row>
<row><entry align="right"><parameter>base64</parameter>&nbsp;:</entry>
<entry> the flag that indicate whether the <parameter>buf</parameter> is base64 encoded or not.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataWriteDerCrl">xmlSecX509DataWriteDerCrl ()</title>
<programlisting><link linkend="xmlChar">xmlChar</link>*    xmlSecX509DataWriteDerCrl       (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             int pos);</programlisting>
<para>
Writes <parameter>pos</parameter> crl from <parameter>x509Data</parameter> into allocated buffer
in DER + base64 encode format. The caller is responsible for freeing
the returned buffer using <link linkend="xmlFree">xmlFree</link>() function.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><parameter>pos</parameter>&nbsp;:</entry>
<entry> the cert number.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to allocated result buffer or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataReadPemCert">xmlSecX509DataReadPemCert ()</title>
<programlisting>int         xmlSecX509DataReadPemCert       (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             const char *filename);</programlisting>
<para>
Reads cert from PEM file <parameter>filename</parameter> into <parameter>x509Data</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> the PEM file name.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataDup">xmlSecX509DataDup ()</title>
<programlisting><link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> xmlSecX509DataDup         (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Duplicates the <parameter>x509Data</parameter> structure.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure
or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataCreateKey">xmlSecX509DataCreateKey ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> xmlSecX509DataCreateKey        (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Creates the key from  <parameter>x509Data</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly allocated key or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509DataDebugDump">xmlSecX509DataDebugDump ()</title>
<programlisting>void        xmlSecX509DataDebugDump         (<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data,
                                             <link linkend="FILE-CAPS">FILE</link> *output);</programlisting>
<para>
Prints the information about <parameter>x509Data</parameter> to <parameter>output</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><parameter>output</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="FILE-CAPS">FILE</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509StoreCreate">xmlSecX509StoreCreate ()</title>
<programlisting><link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> xmlSecX509StoreCreate    (void);</programlisting>
<para>
Creates new x509 store.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly allocated <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509StoreDestroy">xmlSecX509StoreDestroy ()</title>
<programlisting>void        xmlSecX509StoreDestroy          (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store);</programlisting>
<para>
Destroys the <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>store</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509StoreFind">xmlSecX509StoreFind ()</title>
<programlisting><link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> xmlSecX509StoreFind       (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             <link linkend="xmlChar">xmlChar</link> *subjectName,
                                             <link linkend="xmlChar">xmlChar</link> *issuerName,
                                             <link linkend="xmlChar">xmlChar</link> *issuerSerial,
                                             <link linkend="xmlChar">xmlChar</link> *ski,
                                             <link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Searches for matching certificate in the keys manager.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>store</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.
</entry></row>
<row><entry align="right"><parameter>subjectName</parameter>&nbsp;:</entry>
<entry> the subject name string.
</entry></row>
<row><entry align="right"><parameter>issuerName</parameter>&nbsp;:</entry>
<entry> the issuer name string.
</entry></row>
<row><entry align="right"><parameter>issuerSerial</parameter>&nbsp;:</entry>
<entry> the issuer serial.
</entry></row>
<row><entry align="right"><parameter>ski</parameter>&nbsp;:</entry>
<entry> the SKI string.
</entry></row>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the current X509 certs data (may be NULL). 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to certificate that matches given criteria or NULL 
if an error occurs or certificate not found.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509StoreVerify">xmlSecX509StoreVerify ()</title>
<programlisting>int         xmlSecX509StoreVerify           (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             <link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> x509Data);</programlisting>
<para>
Verifies the cert(s) from <parameter>x509Data</parameter> against <parameter>store</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>store</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.
</entry></row>
<row><entry align="right"><parameter>x509Data</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Data">xmlSecX509Data</link> structure.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>1 if verification succeeded, 0 if not and a negative
value if a processing error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509StoreLoadPemCert">xmlSecX509StoreLoadPemCert ()</title>
<programlisting>int         xmlSecX509StoreLoadPemCert      (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             const char *filename,
                                             int trusted);</programlisting>
<para>
Reads cert from PEM <parameter>filename</parameter> and adds to the list of trusted or known
untrusted certs in <parameter>store</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>store</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.
</entry></row>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> the PEM file.
</entry></row>
<row><entry align="right"><parameter>trusted</parameter>&nbsp;:</entry>
<entry> the flag that indicates is the certificate in <parameter>filename</parameter>
   trusted or not.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509StoreAddCertsDir">xmlSecX509StoreAddCertsDir ()</title>
<programlisting>int         xmlSecX509StoreAddCertsDir      (<link linkend="xmlSecX509StorePtr">xmlSecX509StorePtr</link> store,
                                             const char *path);</programlisting>
<para>
Adds all certs in the <parameter>path</parameter> to the list of trusted certs
in <parameter>store</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>store</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecX509Store">xmlSecX509Store</link> structure.
</entry></row>
<row><entry align="right"><parameter>path</parameter>&nbsp;:</entry>
<entry> the path to the certs dir.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecPKCS12ReadKey">xmlSecPKCS12ReadKey ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> xmlSecPKCS12ReadKey            (const char *filename,
                                             const char *pwd);</programlisting>
<para>
Reads the key from pkcs12 file <parameter>filename</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> the pkcs12 file name.
</entry></row>
<row><entry align="right"><parameter>pwd</parameter>&nbsp;:</entry>
<entry> the password for the pkcs12 file.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly allocated key or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
