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

<refnamediv>
<refname>keys.h</refname><refpurpose>The keys helper functions.</refpurpose>
</refnamediv>

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



typedef     <link linkend="xmlSecKeyId">xmlSecKeyId</link>;
enum        <link linkend="xmlSecKeyType">xmlSecKeyType</link>;
enum        <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link>;
typedef     <link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link>;
#define     <link linkend="xmlSecKeyOriginDefault">xmlSecKeyOriginDefault</link>
#define     <link linkend="xmlSecKeyOriginKeyManager">xmlSecKeyOriginKeyManager</link>
#define     <link linkend="xmlSecKeyOriginKeyName">xmlSecKeyOriginKeyName</link>
#define     <link linkend="xmlSecKeyOriginKeyValue">xmlSecKeyOriginKeyValue</link>
#define     <link linkend="xmlSecKeyOriginRetrievalDocument">xmlSecKeyOriginRetrievalDocument</link>
#define     <link linkend="xmlSecKeyOriginRetrievalRemote">xmlSecKeyOriginRetrievalRemote</link>
#define     <link linkend="xmlSecKeyOriginX509">xmlSecKeyOriginX509</link>
#define     <link linkend="xmlSecKeyOriginPGP">xmlSecKeyOriginPGP</link>
#define     <link linkend="xmlSecKeyOriginEncryptedKey">xmlSecKeyOriginEncryptedKey</link>
#define     <link linkend="xmlSecKeyOriginAll">xmlSecKeyOriginAll</link>
#define     <link linkend="xmlSecKeyIdUnknown">xmlSecKeyIdUnknown</link>
struct      <link linkend="xmlSecKey">xmlSecKey</link>;
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <link linkend="xmlSecKeyCreate">xmlSecKeyCreate</link>                (<link linkend="xmlSecKeyId">xmlSecKeyId</link> id,
                                             <link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link> origin);
void        <link linkend="xmlSecKeyDestroy">xmlSecKeyDestroy</link>                (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <link linkend="xmlSecKeyDuplicate">xmlSecKeyDuplicate</link>             (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link> origin);
int         <link linkend="xmlSecVerifyKey">xmlSecVerifyKey</link>                 (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             const <link linkend="xmlChar">xmlChar</link> *name,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> id,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type);
void        <link linkend="xmlSecKeyDebugDump">xmlSecKeyDebugDump</link>              (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="FILE-CAPS">FILE</link> *output);
int         <link linkend="xmlSecKeyReadPemCert">xmlSecKeyReadPemCert</link>            (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             const char *filename);
struct      <link linkend="xmlSecKeysMngr">xmlSecKeysMngr</link>;
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> (<link linkend="xmlSecGetKeyCallback">*xmlSecGetKeyCallback</link>)        (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> keyId,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type,
                                             <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link> usage,
                                             <link linkend="time-t">time_t</link> certsVerificationTime);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> (<link linkend="xmlSecFindKeyCallback">*xmlSecFindKeyCallback</link>)       (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             const <link linkend="xmlChar">xmlChar</link> *name,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> id,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type,
                                             <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link> usage);
<link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> (<link linkend="xmlSecX509FindCallback">*xmlSecX509FindCallback</link>) (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <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> cert);
int         (<link linkend="xmlSecX509VerifyCallback">*xmlSecX509VerifyCallback</link>)     (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> cert);
<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <link linkend="xmlSecKeysMngrGetKey">xmlSecKeysMngrGetKey</link>           (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> keyId,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> keyType,
                                             <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link> keyUsage,
                                             <link linkend="time-t">time_t</link> certsVerificationTime);
</synopsis>
</refsynopsisdiv>





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

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="xmlSecKeyId">xmlSecKeyId</title>
<programlisting>typedef const struct _xmlSecKeyIdStruct	*xmlSecKeyId; 
</programlisting>
<para>
The key id (key type information).</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyType">enum xmlSecKeyType</title>
<programlisting>typedef enum  {
    xmlSecKeyTypePublic = 0,
    xmlSecKeyTypePrivate,
    xmlSecKeyTypeAny
} xmlSecKeyType;
</programlisting>
<para>
The key type (public/private).</para>
<para>

</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>xmlSecKeyTypePublic</literal></entry>
<entry> the public key.
</entry>
</row>
<row>
<entry><literal>xmlSecKeyTypePrivate</literal></entry>
<entry> the private key.
</entry>
</row>
<row>
<entry><literal>xmlSecKeyTypeAny</literal></entry>
<entry> any key.
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyUsage">enum xmlSecKeyUsage</title>
<programlisting>typedef enum  {
    xmlSecKeyUsageAny = 0,
    xmlSecKeyUsageSign,
    xmlSecKeyUsageVerify,
    xmlSecKeyUsageEncrypt,
    xmlSecKeyUsageDecrypt
} xmlSecKeyUsage;
</programlisting>
<para>
The key usage.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>xmlSecKeyUsageAny</literal></entry>
<entry> the key can be used in any way.
</entry>
</row>
<row>
<entry><literal>xmlSecKeyUsageSign</literal></entry>
<entry> the key for signing.
</entry>
</row>
<row>
<entry><literal>xmlSecKeyUsageVerify</literal></entry>
<entry> the key for signature verification.
</entry>
</row>
<row>
<entry><literal>xmlSecKeyUsageEncrypt</literal></entry>
<entry> the encryption key.
</entry>
</row>
<row>
<entry><literal>xmlSecKeyUsageDecrypt</literal></entry>
<entry> the decryption key.
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOrigin">xmlSecKeyOrigin</title>
<programlisting>typedef long				xmlSecKeyOrigin;
</programlisting>
<para>
The key origin (keys manager, remote document, cert, etc.).</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginDefault">xmlSecKeyOriginDefault</title>
<programlisting>#define xmlSecKeyOriginDefault			0
</programlisting>
<para>
Default origin (unknown).</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginKeyManager">xmlSecKeyOriginKeyManager</title>
<programlisting>#define xmlSecKeyOriginKeyManager		1
</programlisting>
<para>
The key was found in the keys manager.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginKeyName">xmlSecKeyOriginKeyName</title>
<programlisting>#define xmlSecKeyOriginKeyName			2 
</programlisting>
<para>
The key was found in the keys manager via key name
specified in the &lt;dsig:KeyName&gt; node. (useless w/o 
<link linkend="xmlSecKeyOriginKeyManager">xmlSecKeyOriginKeyManager</link>).</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginKeyValue">xmlSecKeyOriginKeyValue</title>
<programlisting>#define xmlSecKeyOriginKeyValue			4
</programlisting>
<para>
The key was extracted from &lt;dsig:KeyValue&gt; node.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginRetrievalDocument">xmlSecKeyOriginRetrievalDocument</title>
<programlisting>#define xmlSecKeyOriginRetrievalDocument	8
</programlisting>
<para>
The key was extracted thru &lt;dsig:RetrievalMethod&gt; 
pointing in the same document.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginRetrievalRemote">xmlSecKeyOriginRetrievalRemote</title>
<programlisting>#define xmlSecKeyOriginRetrievalRemote		16
</programlisting>
<para>
The key was extracted thru &lt;dsig:RetrievalMethod&gt; 
pointing to another document.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginX509">xmlSecKeyOriginX509</title>
<programlisting>#define xmlSecKeyOriginX509			32
</programlisting>
<para>
The key was extracted from X509 certificate
in the &lt;dsig:X509Data&gt; node.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginPGP">xmlSecKeyOriginPGP</title>
<programlisting>#define xmlSecKeyOriginPGP			64
</programlisting>
<para>
The PGP key from &lt;dsig:PGPData&gt; node. Not used.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginEncryptedKey">xmlSecKeyOriginEncryptedKey</title>
<programlisting>#define xmlSecKeyOriginEncryptedKey		128
</programlisting>
<para>
The key was extracted from &lt;enc:EncryptedKey&gt; node.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyOriginAll">xmlSecKeyOriginAll</title>
<programlisting>#define     xmlSecKeyOriginAll</programlisting>
<para>
All of the above.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyIdUnknown">xmlSecKeyIdUnknown</title>
<programlisting>#define xmlSecKeyIdUnknown 			NULL
</programlisting>
<para>
The "unknown" id.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecKey">struct xmlSecKey</title>
<programlisting>struct xmlSecKey {
    xmlSecKeyId				id;
    xmlSecKeyType			type;
    xmlChar				*name;
    xmlSecKeyOrigin			origin;
    xmlSecX509DataPtr			x509Data;
    void				*keyData;
};
</programlisting>
<para>
The key.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="xmlSecKeyId">xmlSecKeyId</link> <structfield>id</structfield></entry>
<entry> the key id (<link linkend="xmlSecKeyId">xmlSecKeyId</link>).
</entry>
</row>
<row>
<entry><link linkend="xmlSecKeyType">xmlSecKeyType</link> <structfield>type</structfield></entry>
<entry> the key type (private/public).
</entry>
</row>
<row>
<entry><link linkend="xmlChar">xmlChar</link> *<structfield>name</structfield></entry>
<entry> the key name (may be NULL).
</entry>
</row>
<row>
<entry><link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link> <structfield>origin</structfield></entry>
<entry> the key origin.
</entry>
</row>
<row>
<entry><link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> <structfield>x509Data</structfield></entry>
<entry> the pointer to X509 cert data (if key was extracted from a cert).
</entry>
</row>
<row>
<entry>void *<structfield>keyData</structfield></entry>
<entry> key specific data.
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyCreate">xmlSecKeyCreate ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> xmlSecKeyCreate                (<link linkend="xmlSecKeyId">xmlSecKeyId</link> id,
                                             <link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link> origin);</programlisting>
<para>
Creates new key of the specified type <parameter>id</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>id</parameter>&nbsp;:</entry>
<entry> the key id.
</entry></row>
<row><entry align="right"><parameter>origin</parameter>&nbsp;:</entry>
<entry> the key origins.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly allocated <link linkend="xmlSecKey">xmlSecKey</link> structure
or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyDestroy">xmlSecKeyDestroy ()</title>
<programlisting>void        xmlSecKeyDestroy                (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key);</programlisting>
<para>
Destroys the key and frees all allocated memory.</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>key</parameter>&nbsp;:</entry>
<entry> the pointer to the <link linkend="xmlSecKey">xmlSecKey</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyDuplicate">xmlSecKeyDuplicate ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> xmlSecKeyDuplicate             (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link> origin);</programlisting>
<para>
Creates a duplicate of the given <parameter>key</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>key</parameter>&nbsp;:</entry>
<entry> the pointer to the <link linkend="xmlSecKey">xmlSecKey</link> structure.
</entry></row>
<row><entry align="right"><parameter>origin</parameter>&nbsp;:</entry>
<entry> the key origins.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly allocated <link linkend="xmlSecKey">xmlSecKey</link> structure
or NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecVerifyKey">xmlSecVerifyKey ()</title>
<programlisting>int         xmlSecVerifyKey                 (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             const <link linkend="xmlChar">xmlChar</link> *name,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> id,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type);</programlisting>
<para>
Checks whether the <parameter>key</parameter> matches the given criteria
(key name is equal to <parameter>name</parameter>, key id is equal to <parameter>id</parameter>,
key type is <parameter>type</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>key</parameter>&nbsp;:</entry>
<entry> the pointer to the <link linkend="xmlSecKey">xmlSecKey</link> structure.
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> the pointer to key name (may be NULL).
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the key id (may be "any").
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the key type to write (public/private).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>1 if the key satisfies the given criteria or 0 otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyDebugDump">xmlSecKeyDebugDump ()</title>
<programlisting>void        xmlSecKeyDebugDump              (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="FILE-CAPS">FILE</link> *output);</programlisting>
<para>
Prints the information about the <parameter>key</parameter> to the <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>key</parameter>&nbsp;:</entry>
<entry> the pointer to the <link linkend="xmlSecKey">xmlSecKey</link> structure.
</entry></row>
<row><entry align="right"><parameter>output</parameter>&nbsp;:</entry>
<entry> the destination <link linkend="FILE-CAPS">FILE</link> pointer.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyReadPemCert">xmlSecKeyReadPemCert ()</title>
<programlisting>int         xmlSecKeyReadPemCert            (<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             const char *filename);</programlisting>
<para>
Reads the cert from a PEM file and assigns the cert
to the key.</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>key</parameter>&nbsp;:</entry>
<entry> the pointer to the <link linkend="xmlSecKey">xmlSecKey</link> structure.
</entry></row>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> the PEM cert 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="xmlSecKeysMngr">struct xmlSecKeysMngr</title>
<programlisting>struct xmlSecKeysMngr {
    xmlSecGetKeyCallback		getKey;
    xmlSecKeyOrigin 			allowedOrigins;
    int 				maxRetrievalsLevel;
    int					maxEncKeysLevel; 

    /* low level keys */             
    xmlSecFindKeyCallback		findKey;
    void 				*keysData;

    /* x509 certs */    
    int					failIfCertNotFound; 
    xmlSecX509FindCallback		findX509;
    xmlSecX509VerifyCallback		verifyX509;
    void				*x509Data;
};
</programlisting>
<para>
The keys manager structure.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="xmlSecGetKeyCallback">xmlSecGetKeyCallback</link> <structfield>getKey</structfield></entry>
<entry> the callback used to read &lt;dsig:KeyInfo&gt; node.
</entry>
</row>
<row>
<entry><link linkend="xmlSecKeyOrigin">xmlSecKeyOrigin</link> <structfield>allowedOrigins</structfield></entry>
<entry> the allowed origins bits mask.
</entry>
</row>
<row>
<entry>int <structfield>maxRetrievalsLevel</structfield></entry>
<entry> the max allowed &lt;dsig:RetrievalMethod&gt; level to prevent DOS attack.
</entry>
</row>
<row>
<entry>int <structfield>maxEncKeysLevel</structfield></entry>
<entry> the max allowed &lt;enc:EncryptedKey&gt; level to prevent DOS attack.
</entry>
</row>
<row>
<entry><link linkend="xmlSecFindKeyCallback">xmlSecFindKeyCallback</link> <structfield>findKey</structfield></entry>
<entry> the callback used to serach for key in the keys manager.
</entry>
</row>
<row>
<entry>void *<structfield>keysData</structfield></entry>
<entry> the keys manager data.
</entry>
</row>
<row>
<entry>int <structfield>failIfCertNotFound</structfield></entry>
<entry> the flag.
</entry>
</row>
<row>
<entry><link linkend="xmlSecX509FindCallback">xmlSecX509FindCallback</link> <structfield>findX509</structfield></entry>
<entry> the callback used to search for a cert.
</entry>
</row>
<row>
<entry><link linkend="xmlSecX509VerifyCallback">xmlSecX509VerifyCallback</link> <structfield>verifyX509</structfield></entry>
<entry> the callback used to verify a cert.
</entry>
</row>
<row>
<entry>void *<structfield>x509Data</structfield></entry>
<entry> the X509 certificates manager specific data.
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecGetKeyCallback">xmlSecGetKeyCallback ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> (*xmlSecGetKeyCallback)        (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> keyId,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type,
                                             <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link> usage,
                                             <link linkend="time-t">time_t</link> certsVerificationTime);</programlisting>
<para>
Reads the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</parameter> and extracts the key.</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>mngr</parameter>&nbsp;:</entry>
<entry> the keys manager.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer to application specific data.
</entry></row>
<row><entry align="right"><parameter>keyId</parameter>&nbsp;:</entry>
<entry> the required key Id (or NULL for "any").
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the required key (may be "any").
</entry></row>
<row><entry align="right"><parameter>usage</parameter>&nbsp;:</entry>
<entry> the required key usage.
</entry></row>
<row><entry align="right"><parameter>certsVerificationTime</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to key or NULL if the key is not found or 
an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecFindKeyCallback">xmlSecFindKeyCallback ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> (*xmlSecFindKeyCallback)       (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             const <link linkend="xmlChar">xmlChar</link> *name,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> id,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type,
                                             <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link> usage);</programlisting>
<para>
Searches the keys manager for specified key.</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>mngr</parameter>&nbsp;:</entry>
<entry> the keys manager.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer to application specific data.
</entry></row>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> the required key name (or NULL for "any").
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the required key Id (or NULL for "any").
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the required key (may be "any").
</entry></row>
<row><entry align="right"><parameter>usage</parameter>&nbsp;:</entry>
<entry> the required key usage.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to key or NULL if the key is not found or 
an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecX509FindCallback">xmlSecX509FindCallback ()</title>
<programlisting><link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> (*xmlSecX509FindCallback) (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <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> cert);</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>mngr</parameter>&nbsp;:</entry>
<entry> the keys manager.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer application specific data.
</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>cert</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="xmlSecX509VerifyCallback">xmlSecX509VerifyCallback ()</title>
<programlisting>int         (*xmlSecX509VerifyCallback)     (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <link linkend="xmlSecX509DataPtr">xmlSecX509DataPtr</link> cert);</programlisting>
<para>
Validates certificate.</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>mngr</parameter>&nbsp;:</entry>
<entry> the keys manager.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer to application specific data.
</entry></row>
<row><entry align="right"><parameter>cert</parameter>&nbsp;:</entry>
<entry> the cert to verify.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>1 if the cert is trusted, 0 if it is not trusted
and -1 if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeysMngrGetKey">xmlSecKeysMngrGetKey ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> xmlSecKeysMngrGetKey           (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> mngr,
                                             void *context,
                                             <link linkend="xmlSecKeyId">xmlSecKeyId</link> keyId,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> keyType,
                                             <link linkend="xmlSecKeyUsage">xmlSecKeyUsage</link> keyUsage,
                                             <link linkend="time-t">time_t</link> certsVerificationTime);</programlisting>
<para>
Reads the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</parameter> and extracts the key.</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>mngr</parameter>&nbsp;:</entry>
<entry> the keys manager.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer to application specific data.
</entry></row>
<row><entry align="right"><parameter>keyId</parameter>&nbsp;:</entry>
<entry> the required key Id (or NULL for "any").
</entry></row>
<row><entry align="right"><parameter>keyType</parameter>&nbsp;:</entry>
<entry> the required key (may be "any").
</entry></row>
<row><entry align="right"><parameter>keyUsage</parameter>&nbsp;:</entry>
<entry> the required key usage.
</entry></row>
<row><entry align="right"><parameter>certsVerificationTime</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to key or NULL if the key is not found or 
an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
