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

<refnamediv>
<refname>xmldsig.h</refname><refpurpose>The <ulink url="http://www.w3.org/Signature/">XML Digital Signature</ulink> 
standard implementation.</refpurpose>
</refnamediv>

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



struct      <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link>;
<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> <link linkend="xmlSecDSigCtxCreate">xmlSecDSigCtxCreate</link>        (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> keysMngr);
void        <link linkend="xmlSecDSigCtxDestroy">xmlSecDSigCtxDestroy</link>            (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx);
int         <link linkend="xmlSecDSigValidate">xmlSecDSigValidate</link>              (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx,
                                             void *context,
                                             <link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             <link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> *result);
int         <link linkend="xmlSecDSigGenerate">xmlSecDSigGenerate</link>              (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx,
                                             void *context,
                                             <link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             <link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> *result);
struct      <link linkend="xmlSecDSigResult">xmlSecDSigResult</link>;
struct      <link linkend="xmlSecReferenceResult">xmlSecReferenceResult</link>;
enum        <link linkend="xmlSecReferenceType">xmlSecReferenceType</link>;
<link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> <link linkend="xmlSecDSigResultCreate">xmlSecDSigResultCreate</link>  (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx,
                                             void *context,
                                             <link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             int sign);
void        <link linkend="xmlSecDSigResultDestroy">xmlSecDSigResultDestroy</link>         (<link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> result);
void        <link linkend="xmlSecDSigResultDebugDump">xmlSecDSigResultDebugDump</link>       (<link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> result,
                                             <link linkend="FILE-CAPS">FILE</link> *output);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignatureCreate">xmlSecSignatureCreate</link>           (const <link linkend="xmlChar">xmlChar</link> *id);
void        <link linkend="xmlSecSignatureDestroy">xmlSecSignatureDestroy</link>          (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignatureAddSignedInfo">xmlSecSignatureAddSignedInfo</link>    (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignatureAddKeyInfo">xmlSecSignatureAddKeyInfo</link>       (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignatureAddObject">xmlSecSignatureAddObject</link>        (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *mimeType,
                                             const <link linkend="xmlChar">xmlChar</link> *encoding);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignedInfoAddC14NMethod">xmlSecSignedInfoAddC14NMethod</link>   (<link linkend="xmlNodePtr">xmlNodePtr</link> signedInfoNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> c14nMethod);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignedInfoAddSignMethod">xmlSecSignedInfoAddSignMethod</link>   (<link linkend="xmlNodePtr">xmlNodePtr</link> signedInfoNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> signMethod);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecSignedInfoAddReference">xmlSecSignedInfoAddReference</link>    (<link linkend="xmlNodePtr">xmlNodePtr</link> signedInfoNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *uri,
                                             const <link linkend="xmlChar">xmlChar</link> *type);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecReferenceAddDigestMethod">xmlSecReferenceAddDigestMethod</link>  (<link linkend="xmlNodePtr">xmlNodePtr</link> refNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> digestMethod);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecReferenceAddTransform">xmlSecReferenceAddTransform</link>     (<link linkend="xmlNodePtr">xmlNodePtr</link> refNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> transform);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecObjectAddSignProperties">xmlSecObjectAddSignProperties</link>   (<link linkend="xmlNodePtr">xmlNodePtr</link> objectNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *target);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecObjectAddManifest">xmlSecObjectAddManifest</link>         (<link linkend="xmlNodePtr">xmlNodePtr</link> objectNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id);
<link linkend="xmlNodePtr">xmlNodePtr</link>  <link linkend="xmlSecManifestAddReference">xmlSecManifestAddReference</link>      (<link linkend="xmlNodePtr">xmlNodePtr</link> manifestNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *uri,
                                             const <link linkend="xmlChar">xmlChar</link> *type);
</synopsis>
</refsynopsisdiv>





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

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="xmlSecDSigCtx">struct xmlSecDSigCtx</title>
<programlisting>struct xmlSecDSigCtx {
    xmlSecKeysMngrPtr		keysMngr;
    int				processManifests;
    int				storeSignatures;
    int				storeReferences;
    int				storeManifests;	
    int				fakeSignatures;
    time_t			certsVerificationTime;
};
</programlisting>
<para>
XML DSig context.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> <structfield>keysMngr</structfield></entry>
<entry> the keys manager <link linkend="xmlSecKeysMngr">xmlSecKeysMngr</link>.
</entry>
</row>
<row>
<entry>int <structfield>processManifests</structfield></entry>
<entry> if 0 then &lt;dsig:Manifests&gt; nodes are not processed.
</entry>
</row>
<row>
<entry>int <structfield>storeSignatures</structfield></entry>
<entry> store the signed content just (&lt;dsig:SignedInfo&gt; element)
before applying signature.
</entry>
</row>
<row>
<entry>int <structfield>storeReferences</structfield></entry>
<entry> store the result of processing &lt;dsig:Reference&gt; nodes in 
     &lt;dsig:SignedInfo&gt; nodes just before digesting.
</entry>
</row>
<row>
<entry>int <structfield>storeManifests</structfield></entry>
<entry> store the result of processing &lt;dsig:Reference&gt; nodes in 
&lt;dsig:Manifest&gt; nodes just before digesting (ignored if <parameter>processManifest</parameter> is 0).
</entry>
</row>
<row>
<entry>int <structfield>fakeSignatures</structfield></entry>
<entry> for performance testing only.
</entry>
</row>
<row>
<entry><link linkend="time-t">time_t</link> <structfield>certsVerificationTime</structfield></entry>
<entry>

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigCtxCreate">xmlSecDSigCtxCreate ()</title>
<programlisting><link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> xmlSecDSigCtxCreate        (<link linkend="xmlSecKeysMngrPtr">xmlSecKeysMngrPtr</link> keysMngr);</programlisting>
<para>
Creates new <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</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>keysMngr</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecKeysMngr">xmlSecKeysMngr</link> structure
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>pointer to newly allocated <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link> structure or NULL
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigCtxDestroy">xmlSecDSigCtxDestroy ()</title>
<programlisting>void        xmlSecDSigCtxDestroy            (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx);</programlisting>
<para>
Destroys <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link> structure <parameter>ctx</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>ctx</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigValidate">xmlSecDSigValidate ()</title>
<programlisting>int         xmlSecDSigValidate              (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx,
                                             void *context,
                                             <link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             <link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> *result);</programlisting>
<para>
Validates the signature in <parameter>signNode</parameter> and stores the pointer to validation 
result structure <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> in the <parameter>result</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>ctx</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link> structure.
</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 key to use (if NULL then the key specified in &lt;dsig:KeyInfo&gt;
    will be used).   
</entry></row>
<row><entry align="right"><parameter>signNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Signature&gt; node that will be validated.
</entry></row>
<row><entry align="right"><parameter>result</parameter>&nbsp;:</entry>
<entry> the pointer where to store validation results.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 if there were no processing errors during validation or a negative
value otherwise. The return value equal to 0 DOES NOT mean that the signature
is valid: check the <link linkend="result">result</link> member of <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> structure instead.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigGenerate">xmlSecDSigGenerate ()</title>
<programlisting>int         xmlSecDSigGenerate              (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx,
                                             void *context,
                                             <link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> key,
                                             <link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             <link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> *result);</programlisting>
<para>
Signs the data according to the template in <parameter>signNode</parameter> node.</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>ctx</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link> structure.
</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 key to use (if NULL then the key specified in &lt;dsig:KeyInfo&gt;
    will be used).   
</entry></row>
<row><entry align="right"><parameter>signNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Signature&gt; node template.
</entry></row>
<row><entry align="right"><parameter>result</parameter>&nbsp;:</entry>
<entry> the pointer where to store signature results.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success and a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigResult">struct xmlSecDSigResult</title>
<programlisting>struct xmlSecDSigResult {
    xmlSecDSigCtxPtr		ctx;
    void			*context;
    xmlNodePtr			self;
    int				sign;
    xmlSecTransformStatus	result;
    xmlSecTransformId		signMethod;
    xmlSecKeyPtr		key;
    xmlSecReferenceResultPtr	firstSignRef;
    xmlSecReferenceResultPtr	lastSignRef;
    xmlSecReferenceResultPtr	firstManifestRef;
    xmlSecReferenceResultPtr	lastManifestRef; 
    xmlBufferPtr		buffer;
};
</programlisting>
<para>
XML DSig Result.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> <structfield>ctx</structfield></entry>
<entry> the DSig context <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link>.
</entry>
</row>
<row>
<entry>void *<structfield>context</structfield></entry>
<entry> the pointer to application specific data.
</entry>
</row>
<row>
<entry><link linkend="xmlNodePtr">xmlNodePtr</link> <structfield>self</structfield></entry>
<entry> the pointer to &lt;dsig:Signature&gt; node.
</entry>
</row>
<row>
<entry>int <structfield>sign</structfield></entry>
<entry> the sign/verify flag.
</entry>
</row>
<row>
<entry><link linkend="xmlSecTransformStatus">xmlSecTransformStatus</link> <structfield>result</structfield></entry>
<entry> the signature verification/generation status.
</entry>
</row>
<row>
<entry><link linkend="xmlSecTransformId">xmlSecTransformId</link> <structfield>signMethod</structfield></entry>
<entry> the signature algorithm .
</entry>
</row>
<row>
<entry><link linkend="xmlSecKeyPtr">xmlSecKeyPtr</link> <structfield>key</structfield></entry>
<entry> the pointer to signature key.
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceResultPtr">xmlSecReferenceResultPtr</link> <structfield>firstSignRef</structfield></entry>
<entry> the pointer to the first &lt;dsig:SignedInfo&gt; reference result.
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceResultPtr">xmlSecReferenceResultPtr</link> <structfield>lastSignRef</structfield></entry>
<entry> the pointer to the last  &lt;dsig:SignedInfo&gt; reference result.
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceResultPtr">xmlSecReferenceResultPtr</link> <structfield>firstManifestRef</structfield></entry>
<entry> the pointer to the first &lt;dsig:Manifest&gt; reference result
   (valid only if the <link linkend="processManifests">processManifests</link> flag in <parameter>ctx</parameter> is set to 1).  
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceResultPtr">xmlSecReferenceResultPtr</link> <structfield>lastManifestRef</structfield></entry>
<entry> the pointer to the last  &lt;dsig:Manifest&gt; reference result
   (valid only if the <link linkend="processManifests">processManifests</link> flag in <parameter>ctx</parameter> is set to 1).  
</entry>
</row>
<row>
<entry><link linkend="xmlBufferPtr">xmlBufferPtr</link> <structfield>buffer</structfield></entry>
<entry> the pointer to the signed content - the canonicalization of 
   &lt;dsig:SignedInfo&gt; node  (valid only if the <link linkend="storeSignatures">storeSignatures</link> flag 
   in <link linkend="ctx">ctx</link> structure is set to 1).
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecReferenceResult">struct xmlSecReferenceResult</title>
<programlisting>struct xmlSecReferenceResult {
    xmlSecDSigCtxPtr		ctx;
    xmlNodePtr			self;
    xmlSecReferenceType		refType;
    xmlSecTransformStatus	result;
    xmlSecReferenceResultPtr	next;
    xmlSecReferenceResultPtr	prev;
    xmlChar			*uri;
    xmlChar			*id;
    xmlChar			*type;
    xmlSecTransformId		digestMethod;
    xmlBufferPtr		buffer;
}; 
</programlisting>
<para>
The result of &lt;dsig:Reference&gt; processing.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> <structfield>ctx</structfield></entry>
<entry> the pointer to DSig context.
</entry>
</row>
<row>
<entry><link linkend="xmlNodePtr">xmlNodePtr</link> <structfield>self</structfield></entry>
<entry> the pointer to &lt;dsig:Reference&gt; node.
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceType">xmlSecReferenceType</link> <structfield>refType</structfield></entry>
<entry> the &lt;dsig:Reference&gt; node location.
</entry>
</row>
<row>
<entry><link linkend="xmlSecTransformStatus">xmlSecTransformStatus</link> <structfield>result</structfield></entry>
<entry> the verification/generation result.
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceResultPtr">xmlSecReferenceResultPtr</link> <structfield>next</structfield></entry>
<entry> the next reference result.
</entry>
</row>
<row>
<entry><link linkend="xmlSecReferenceResultPtr">xmlSecReferenceResultPtr</link> <structfield>prev</structfield></entry>
<entry> the prev reference result.
</entry>
</row>
<row>
<entry><link linkend="xmlChar">xmlChar</link> *<structfield>uri</structfield></entry>
<entry> the &lt;dsig:Reference&gt; node URI attribute.
</entry>
</row>
<row>
<entry><link linkend="xmlChar">xmlChar</link> *<structfield>id</structfield></entry>
<entry> the &lt;dsig:Reference&gt; node Id attribute.
</entry>
</row>
<row>
<entry><link linkend="xmlChar">xmlChar</link> *<structfield>type</structfield></entry>
<entry> the &lt;dsig:Reference&gt; node Type attribute.
</entry>
</row>
<row>
<entry><link linkend="xmlSecTransformId">xmlSecTransformId</link> <structfield>digestMethod</structfield></entry>
<entry> the used digest algorithm id.
</entry>
</row>
<row>
<entry><link linkend="xmlBufferPtr">xmlBufferPtr</link> <structfield>buffer</structfield></entry>
<entry> the pointer to digested content (valid only if 
	the <link linkend="storeReferences">storeReferences</link> or <link linkend="storeManifests">storeManifests</link> flags in <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link>).
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecReferenceType">enum xmlSecReferenceType</title>
<programlisting>typedef enum  {
    xmlSecSignedInfoReference,
    xmlSecManifestReference
} xmlSecReferenceType;
</programlisting>
<para>
The possible &lt;dsig:Reference&gt; node locations: 
in the &lt;dsig:SignedInfo&gt; node or in the &lt;dsig:Manifest&gt; node.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>xmlSecSignedInfoReference</literal></entry>
<entry> reference in &lt;dsig:SignedInfo&gt; node.
</entry>
</row>
<row>
<entry><literal>xmlSecManifestReference</literal></entry>
<entry> reference &lt;dsig:Manifest&gt; node.
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigResultCreate">xmlSecDSigResultCreate ()</title>
<programlisting><link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> xmlSecDSigResultCreate  (<link linkend="xmlSecDSigCtxPtr">xmlSecDSigCtxPtr</link> ctx,
                                             void *context,
                                             <link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             int sign);</programlisting>
<para>
Creates new <link linkend="xmlSecDSigResult">xmlSecDSigResult</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>ctx</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecDSigCtx">xmlSecDSigCtx</link> structure.
</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>signNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Signature&gt; node that will be validated.
</entry></row>
<row><entry align="right"><parameter>sign</parameter>&nbsp;:</entry>
<entry> the sign or verify flag.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>newly created <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> structure or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigResultDestroy">xmlSecDSigResultDestroy ()</title>
<programlisting>void        xmlSecDSigResultDestroy         (<link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> result);</programlisting>
<para>
Destroys the <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> structure <parameter>result</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>result</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> structure.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecDSigResultDebugDump">xmlSecDSigResultDebugDump ()</title>
<programlisting>void        xmlSecDSigResultDebugDump       (<link linkend="xmlSecDSigResultPtr">xmlSecDSigResultPtr</link> result,
                                             <link linkend="FILE-CAPS">FILE</link> *output);</programlisting>
<para>
Prints the <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> structure <parameter>result</parameter> to file <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>result</parameter>&nbsp;:</entry>
<entry> the pointer to <link linkend="xmlSecDSigResult">xmlSecDSigResult</link> structure.
</entry></row>
<row><entry align="right"><parameter>output</parameter>&nbsp;:</entry>
<entry> the pointer to destination FILE.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignatureCreate">xmlSecSignatureCreate ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignatureCreate           (const <link linkend="xmlChar">xmlChar</link> *id);</programlisting>
<para>
Creates new &lt;dsig:Signature&gt; node with the mandatory &lt;dsig:SignatureValue&gt; 
child. The application is responsible for inserting the returned node
in the XML document.</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 node id (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:Signature&gt; node or NULL if an 
error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignatureDestroy">xmlSecSignatureDestroy ()</title>
<programlisting>void        xmlSecSignatureDestroy          (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode);</programlisting>
<para>
Destroys standalone &lt;dsig:Signature&gt; node. You MUST not call this function 
if the &lt;dsig:Signature&gt; node was inserted in the XML document.</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>signNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Signature&gt; node.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignatureAddSignedInfo">xmlSecSignatureAddSignedInfo ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignatureAddSignedInfo    (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id);</programlisting>
<para>
Adds &lt;dsig:SignedInfo&gt; node to the &lt;dsig:Signature&gt; node <parameter>signNode</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>signNode</parameter>&nbsp;:</entry>
<entry> the  pointer to &lt;dsig:Signature&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:SignedInfo&gt; node or NULL if 
an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignatureAddKeyInfo">xmlSecSignatureAddKeyInfo ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignatureAddKeyInfo       (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id);</programlisting>
<para>
Adds &lt;dsig:KeyInfo&gt; node to the &lt;dsig:Signature&gt; node <parameter>signNode</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>signNode</parameter>&nbsp;:</entry>
<entry> the  pointer to &lt;dsig:Signature&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:KeyInfo&gt; node or NULL if an 
error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignatureAddObject">xmlSecSignatureAddObject ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignatureAddObject        (<link linkend="xmlNodePtr">xmlNodePtr</link> signNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *mimeType,
                                             const <link linkend="xmlChar">xmlChar</link> *encoding);</programlisting>
<para>
Adds &lt;dsig:Object&gt; node to the &lt;dsig:Signature&gt; node <parameter>signNode</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>signNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Signature&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><parameter>mimeType</parameter>&nbsp;:</entry>
<entry> the object mime type (may be NULL).
</entry></row>
<row><entry align="right"><parameter>encoding</parameter>&nbsp;:</entry>
<entry> the object encoding (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:Object&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignedInfoAddC14NMethod">xmlSecSignedInfoAddC14NMethod ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignedInfoAddC14NMethod   (<link linkend="xmlNodePtr">xmlNodePtr</link> signedInfoNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> c14nMethod);</programlisting>
<para>
Adds &lt;dsig:CanonicalizationMethod&gt; node with specified C14N algorithm
<parameter>c14nMethod</parameter> to the &lt;dsig:SignedInfo&gt; node <parameter>signedInfoNode</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>signedInfoNode</parameter>&nbsp;:</entry>
<entry> the  pointer to &lt;dsig:SignedInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>c14nMethod</parameter>&nbsp;:</entry>
<entry> the c14n method id.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:CanonicalizationMethod&gt; node or 
NULL if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignedInfoAddSignMethod">xmlSecSignedInfoAddSignMethod ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignedInfoAddSignMethod   (<link linkend="xmlNodePtr">xmlNodePtr</link> signedInfoNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> signMethod);</programlisting>
<para>
Adds &lt;dsig:SignatureMethod&gt; node with given signature algorithm
<parameter>signMethod</parameter> to the &lt;dsig:SignedInfo&gt; node <parameter>signedInfoNode</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>signedInfoNode</parameter>&nbsp;:</entry>
<entry> the  pointer to &lt;dsig:SignedInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>signMethod</parameter>&nbsp;:</entry>
<entry> the result method id.     
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:SignatureMethod&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecSignedInfoAddReference">xmlSecSignedInfoAddReference ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecSignedInfoAddReference    (<link linkend="xmlNodePtr">xmlNodePtr</link> signedInfoNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *uri,
                                             const <link linkend="xmlChar">xmlChar</link> *type);</programlisting>
<para>
Adds &lt;dsig:Reference&gt; node with given URI (<parameter>uri</parameter>), Id (<parameter>id</parameter>) and 
Type (<parameter>type</parameter>) attributes and the required child node &lt;dsig:DigestValue&gt; 
to the &lt;dsig:SignedInfo&gt; node <parameter>signedInfoNode</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>signedInfoNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:SignedInfo&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><parameter>uri</parameter>&nbsp;:</entry>
<entry> the reference node uri (may be NULL).
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the reference node type (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:Reference&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecReferenceAddDigestMethod">xmlSecReferenceAddDigestMethod ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecReferenceAddDigestMethod  (<link linkend="xmlNodePtr">xmlNodePtr</link> refNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> digestMethod);</programlisting>
<para>
Adds &lt;dsig:DigestMethod&gt; node with given digest algorithm 
(<parameter>digestMethod</parameter>) to the &lt;dsig:Reference&gt; node <parameter>refNode</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>refNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Reference&gt; node.
</entry></row>
<row><entry align="right"><parameter>digestMethod</parameter>&nbsp;:</entry>
<entry> the digest method id.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:DigestMethod&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecReferenceAddTransform">xmlSecReferenceAddTransform ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecReferenceAddTransform     (<link linkend="xmlNodePtr">xmlNodePtr</link> refNode,
                                             <link linkend="xmlSecTransformId">xmlSecTransformId</link> transform);</programlisting>
<para>
Adds &lt;dsig:Transform&gt; node to the &lt;dsig:Reference&gt; node <parameter>refNode</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>refNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Reference&gt; node.
</entry></row>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the transform method id.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:Transform&gt; node or NULL if an 
error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecObjectAddSignProperties">xmlSecObjectAddSignProperties ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecObjectAddSignProperties   (<link linkend="xmlNodePtr">xmlNodePtr</link> objectNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *target);</programlisting>
<para>
Adds &lt;dsig:SignatureProperties&gt; node to the &lt;dsig:Object&gt; node <parameter>objectNode</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>objectNode</parameter>&nbsp;:</entry>
<entry> the  pointer to &lt;dsig:Object&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><parameter>target</parameter>&nbsp;:</entry>
<entry> the Target  (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:SignatureProperties&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecObjectAddManifest">xmlSecObjectAddManifest ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecObjectAddManifest         (<link linkend="xmlNodePtr">xmlNodePtr</link> objectNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id);</programlisting>
<para>
Adds &lt;dsig:Manifest&gt; node to the &lt;dsig:Object&gt; node <parameter>objectNode</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>objectNode</parameter>&nbsp;:</entry>
<entry> the  pointer to &lt;dsig:Object&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:Manifest&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecManifestAddReference">xmlSecManifestAddReference ()</title>
<programlisting><link linkend="xmlNodePtr">xmlNodePtr</link>  xmlSecManifestAddReference      (<link linkend="xmlNodePtr">xmlNodePtr</link> manifestNode,
                                             const <link linkend="xmlChar">xmlChar</link> *id,
                                             const <link linkend="xmlChar">xmlChar</link> *uri,
                                             const <link linkend="xmlChar">xmlChar</link> *type);</programlisting>
<para>
Adds &lt;dsig:Reference&gt; node with specified URI (<parameter>uri</parameter>), Id (<parameter>id</parameter>) and 
Type (<parameter>type</parameter>) attributes and the required child node &lt;dsig:DigestValue&gt; 
to the &lt;dsig:Manifest&gt; node <parameter>manifestNode</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>manifestNode</parameter>&nbsp;:</entry>
<entry> the pointer to &lt;dsig:Manifest&gt; node.
</entry></row>
<row><entry align="right"><parameter>id</parameter>&nbsp;:</entry>
<entry> the node id (may be NULL).
</entry></row>
<row><entry align="right"><parameter>uri</parameter>&nbsp;:</entry>
<entry> the reference node uri (may be NULL).
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> the reference node type (may be NULL).
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the pointer to newly created &lt;dsig:Reference&gt; node or NULL 
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
