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

<refnamediv>
<refname>CamelSasl</refname>
<refpurpose></refpurpose>
</refnamediv>

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

<synopsis>
                    <link linkend="CamelSasl">CamelSasl</link>;
<link linkend="GByteArray">GByteArray</link> *        <link linkend="camel-sasl-challenge">camel_sasl_challenge</link>                (<link linkend="CamelSasl">CamelSasl</link> *sasl,
                                                         <link linkend="GByteArray">GByteArray</link> *token,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="char">char</link> *              <link linkend="camel-sasl-challenge-base64">camel_sasl_challenge_base64</link>         (<link linkend="CamelSasl">CamelSasl</link> *sasl,
                                                         const <link linkend="char">char</link> *token,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-sasl-authenticated">camel_sasl_authenticated</link>            (<link linkend="CamelSasl">CamelSasl</link> *sasl);
<link linkend="CamelSasl">CamelSasl</link> *         <link linkend="camel-sasl-new">camel_sasl_new</link>                      (const <link linkend="char">char</link> *service_name,
                                                         const <link linkend="char">char</link> *mechanism,
                                                         <link linkend="CamelService">CamelService</link> *service);
<link linkend="GList">GList</link> *             <link linkend="camel-sasl-authtype-list">camel_sasl_authtype_list</link>            (<link linkend="gboolean">gboolean</link> include_plain);
<link linkend="CamelServiceAuthType">CamelServiceAuthType</link> * <link linkend="camel-sasl-authtype">camel_sasl_authtype</link>              (const <link linkend="char">char</link> *mechanism);
</synopsis>
</refsynopsisdiv>









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

<refsect1 id="camel-CamelSasl.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelSasl" role="struct">
<title>CamelSasl</title>
<indexterm zone="CamelSasl"><primary sortas="CamelSasl">CamelSasl</primary></indexterm><programlisting>typedef struct {
	CamelObject parent_object;
	
	char *service_name;
	char *mech;		/* mechanism */
	CamelService *service;
	gboolean authenticated;
} CamelSasl;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="camel-sasl-challenge" role="function">
<title>camel_sasl_challenge ()</title>
<indexterm zone="camel-sasl-challenge"><primary sortas="camel_sasl_challenge">camel_sasl_challenge</primary></indexterm><programlisting><link linkend="GByteArray">GByteArray</link> *        camel_sasl_challenge                (<link linkend="CamelSasl">CamelSasl</link> *sasl,
                                                         <link linkend="GByteArray">GByteArray</link> *token,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
If <parameter>token</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, generate the initial SASL message to send to
the server. (This will be <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the client doesn't initiate the
exchange.) Otherwise, <parameter>token</parameter> is a challenge from the server, and
the return value is the response.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sasl</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelSasl"><type>CamelSasl</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>token</parameter>&#160;:</term>
<listitem><simpara> a token, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the SASL response or <link linkend="NULL--CAPS"><literal>NULL</literal></link>. If an error occurred, <parameter>ex</parameter> will
also be set.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-sasl-challenge-base64" role="function">
<title>camel_sasl_challenge_base64 ()</title>
<indexterm zone="camel-sasl-challenge-base64"><primary sortas="camel_sasl_challenge_base64">camel_sasl_challenge_base64</primary></indexterm><programlisting><link linkend="char">char</link> *              camel_sasl_challenge_base64         (<link linkend="CamelSasl">CamelSasl</link> *sasl,
                                                         const <link linkend="char">char</link> *token,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
As with <link linkend="camel-sasl-challenge"><type>camel_sasl_challenge</type></link>, but the challenge <parameter>token</parameter> and the
response are both base64-encoded.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sasl</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelSasl"><type>CamelSasl</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>token</parameter>&#160;:</term>
<listitem><simpara> a base64-encoded token
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the base64 encoded challenge string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-sasl-authenticated" role="function">
<title>camel_sasl_authenticated ()</title>
<indexterm zone="camel-sasl-authenticated"><primary sortas="camel_sasl_authenticated">camel_sasl_authenticated</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_sasl_authenticated            (<link linkend="CamelSasl">CamelSasl</link> *sasl);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>sasl</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="CamelSasl"><type>CamelSasl</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether or not <parameter>sasl</parameter> has successfully authenticated the
user. This will be <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> after it returns the last needed response.
The caller must still pass that information on to the server and
verify that it has accepted it.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-sasl-new" role="function">
<title>camel_sasl_new ()</title>
<indexterm zone="camel-sasl-new"><primary sortas="camel_sasl_new">camel_sasl_new</primary></indexterm><programlisting><link linkend="CamelSasl">CamelSasl</link> *         camel_sasl_new                      (const <link linkend="char">char</link> *service_name,
                                                         const <link linkend="char">char</link> *mechanism,
                                                         <link linkend="CamelService">CamelService</link> *service);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>service_name</parameter>&#160;:</term>
<listitem><simpara> the SASL service name
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mechanism</parameter>&#160;:</term>
<listitem><simpara> the SASL mechanism
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>service</parameter>&#160;:</term>
<listitem><simpara> the CamelService that will be using this SASL
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="CamelSasl"><type>CamelSasl</type></link> object for the given <parameter>service_name</parameter>,
<parameter>mechanism</parameter>, and <parameter>service</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the mechanism is not
supported.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-sasl-authtype-list" role="function">
<title>camel_sasl_authtype_list ()</title>
<indexterm zone="camel-sasl-authtype-list"><primary sortas="camel_sasl_authtype_list">camel_sasl_authtype_list</primary></indexterm><programlisting><link linkend="GList">GList</link> *             camel_sasl_authtype_list            (<link linkend="gboolean">gboolean</link> include_plain);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>include_plain</parameter>&#160;:</term>
<listitem><simpara> whether or not to include the PLAIN mechanism
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GList"><type>GList</type></link> of SASL-supported authtypes. The caller must
free the list, but not the contents.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-sasl-authtype" role="function">
<title>camel_sasl_authtype ()</title>
<indexterm zone="camel-sasl-authtype"><primary sortas="camel_sasl_authtype">camel_sasl_authtype</primary></indexterm><programlisting><link linkend="CamelServiceAuthType">CamelServiceAuthType</link> * camel_sasl_authtype              (const <link linkend="char">char</link> *mechanism);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>mechanism</parameter>&#160;:</term>
<listitem><simpara> the SASL mechanism to get an authtype for
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="CamelServiceAuthType"><type>CamelServiceAuthType</type></link> for the given mechanism, if
it is supported.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
