<refentry id="GMimeMultipartSigned">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeMultipartSigned.top_of_page">GMimeMultipartSigned</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeMultipartSigned</refname>
<refpurpose>Signed MIME multiparts</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMimeMultipartSigned.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>                    <link linkend="GMimeMultipartSigned-struct">GMimeMultipartSigned</link>;
<link linkend="GMimeMultipartSigned"><returnvalue>GMimeMultipartSigned</returnvalue></link> * <link linkend="g-mime-multipart-signed-new">g_mime_multipart_signed_new</link>      (<parameter><type>void</type></parameter>);
<link linkend="int"><returnvalue>int</returnvalue></link>                 <link linkend="g-mime-multipart-signed-sign">g_mime_multipart_signed_sign</link>        (<parameter><link linkend="GMimeMultipartSigned"><type>GMimeMultipartSigned</type></link> *mps</parameter>,
                                                         <parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *content</parameter>,
                                                         <parameter><link linkend="GMimeCryptoContext"><type>GMimeCryptoContext</type></link> *ctx</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *userid</parameter>,
                                                         <parameter><link linkend="GMimeDigestAlgo"><type>GMimeDigestAlgo</type></link> digest</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **err</parameter>);
<link linkend="GMimeSignatureList"><returnvalue>GMimeSignatureList</returnvalue></link> * <link linkend="g-mime-multipart-signed-verify">g_mime_multipart_signed_verify</link>     (<parameter><link linkend="GMimeMultipartSigned"><type>GMimeMultipartSigned</type></link> *mps</parameter>,
                                                         <parameter><link linkend="GMimeCryptoContext"><type>GMimeCryptoContext</type></link> *ctx</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **err</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeMultipartSigned.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GMimeObject">GMimeObject</link>
         +----<link linkend="GMimeMultipart">GMimeMultipart</link>
               +----GMimeMultipartSigned
</synopsis>
</refsect1>

<refsect1 id="GMimeMultipartSigned.description" role="desc">
<title role="desc.title">Description</title>
<para>
A <link linkend="GMimeMultipartSigned"><type>GMimeMultipartSigned</type></link> part is a special subclass of
<link linkend="GMimeMultipart"><type>GMimeMultipart</type></link> to make it easier to manipulate the
multipart/signed MIME type.
</para>
</refsect1>
<refsect1 id="GMimeMultipartSigned.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeMultipartSigned-struct" role="struct">
<title>GMimeMultipartSigned</title>
<indexterm zone="GMimeMultipartSigned-struct"><primary>GMimeMultipartSigned</primary></indexterm>
<programlisting>typedef struct _GMimeMultipartSigned GMimeMultipartSigned;</programlisting>
<para>
A multipart/signed MIME part.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="g-mime-multipart-signed-new" role="function">
<title>g_mime_multipart_signed_new ()</title>
<indexterm zone="g-mime-multipart-signed-new"><primary>g_mime_multipart_signed_new</primary></indexterm>
<programlisting><link linkend="GMimeMultipartSigned"><returnvalue>GMimeMultipartSigned</returnvalue></link> * g_mime_multipart_signed_new      (<parameter><type>void</type></parameter>);</programlisting>
<para>
Creates a new MIME multipart/signed object.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an empty MIME multipart/signed object.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-multipart-signed-sign" role="function">
<title>g_mime_multipart_signed_sign ()</title>
<indexterm zone="g-mime-multipart-signed-sign"><primary>g_mime_multipart_signed_sign</primary></indexterm>
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link>                 g_mime_multipart_signed_sign        (<parameter><link linkend="GMimeMultipartSigned"><type>GMimeMultipartSigned</type></link> *mps</parameter>,
                                                         <parameter><link linkend="GMimeObject"><type>GMimeObject</type></link> *content</parameter>,
                                                         <parameter><link linkend="GMimeCryptoContext"><type>GMimeCryptoContext</type></link> *ctx</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *userid</parameter>,
                                                         <parameter><link linkend="GMimeDigestAlgo"><type>GMimeDigestAlgo</type></link> digest</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **err</parameter>);</programlisting>
<para>
Attempts to sign the <parameter>content</parameter> MIME part with <parameter>userid</parameter>'s private key
using the <parameter>ctx</parameter> signing context with the <parameter>digest</parameter> algorithm. If
successful, the signed <link linkend="GMimeObject"><type>GMimeObject</type></link> is set as the signed part of
the multipart/signed object <parameter>mps</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>mps</parameter>&#160;:</term>
<listitem><simpara>multipart/signed object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content</parameter>&#160;:</term>
<listitem><simpara>MIME part to sign
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ctx</parameter>&#160;:</term>
<listitem><simpara>encryption crypto context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>userid</parameter>&#160;:</term>
<listitem><simpara>user id to sign with
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>digest</parameter>&#160;:</term>
<listitem><simpara>preferred digest algorithm
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>err</parameter>&#160;:</term>
<listitem><simpara>exception
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="0:CAPS"><literal>0</literal></link> on success or <link linkend="1:CAPS"><literal>-1</literal></link> on fail. If the signing fails, an
exception will be set on <parameter>err</parameter> to provide information as to why the
failure occured.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-multipart-signed-verify" role="function">
<title>g_mime_multipart_signed_verify ()</title>
<indexterm zone="g-mime-multipart-signed-verify"><primary>g_mime_multipart_signed_verify</primary></indexterm>
<programlisting><link linkend="GMimeSignatureList"><returnvalue>GMimeSignatureList</returnvalue></link> * g_mime_multipart_signed_verify     (<parameter><link linkend="GMimeMultipartSigned"><type>GMimeMultipartSigned</type></link> *mps</parameter>,
                                                         <parameter><link linkend="GMimeCryptoContext"><type>GMimeCryptoContext</type></link> *ctx</parameter>,
                                                         <parameter><link linkend="GError"><type>GError</type></link> **err</parameter>);</programlisting>
<para>
Attempts to verify the signed MIME part contained within the
multipart/signed object <parameter>mps</parameter> using the <parameter>ctx</parameter> crypto context.
</para><variablelist role="params">
<varlistentry><term><parameter>mps</parameter>&#160;:</term>
<listitem><simpara>multipart/signed object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ctx</parameter>&#160;:</term>
<listitem><simpara>encryption crypto context
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>err</parameter>&#160;:</term>
<listitem><simpara>exception
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GMimeSignatureList"><type>GMimeSignatureList</type></link> object on success or <link linkend="NULL:CAPS"><literal>NULL</literal></link> on fail. If
the verification fails, an exception will be set on <parameter>err</parameter> to provide
information as to why the failure occured.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GMimeMultipartSigned.see-also">
<title>See Also</title>
<link linkend="GMimeMultipart"><type>GMimeMultipart</type></link>
</refsect1>

</refentry>
