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
00032
00033
00034
00035
00036
00037
00038
00039
00040 #if P_SASL2
00041 #ifndef _PSASL
00042 #define _PSASL
00043
00044 #ifdef P_USE_PRAGMA
00045 #pragma interface
00046 #endif
00047
00048 #include <ptlib.h>
00049
00050 class PSASLClient : public PObject
00051 {
00052 PCLASSINFO(PSASLClient, PObject);
00053
00054 public:
00055 enum PSASLResult {
00056 Continue = 1,
00057 OK = 0,
00058 Fail = -1
00059 };
00060
00061 protected:
00062 static PString s_Realm;
00063 static PString s_Path;
00064
00065 void * m_CallBacks;
00066 void * m_ConnState;
00067 const PString m_Service;
00068 const PString m_UserID;
00069 const PString m_AuthID;
00070 const PString m_Password;
00071
00072 BOOL Start(const PString& mechanism, const char ** output, unsigned& len);
00073 PSASLResult Negotiate(const char * input, const char ** output);
00074
00075 public:
00076 PSASLClient(const PString& service, const PString& uid, const PString& auth, const PString& pwd);
00077 ~PSASLClient();
00078
00079 static void SetRealm(const PString& realm) { s_Realm = realm; }
00080 static void SetPath(const PString& path) { s_Path = path; }
00081
00082 static const PString& GetRealm() { return s_Realm; }
00083 static const PString& GetPath() { return s_Path; }
00084
00085 const PString& GetService() const { return m_Service; }
00086 const PString& GetUserID() const { return m_UserID; }
00087 const PString& GetAuthID() const { return m_AuthID; }
00088 const PString& GetPassword() const { return m_Password; }
00089
00090 BOOL Init(const PString& fqdn, PStringSet& supportedMechanisms);
00091 BOOL Start(const PString& mechanism, PString& output);
00092 PSASLResult Negotiate(const PString& input, PString& output);
00093 BOOL End();
00094 };
00095
00096 #endif // _PSASL
00097 #endif // P_SASL2
00098
00099