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

<refnamediv>
<refname>keyinfo.h</refname><refpurpose>The &lt;dsig:KeyInfo&gt; element manipulation functions.</refpurpose>
</refnamediv>

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



<link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <link linkend="xmlSecKeyInfoNodeRead">xmlSecKeyInfoNodeRead</link>          (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> keysMngr,
                                             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);
int         <link linkend="xmlSecKeyInfoNodeWrite">xmlSecKeyInfoNodeWrite</link>          (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> keysMngr,
                                             void *context,
                                             <link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecKeyInfoAddKeyName">xmlSecKeyInfoAddKeyName</link>         (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecKeyInfoAddKeyValue">xmlSecKeyInfoAddKeyValue</link>        (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecKeyInfoAddX509Data">xmlSecKeyInfoAddX509Data</link>        (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecKeyInfoAddRetrievalMethod">xmlSecKeyInfoAddRetrievalMethod</link> (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             const <link linkend="xmlChar">xmlChar</link> *uri,
                                             const <link linkend="xmlChar">xmlChar</link> *type);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecRetrievalMethodAddTransform">xmlSecRetrievalMethodAddTransform</link>
                                            (<link linkend="xmlNodePtr">xmlNodePtr</link> retrMethod,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> transform);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecKeyInfoAddEncryptedKey">xmlSecKeyInfoAddEncryptedKey</link>    (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *type,
                                             const <link linkend="xmlChar">xmlChar</link> *recipient);
</synopsis>
</refsynopsisdiv>





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

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="xmlSecKeyInfoNodeRead">xmlSecKeyInfoNodeRead ()</title>
<programlisting><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> xmlSecKeyInfoNodeRead          (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> keysMngr,
                                             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>
Parses the &lt;dsig:KeyInfo&gt; element and extracts the key (with required 
id, type and usage).</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>keysMngr</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecKeysMngr">xmlSecKeysMngr</link> struvture.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer to application specific data that will be 
    passed to all callback functions.
</entry></row>
<row><entry align="right"><parameter>keyId</parameter>&nbsp;:</entry>
<entry> the required key id or NULL.
</entry></row>
<row><entry align="right"><parameter>keyType</parameter>&nbsp;:</entry>
<entry> the required key type (may be "any").
</entry></row>
<row><entry align="right"><parameter>keyUsage</parameter>&nbsp;:</entry>
<entry> the desired 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 extracted key or NULL if an error occurs or
required key is not found.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyInfoNodeWrite">xmlSecKeyInfoNodeWrite ()</title>
<programlisting>int         xmlSecKeyInfoNodeWrite          (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             <link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> keysMngr,
                                             void *context,
                                             <link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlSecKeyType">xmlSecKeyType</link> type);</programlisting>
<para>
Writes the key into the &lt;dsig:KeyInfo&gt; template <parameter>keyInfoNode</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>keysMngr</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecKeysMngr">xmlSecKeysMngr</link> struvture.
</entry></row>
<row><entry align="right"><parameter>context</parameter>&nbsp;:</entry>
<entry> the pointer to application specific data that will be 
    passed to all callback functions.
</entry></row>
<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>type</parameter>&nbsp;:</entry>
<entry> the key type (public/private).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success or -1 if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyInfoAddKeyName">xmlSecKeyInfoAddKeyName ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecKeyInfoAddKeyName         (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode);</programlisting>
<para>
Adds &lt;dsig:KeyName&gt; node to the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to the newly created &lt;dsig:KeyName&gt; node or
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyInfoAddKeyValue">xmlSecKeyInfoAddKeyValue ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecKeyInfoAddKeyValue        (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode);</programlisting>
<para>
Adds &lt;dsig:KeyValue&gt; node to the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to the newly created &lt;dsig:KeyValue&gt; node or
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyInfoAddX509Data">xmlSecKeyInfoAddX509Data ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecKeyInfoAddX509Data        (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode);</programlisting>
<para>
Adds &lt;dsig:X509Data&gt; node to the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to the newly created &lt;dsig:X509Data&gt; node or
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyInfoAddRetrievalMethod">xmlSecKeyInfoAddRetrievalMethod ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecKeyInfoAddRetrievalMethod (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             const <link linkend="xmlChar">xmlChar</link> *uri,
                                             const <link linkend="xmlChar">xmlChar</link> *type);</programlisting>
<para>
Adds &lt;dsig:RetrievalMethod&gt; node to the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>uri</parameter>&nbsp;:</entry>
<entry> the URI attribute (optional).
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the Type attribute(optional).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to the newly created &lt;dsig:RetrievalMethod&gt; node or
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecRetrievalMethodAddTransform">xmlSecRetrievalMethodAddTransform ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecRetrievalMethodAddTransform
                                            (<link linkend="xmlNodePtr">xmlNodePtr</link> retrMethod,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> transform);</programlisting>
<para>
Adds &lt;dsig:Transform&gt; node (and the parent &lt;dsig:Transforms&gt; node
if required) to the &lt;dsig:RetrievalMethod&gt; node <parameter>retrMethod</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>retrMethod</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:RetrievalMethod&gt; node.
</entry></row>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the transform id.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to the newly created &lt;dsig:dsig:Transforms&gt; node or
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecKeyInfoAddEncryptedKey">xmlSecKeyInfoAddEncryptedKey ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecKeyInfoAddEncryptedKey    (<link linkend="xmlNodePtr">xmlNodePtr</link> keyInfoNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *type,
                                             const <link linkend="xmlChar">xmlChar</link> *recipient);</programlisting>
<para>
Adds &lt;enc:EncryptedKey&gt; node with given attributes to 
the &lt;dsig:KeyInfo&gt; node <parameter>keyInfoNode</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>keyInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:KeyInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the Id attribute (optional).
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the Type attribute (optional). 
</entry></row>
<row><entry align="right"><parameter>recipient</parameter>&nbsp;:</entry>
<entry> the Recipient attribute (optional). 
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to the newly created &lt;enc:EncryptedKey&gt; node or
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
