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