00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #if P_SASL2
00032 #ifndef _PSASL
00033 #define _PSASL
00034
00035 #ifdef P_USE_PRAGMA
00036 #pragma interface
00037 #endif
00038
00039 #include <ptlib.h>
00040
00041 class PSASLClient : public PObject
00042 {
00043 PCLASSINFO(PSASLClient, PObject);
00044
00045 public:
00046 enum PSASLResult {
00047 Continue = 1,
00048 OK = 0,
00049 Fail = -1
00050 };
00051
00052 protected:
00053 static PString s_Realm;
00054 static PString s_Path;
00055
00056 void * m_CallBacks;
00057 void * m_ConnState;
00058 const PString m_Service;
00059 const PString m_UserID;
00060 const PString m_AuthID;
00061 const PString m_Password;
00062
00063 PBoolean Start(const PString& mechanism, const char ** output, unsigned& len);
00064 PSASLResult Negotiate(const char * input, const char ** output);
00065
00066 public:
00067 PSASLClient(const PString& service, const PString& uid, const PString& auth, const PString& pwd);
00068 ~PSASLClient();
00069
00070 static void SetRealm(const PString& realm) { s_Realm = realm; }
00071 static void SetPath(const PString& path) { s_Path = path; }
00072
00073 static const PString& GetRealm() { return s_Realm; }
00074 static const PString& GetPath() { return s_Path; }
00075
00076 const PString& GetService() const { return m_Service; }
00077 const PString& GetUserID() const { return m_UserID; }
00078 const PString& GetAuthID() const { return m_AuthID; }
00079 const PString& GetPassword() const { return m_Password; }
00080
00081 PBoolean Init(const PString& fqdn, PStringSet& supportedMechanisms);
00082 PBoolean Start(const PString& mechanism, PString& output);
00083 PSASLResult Negotiate(const PString& input, PString& output);
00084 PBoolean End();
00085 };
00086
00087 #endif // _PSASL
00088 #endif // P_SASL2
00089
00090