<refentry id="camel-CamelMultipartSigned">
<refmeta>
<refentrytitle role="top_of_page" id="camel-CamelMultipartSigned.top_of_page">CamelMultipartSigned</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAMEL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>CamelMultipartSigned</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="camel-CamelMultipartSigned.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
                    <link linkend="CamelMultipartSigned">CamelMultipartSigned</link>;
<link linkend="CamelMultipartSigned">CamelMultipartSigned</link>* <link linkend="camel-multipart-signed-new">camel_multipart_signed_new</link>        (void);
<link linkend="CamelStream">CamelStream</link>*        <link linkend="camel-multipart-signed-get-content-stream">camel_multipart_signed_get_content_stream</link>
                                                        (<link linkend="CamelMultipartSigned">CamelMultipartSigned</link> *mps,
                                                         <link linkend="CamelException">CamelException</link> *ex);
</synopsis>
</refsynopsisdiv>









<refsect1 id="camel-CamelMultipartSigned.description" role="desc">
<title role="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 id="camel-CamelMultipartSigned.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelMultipartSigned" role="struct">
<title>CamelMultipartSigned</title>
<indexterm zone="CamelMultipartSigned"><primary>CamelMultipartSigned</primary></indexterm><programlisting>typedef struct {
	CamelMultipart parent_object;

	/* these are the client visible parts, decoded forms of our data wrapper content */
	CamelMimePart *content;
	CamelMimePart *signature;

	/* the raw content which must go over the wire, if we have generated it */
	/* perhaps this should jsut set data_wrapper-&gt;stream and update start1/end1 accordingly, as it is done
	   for other parts, or visa versa? */
	CamelStream *contentraw;

	/*int state;*/

	/* just cache some info we use */
	char *protocol;
	char *micalg;

	/* offset pointers of start of boundary in content object */
	off_t start1, end1;
	off_t start2, end2;
} CamelMultipartSigned;
</programlisting>
<para>

</para></refsect2>
<refsect2 id="camel-multipart-signed-new" role="function">
<title>camel_multipart_signed_new ()</title>
<indexterm zone="camel-multipart-signed-new"><primary>camel_multipart_signed_new</primary></indexterm><programlisting><link linkend="CamelMultipartSigned">CamelMultipartSigned</link>* camel_multipart_signed_new        (void);</programlisting>
<para>
Create a new <link linkend="CamelMultipartSigned"><type>CamelMultipartSigned</type></link> object.
</para>
<para>
A MultipartSigned should be used to store and create parts of
type "multipart/signed".  This is because multipart/signed is
entirely broken-by-design (tm) and uses completely
different semantics to other mutlipart types.  It must be treated
as opaque data by any transport.  See rfc 3156 for details.
</para>
<para>
There are 3 ways to create the part:
Use construct_from_stream.  If this is used, then you must
set the mime_type appropriately to match the data uses, so
that the multiple parts my be extracted.
</para>
<para>
Use construct_from_parser.  The parser MUST be in the <link linkend="CAMEL-MIME-PARSER-STATE-HEADER:CAPS"><type>CAMEL_MIME_PARSER_STATE_HEADER</type></link>
state, and the current content_type MUST be "multipart/signed" with
the appropriate boundary and it SHOULD include the appropriate protocol
and hash specifiers.
</para>
<para>
Use sign_part.  A signature part will automatically be created
and the whole part may be written using write_to_stream to
create a 'transport-safe' version (as safe as can be expected with
such a broken specification).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a new <link linkend="CamelMultipartSigned"><type>CamelMultipartSigned</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-multipart-signed-get-content-stream" role="function">
<title>camel_multipart_signed_get_content_stream ()</title>
<indexterm zone="camel-multipart-signed-get-content-stream"><primary>camel_multipart_signed_get_content_stream</primary></indexterm><programlisting><link linkend="CamelStream">CamelStream</link>*        camel_multipart_signed_get_content_stream
                                                        (<link linkend="CamelMultipartSigned">CamelMultipartSigned</link> *mps,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
Get the raw signed content stream of the multipart/signed MIME part
suitable for use with verification of the signature.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>mps</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamlMultipartSigned"><type>CamlMultipartSigned</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the signed content stream
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
