\section{KDESasl Class Reference}
\label{classKDESasl}\index{KDESasl@{KDESasl}}
This library can create responses for SASL authentication for a given challenge and a given secret.  


{\tt \#include $<$kdesasl.h$>$}

Collaboration diagram for KDESasl:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=109pt]{classKDESasl__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KDESasl} (const  {\bf KURL} \&a\-Url)
\begin{CompactList}\small\item\em Construct a sasl object and initialize it with the username and password passed via the url. \item\end{CompactList}\item 
{\bf KDESasl} (const  {\bf QString} \&a\-User, const  {\bf QString} \&a\-Pass, const  {\bf QString} \&a\-Protocol)
\begin{CompactList}\small\item\em This is a conveniece funtion and differs from the above function only by what arguments it accepts. \item\end{CompactList}\item 
virtual {\bf QCString} {\bf choose\-Method} (const  {\bf QStr\-IList} a\-Methods)
\item 
virtual void {\bf set\-Method} (const  {\bf QCString} \&a\-Method)
\begin{CompactList}\small\item\em Explicitely set the SASL method used. \item\end{CompactList}\item 
{\bf QCString} {\bf get\-Response} (const  {\bf QByte\-Array} \&a\-Challenge, bool a\-Base64=TRUE)
\begin{CompactList}\small\item\em Creates a response using the formerly chosen SASL method. \item\end{CompactList}\item 
{\bf QByte\-Array} {\bf get\-Binary\-Response} (const  {\bf QByte\-Array} \&a\-Challenge, bool a\-Base64)
\begin{CompactList}\small\item\em Create a response as above but place it in a {\bf QByte\-Array}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf QByte\-Array} {\bf get\-Plain\-Response} ()
\begin{CompactList}\small\item\em PLAIN authentication as described in RFC 2595. \item\end{CompactList}\item 
virtual {\bf QByte\-Array} {\bf get\-Login\-Response} ()
\begin{CompactList}\small\item\em LOGIN authentication. \item\end{CompactList}\item 
virtual {\bf QByte\-Array} {\bf get\-Cram\-Md5Response} (const  {\bf QByte\-Array} \&a\-Challenge)
\begin{CompactList}\small\item\em CRAM-MD5 authentication as described in RFC 2195. \item\end{CompactList}\item 
virtual {\bf QByte\-Array} {\bf get\-Digest\-Md5Response} (const  {\bf QByte\-Array} \&a\-Challenge)
\begin{CompactList}\small\item\em DIGEST-MD5 authentication as described in RFC 2831. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This library can create responses for SASL authentication for a given challenge and a given secret. 

This way of authentication is common for SMTP, POP3, IMAP and LDAP.

SASL is one way strong encryption and therefore useful for authentication, but not for secret information transfer. It is possibly to prove with SASL to know a shared secret like a password. It is not possible with SASL to transfer any other information in an encrypted way. For that purpose Open\-PGP or SSL are useful.

Currently PLAIN (RFC 2595), LOGIN, CRAM-MD5 (RFC 2195) and DIGEST-MD5 (RFC 2831) authentication are supported. PLAIN and LOGIN do only use encoding and not encryption.

\begin{Desc}
\item[Author:]Michael H\"{a}ckel $<${\tt haeckel@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kdesasl.h}{\rm (p.\,\pageref{kdesasl_8h})},v 1.7 2002/01/18 08:09:38 haeckel Exp \end{Desc}
\end{Desc}




Definition at line 47 of file kdesasl.h.

\subsection{Constructor \& Destructor Documentation}
\index{KDESasl@{KDESasl}!KDESasl@{KDESasl}}
\index{KDESasl@{KDESasl}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDESasl::KDESasl (const {\bf KURL} \& {\em a\-Url})}\label{classKDESasl_a0}


Construct a sasl object and initialize it with the username and password passed via the url. 



Definition at line 26 of file kdesasl.cpp.

References KURL::pass(), KURL::protocol(), and KURL::user().\index{KDESasl@{KDESasl}!KDESasl@{KDESasl}}
\index{KDESasl@{KDESasl}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDESasl::KDESasl (const {\bf QString} \& {\em a\-User}, const {\bf QString} \& {\em a\-Pass}, const {\bf QString} \& {\em a\-Protocol})}\label{classKDESasl_a1}


This is a conveniece funtion and differs from the above function only by what arguments it accepts. 



Definition at line 34 of file kdesasl.cpp.

\subsection{Member Function Documentation}
\index{KDESasl@{KDESasl}!chooseMethod@{chooseMethod}}
\index{chooseMethod@{chooseMethod}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} KDESasl::choose\-Method (const {\bf QStr\-IList} {\em a\-Methods})\hspace{0.3cm}{\tt  [virtual]}}\label{classKDESasl_a3}


\begin{Desc}
\item[Returns:]the most secure method from the given methods and use it for further operations. \end{Desc}


Definition at line 46 of file kdesasl.cpp.\index{KDESasl@{KDESasl}!setMethod@{setMethod}}
\index{setMethod@{setMethod}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDESasl::set\-Method (const {\bf QCString} \& {\em a\-Method})\hspace{0.3cm}{\tt  [virtual]}}\label{classKDESasl_a4}


Explicitely set the SASL method used. 



Definition at line 56 of file kdesasl.cpp.\index{KDESasl@{KDESasl}!getResponse@{getResponse}}
\index{getResponse@{getResponse}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QCString} KDESasl::get\-Response (const {\bf QByte\-Array} \& {\em a\-Challenge}, bool {\em a\-Base64} = TRUE)}\label{classKDESasl_a5}


Creates a response using the formerly chosen SASL method. 

For LOGIN authentication you have to call this function twice. KDESasl realizes on its own, if you are calling it for the first or for the second time. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em a\-Challenge}]is the challenge sent to create a response for \item[{\em a\-Base64}]specifies, whether the authentication protocol uses base64 encoding. The challenge is decoded from base64 and the response is encoded base64 if set to TRUE. \end{description}
\end{Desc}


Definition at line 251 of file kdesasl.cpp.

References get\-Binary\-Response().\index{KDESasl@{KDESasl}!getBinaryResponse@{getBinaryResponse}}
\index{getBinaryResponse@{getBinaryResponse}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QByte\-Array} KDESasl::get\-Binary\-Response (const {\bf QByte\-Array} \& {\em a\-Challenge}, bool {\em a\-Base64})}\label{classKDESasl_a6}


Create a response as above but place it in a {\bf QByte\-Array}. 



Definition at line 232 of file kdesasl.cpp.

References KCodecs::base64Decode(), KCodecs::base64Encode(), get\-Cram\-Md5Response(), get\-Digest\-Md5Response(), get\-Login\-Response(), and get\-Plain\-Response().

Referenced by get\-Response().\index{KDESasl@{KDESasl}!getPlainResponse@{getPlainResponse}}
\index{getPlainResponse@{getPlainResponse}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QByte\-Array} KDESasl::get\-Plain\-Response ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDESasl_b0}


PLAIN authentication as described in RFC 2595. 



Definition at line 61 of file kdesasl.cpp.

References QCString::length(), and QString::utf8().

Referenced by get\-Binary\-Response().\index{KDESasl@{KDESasl}!getLoginResponse@{getLoginResponse}}
\index{getLoginResponse@{getLoginResponse}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QByte\-Array} KDESasl::get\-Login\-Response ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDESasl_b1}


LOGIN authentication. 



Definition at line 73 of file kdesasl.cpp.

References QString::utf8().

Referenced by get\-Binary\-Response().\index{KDESasl@{KDESasl}!getCramMd5Response@{getCramMd5Response}}
\index{getCramMd5Response@{getCramMd5Response}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QByte\-Array} KDESasl::get\-Cram\-Md5Response (const {\bf QByte\-Array} \& {\em a\-Challenge})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDESasl_b2}


CRAM-MD5 authentication as described in RFC 2195. 



Definition at line 81 of file kdesasl.cpp.

References KMD5::hex\-Digest(), KMD5::raw\-Digest(), KMD5::update(), and QString::utf8().

Referenced by get\-Binary\-Response().\index{KDESasl@{KDESasl}!getDigestMd5Response@{getDigestMd5Response}}
\index{getDigestMd5Response@{getDigestMd5Response}!KDESasl@{KDESasl}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QByte\-Array} KDESasl::get\-Digest\-Md5Response (const {\bf QByte\-Array} \& {\em a\-Challenge})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKDESasl_b3}


DIGEST-MD5 authentication as described in RFC 2831. 



Definition at line 114 of file kdesasl.cpp.

References KCodecs::base64Encode(), KMD5::hex\-Digest(), QCString::is\-Empty(), QString::latin1(), QCString::length(), KMD5::raw\-Digest(), KMD5::reset(), QCString::set\-Num(), KMD5::update(), and QString::utf8().

Referenced by get\-Binary\-Response().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kdesasl.h\item 
kdesasl.cpp\end{CompactItemize}
