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

<refnamediv>
<refname>xmlenc</refname>
<refpurpose>XML Encryption support.</refpurpose>
</refnamediv>

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

<synopsis>
enum                <link linkend="xmlEncCtxMode">xmlEncCtxMode</link>;
#define             <link linkend="XMLSEC-ENC-RETURN-REPLACED-NODE--CAPS">XMLSEC_ENC_RETURN_REPLACED_NODE</link>
struct              <link linkend="xmlSecEncCtx">xmlSecEncCtx</link>;
<link linkend="xmlSecEncCtxPtr">xmlSecEncCtxPtr</link>     <link linkend="xmlSecEncCtxCreate">xmlSecEncCtxCreate</link>                  (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> keysMngr);
<link linkend="void">void</link>                <link linkend="xmlSecEncCtxDestroy">xmlSecEncCtxDestroy</link>                 (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx);
<link linkend="int">int</link>                 <link linkend="xmlSecEncCtxInitialize">xmlSecEncCtxInitialize</link>              (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> keysMngr);
<link linkend="void">void</link>                <link linkend="xmlSecEncCtxFinalize">xmlSecEncCtxFinalize</link>                (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx);
<link linkend="int">int</link>                 <link linkend="xmlSecEncCtxCopyUserPref">xmlSecEncCtxCopyUserPref</link>            (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> dst,
                                                         <link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> src);
<link linkend="void">void</link>                <link linkend="xmlSecEncCtxReset">xmlSecEncCtxReset</link>                   (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx);
<link linkend="int">int</link>                 <link linkend="xmlSecEncCtxBinaryEncrypt">xmlSecEncCtxBinaryEncrypt</link>           (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> tmpl,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize);
<link linkend="int">int</link>                 <link linkend="xmlSecEncCtxXmlEncrypt">xmlSecEncCtxXmlEncrypt</link>              (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> tmpl,
                                                         <link linkend="xmlNode">xmlNodePtr</link> node);
<link linkend="int">int</link>                 <link linkend="xmlSecEncCtxUriEncrypt">xmlSecEncCtxUriEncrypt</link>              (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> tmpl,
                                                         const <link linkend="xmlChar">xmlChar</link> *uri);
<link linkend="int">int</link>                 <link linkend="xmlSecEncCtxDecrypt">xmlSecEncCtxDecrypt</link>                 (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> node);
<link linkend="xmlSecBufferPtr">xmlSecBufferPtr</link>     <link linkend="xmlSecEncCtxDecryptToBuffer">xmlSecEncCtxDecryptToBuffer</link>         (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> node);
<link linkend="void">void</link>                <link linkend="xmlSecEncCtxDebugDump">xmlSecEncCtxDebugDump</link>               (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="FILE--CAPS">FILE</link> *output);
<link linkend="void">void</link>                <link linkend="xmlSecEncCtxDebugXmlDump">xmlSecEncCtxDebugXmlDump</link>            (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="FILE--CAPS">FILE</link> *output);
</synopsis>
</refsynopsisdiv>









<refsect1 id="xmlsec-xmlenc.description" role="desc">
<title role="desc.title">Description</title>
<para>
XML Encryption support.
</para>
</refsect1>

<refsect1 id="xmlsec-xmlenc.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="xmlEncCtxMode" role="enum">
<title>enum xmlEncCtxMode</title>
<indexterm zone="xmlEncCtxMode"><primary sortas="xmlEncCtxMode">xmlEncCtxMode</primary></indexterm><programlisting>typedef enum {
    xmlEncCtxModeEncryptedData = 0,
    xmlEncCtxModeEncryptedKey
} xmlEncCtxMode;
</programlisting>
<para>
The <link linkend="xmlSecEncCtx"><type>xmlSecEncCtx</type></link> mode.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="xmlEncCtxModeEncryptedData" role="constant">
<term><literal>xmlEncCtxModeEncryptedData</literal></term>
<listitem><simpara> the <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> element procesing.
</simpara></listitem>
</varlistentry>
<varlistentry id="xmlEncCtxModeEncryptedKey" role="constant">
<term><literal>xmlEncCtxModeEncryptedKey</literal></term>
<listitem><simpara>  the <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> element processing.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="XMLSEC-ENC-RETURN-REPLACED-NODE--CAPS" role="macro">
<title>XMLSEC_ENC_RETURN_REPLACED_NODE</title>
<indexterm zone="XMLSEC-ENC-RETURN-REPLACED-NODE--CAPS"><primary sortas="XMLSEC_ENC_RETURN_REPLACED_NODE">XMLSEC_ENC_RETURN_REPLACED_NODE</primary></indexterm><programlisting>#define XMLSEC_ENC_RETURN_REPLACED_NODE                 0x00000001
</programlisting>
<para>
If this flag is set, then the replaced node will be returned in the replacedNodeList</para>
<para>
</para></refsect2>
<refsect2 id="xmlSecEncCtx" role="struct">
<title>struct xmlSecEncCtx</title>
<indexterm zone="xmlSecEncCtx"><primary sortas="xmlSecEncCtx">xmlSecEncCtx</primary></indexterm><programlisting>struct xmlSecEncCtx {
    /* these data user can set before performing the operation */
    void*                       userData;
    unsigned int                flags;
    unsigned int                flags2;
    xmlEncCtxMode               mode;
    xmlSecKeyInfoCtx            keyInfoReadCtx;
    xmlSecKeyInfoCtx            keyInfoWriteCtx;
    xmlSecTransformCtx          transformCtx;
    xmlSecTransformId           defEncMethodId;

    /* these data are returned */
    xmlSecKeyPtr                encKey;
    xmlSecTransformOperation    operation;
    xmlSecBufferPtr             result;
    int                         resultBase64Encoded;
    int                         resultReplaced;
    xmlSecTransformPtr          encMethod;

    /* attributes from EncryptedData or EncryptedKey */
    xmlChar*                    id;
    xmlChar*                    type;
    xmlChar*                    mimeType;
    xmlChar*                    encoding;
    xmlChar*                    recipient;
    xmlChar*                    carriedKeyName;

    /* these are internal data, nobody should change that except us */
    xmlNodePtr                  encDataNode;
    xmlNodePtr                  encMethodNode;
    xmlNodePtr                  keyInfoNode;
    xmlNodePtr                  cipherValueNode;

    xmlNodePtr                  replacedNodeList; /* the pointer to the replaced node */
    void*                       reserved1;        /* reserved for future */
};
</programlisting>
<para>
XML Encrypiton context.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="void">void</link>&#160;*<structfield>userData</structfield>;</term>
<listitem><simpara>                   the pointer to user data (xmlsec and xmlsec-crypto libraries
                             never touches this).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>unsigned&#160;<link linkend="int">int</link>&#160;<structfield>flags</structfield>;</term>
<listitem><simpara>                      the XML Encryption processing flags.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term>unsigned&#160;<link linkend="int">int</link>&#160;<structfield>flags2</structfield>;</term>
<listitem><simpara>                     the XML Encryption processing flags.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlEncCtxMode">xmlEncCtxMode</link>&#160;<structfield>mode</structfield>;</term>
<listitem><simpara>                       the mode.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtx</link>&#160;<structfield>keyInfoReadCtx</structfield>;</term>
<listitem><simpara>             the reading key context.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecKeyInfoCtx">xmlSecKeyInfoCtx</link>&#160;<structfield>keyInfoWriteCtx</structfield>;</term>
<listitem><simpara>            the writing key context (not used for signature verification).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecTransformCtx">xmlSecTransformCtx</link>&#160;<structfield>transformCtx</structfield>;</term>
<listitem><simpara>               the transforms processing context.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecTransformId">xmlSecTransformId</link>&#160;<structfield>defEncMethodId</structfield>;</term>
<listitem><simpara>             the default encryption method (used if
                             <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptionMethod">&lt;enc:EncryptionMethod/&gt;</ulink> node is not present).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecKey">xmlSecKeyPtr</link>&#160;<structfield>encKey</structfield>;</term>
<listitem><simpara>                     the signature key; application may set <link linkend="encKey"><type>encKey</type></link>
                             before calling encryption/decryption functions.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecTransformOperation">xmlSecTransformOperation</link>&#160;<structfield>operation</structfield>;</term>
<listitem><simpara>                  the operation: encrypt or decrypt.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecBuffer">xmlSecBufferPtr</link>&#160;<structfield>result</structfield>;</term>
<listitem><simpara>                     the pointer to signature (not valid for signature verification).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&#160;<structfield>resultBase64Encoded</structfield>;</term>
<listitem><simpara>        the flag: if set then result in <link linkend="result"><type>result</type></link> is base64 encoded.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&#160;<structfield>resultReplaced</structfield>;</term>
<listitem><simpara>             the flag: if set then resulted <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink>
                             or <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node is added to the document.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlSecTransform">xmlSecTransformPtr</link>&#160;<structfield>encMethod</structfield>;</term>
<listitem><simpara>                  the pointer to encryption transform.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlChar">xmlChar</link>&#160;*<structfield>id</structfield>;</term>
<listitem><simpara>                         the ID attribute of <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink>
                             or <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlChar">xmlChar</link>&#160;*<structfield>type</structfield>;</term>
<listitem><simpara>                       the Type attribute of <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink>
                             or <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlChar">xmlChar</link>&#160;*<structfield>mimeType</structfield>;</term>
<listitem><simpara>                   the MimeType attribute of <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink>
                             or <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlChar">xmlChar</link>&#160;*<structfield>encoding</structfield>;</term>
<listitem><simpara>                   the Encoding attributeof <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink>
                             or <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlChar">xmlChar</link>&#160;*<structfield>recipient</structfield>;</term>
<listitem><simpara>                  the Recipient attribute of <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node..
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlChar">xmlChar</link>&#160;*<structfield>carriedKeyName</structfield>;</term>
<listitem><simpara>             the CarriedKeyName attribute of <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlNode">xmlNodePtr</link>&#160;<structfield>encDataNode</structfield>;</term>
<listitem><simpara>                the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink>
                             or <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedKey">&lt;enc:EncryptedKey/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlNode">xmlNodePtr</link>&#160;<structfield>encMethodNode</structfield>;</term>
<listitem><simpara>              the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptionMethod">&lt;enc:EncryptionMethod/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlNode">xmlNodePtr</link>&#160;<structfield>keyInfoNode</structfield>;</term>
<listitem><simpara>                the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-KeyInfo">&lt;enc:KeyInfo/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlNode">xmlNodePtr</link>&#160;<structfield>cipherValueNode</structfield>;</term>
<listitem><simpara>            the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-CipherValue">&lt;enc:CipherValue/&gt;</ulink> node.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="xmlNode">xmlNodePtr</link>&#160;<structfield>replacedNodeList</structfield>;</term>
<listitem><simpara> the first node of the list of replaced nodes depending on the nodeReplacementMode
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="void">void</link>&#160;*<structfield>reserved1</structfield>;</term>
<listitem><simpara>                  reserved for the future.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxCreate" role="function">
<title>xmlSecEncCtxCreate ()</title>
<indexterm zone="xmlSecEncCtxCreate"><primary sortas="xmlSecEncCtxCreate">xmlSecEncCtxCreate</primary></indexterm><programlisting><link linkend="xmlSecEncCtxPtr">xmlSecEncCtxPtr</link>     xmlSecEncCtxCreate                  (<link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> keysMngr);</programlisting>
<para>
Creates <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> element processing context.
The caller is responsible for destroying returned object by calling
<link linkend="xmlSecEncCtxDestroy"><type>xmlSecEncCtxDestroy</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>keysMngr</parameter>&#160;:</term>
<listitem><simpara>           the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to newly allocated context object or NULL if an error
occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxDestroy" role="function">
<title>xmlSecEncCtxDestroy ()</title>
<indexterm zone="xmlSecEncCtxDestroy"><primary sortas="xmlSecEncCtxDestroy">xmlSecEncCtxDestroy</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecEncCtxDestroy                 (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx);</programlisting>
<para>
Destroy context object created with <link linkend="xmlSecEncCtxCreate"><type>xmlSecEncCtxCreate</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxInitialize" role="function">
<title>xmlSecEncCtxInitialize ()</title>
<indexterm zone="xmlSecEncCtxInitialize"><primary sortas="xmlSecEncCtxInitialize">xmlSecEncCtxInitialize</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecEncCtxInitialize              (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlSecKeysMngr">xmlSecKeysMngrPtr</link> keysMngr);</programlisting>
<para>
Initializes <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> element processing context.
The caller is responsible for cleaning up returned object by calling
<link linkend="xmlSecEncCtxFinalize"><type>xmlSecEncCtxFinalize</type></link> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>keysMngr</parameter>&#160;:</term>
<listitem><simpara>           the pointer to keys manager.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxFinalize" role="function">
<title>xmlSecEncCtxFinalize ()</title>
<indexterm zone="xmlSecEncCtxFinalize"><primary sortas="xmlSecEncCtxFinalize">xmlSecEncCtxFinalize</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecEncCtxFinalize                (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx);</programlisting>
<para>
Cleans up <parameter>encCtx</parameter> object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxCopyUserPref" role="function">
<title>xmlSecEncCtxCopyUserPref ()</title>
<indexterm zone="xmlSecEncCtxCopyUserPref"><primary sortas="xmlSecEncCtxCopyUserPref">xmlSecEncCtxCopyUserPref</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecEncCtxCopyUserPref            (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> dst,
                                                         <link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> src);</programlisting>
<para>
Copies user preference from <parameter>src</parameter> context to <parameter>dst</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>dst</parameter>&#160;:</term>
<listitem><simpara>                the pointer to destination context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>src</parameter>&#160;:</term>
<listitem><simpara>                the pointer to source context.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxReset" role="function">
<title>xmlSecEncCtxReset ()</title>
<indexterm zone="xmlSecEncCtxReset"><primary sortas="xmlSecEncCtxReset">xmlSecEncCtxReset</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecEncCtxReset                   (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx);</programlisting>
<para>
Resets <parameter>encCtx</parameter> object, user settings are not touched.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxBinaryEncrypt" role="function">
<title>xmlSecEncCtxBinaryEncrypt ()</title>
<indexterm zone="xmlSecEncCtxBinaryEncrypt"><primary sortas="xmlSecEncCtxBinaryEncrypt">xmlSecEncCtxBinaryEncrypt</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecEncCtxBinaryEncrypt           (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> tmpl,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize);</programlisting>
<para>
Encrypts <parameter>data</parameter> according to template <parameter>tmpl</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tmpl</parameter>&#160;:</term>
<listitem><simpara>               the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> template node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>               the pointer for binary buffer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>           the <parameter>data</parameter> buffer size.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxXmlEncrypt" role="function">
<title>xmlSecEncCtxXmlEncrypt ()</title>
<indexterm zone="xmlSecEncCtxXmlEncrypt"><primary sortas="xmlSecEncCtxXmlEncrypt">xmlSecEncCtxXmlEncrypt</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecEncCtxXmlEncrypt              (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> tmpl,
                                                         <link linkend="xmlNode">xmlNodePtr</link> node);</programlisting>
<para>
Encrypts <parameter>node</parameter> according to template <parameter>tmpl</parameter>. If requested, <parameter>node</parameter> is replaced
with result <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> node.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tmpl</parameter>&#160;:</term>
<listitem><simpara>               the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> template node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>node</parameter>&#160;:</term>
<listitem><simpara>               the pointer to node for encryption.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxUriEncrypt" role="function">
<title>xmlSecEncCtxUriEncrypt ()</title>
<indexterm zone="xmlSecEncCtxUriEncrypt"><primary sortas="xmlSecEncCtxUriEncrypt">xmlSecEncCtxUriEncrypt</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecEncCtxUriEncrypt              (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> tmpl,
                                                         const <link linkend="xmlChar">xmlChar</link> *uri);</programlisting>
<para>
Encrypts data from <parameter>uri</parameter> according to template <parameter>tmpl</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tmpl</parameter>&#160;:</term>
<listitem><simpara>               the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> template node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara>                the URI.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxDecrypt" role="function">
<title>xmlSecEncCtxDecrypt ()</title>
<indexterm zone="xmlSecEncCtxDecrypt"><primary sortas="xmlSecEncCtxDecrypt">xmlSecEncCtxDecrypt</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecEncCtxDecrypt                 (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> node);</programlisting>
<para>
Decrypts <parameter>node</parameter> and if necessary replaces <parameter>node</parameter> with decrypted data.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>node</parameter>&#160;:</term>
<listitem><simpara>               the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> node.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxDecryptToBuffer" role="function">
<title>xmlSecEncCtxDecryptToBuffer ()</title>
<indexterm zone="xmlSecEncCtxDecryptToBuffer"><primary sortas="xmlSecEncCtxDecryptToBuffer">xmlSecEncCtxDecryptToBuffer</primary></indexterm><programlisting><link linkend="xmlSecBufferPtr">xmlSecBufferPtr</link>     xmlSecEncCtxDecryptToBuffer         (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="xmlNode">xmlNodePtr</link> node);</programlisting>
<para>
Decrypts <parameter>node</parameter> data to the <parameter>encCtx</parameter> buffer.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>node</parameter>&#160;:</term>
<listitem><simpara>               the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> node.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxDebugDump" role="function">
<title>xmlSecEncCtxDebugDump ()</title>
<indexterm zone="xmlSecEncCtxDebugDump"><primary sortas="xmlSecEncCtxDebugDump">xmlSecEncCtxDebugDump</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecEncCtxDebugDump               (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="FILE--CAPS">FILE</link> *output);</programlisting>
<para>
Prints the debug information about <parameter>encCtx</parameter> to <parameter>output</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>output</parameter>&#160;:</term>
<listitem><simpara>             the pointer to output FILE.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecEncCtxDebugXmlDump" role="function">
<title>xmlSecEncCtxDebugXmlDump ()</title>
<indexterm zone="xmlSecEncCtxDebugXmlDump"><primary sortas="xmlSecEncCtxDebugXmlDump">xmlSecEncCtxDebugXmlDump</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecEncCtxDebugXmlDump            (<link linkend="xmlSecEncCtx">xmlSecEncCtxPtr</link> encCtx,
                                                         <link linkend="FILE--CAPS">FILE</link> *output);</programlisting>
<para>
Prints the debug information about <parameter>encCtx</parameter> to <parameter>output</parameter> in XML format.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>encCtx</parameter>&#160;:</term>
<listitem><simpara>             the pointer to <ulink URL="http://www.w3.org/TR/xmlenc-core/#sec-EncryptedData">&lt;enc:EncryptedData/&gt;</ulink> processing context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>output</parameter>&#160;:</term>
<listitem><simpara>             the pointer to output FILE.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
