- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gsaslclient.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
20
21 #ifndef G_SASL_CLIENT_H
22 #define G_SASL_CLIENT_H
23
24 #include "gdef.h"
25 #include "gauth.h"
26 #include "gvalid.h"
27 #include "gexception.h"
28 #include "gaddress.h"
29 #include "gstrings.h"
30 #include "gpath.h"
31 #include <map>
32 #include <memory>
33
35 namespace GAuth
36 {
37 class SaslClient ;
38 class SaslClientImp ;
39 }
40
48 class GAuth::SaslClient
49 {
50 public:
52 class Secrets : public virtual Valid
53 {
54 public: virtual std::string id( const std::string & mechanism ) const = 0 ;
55 public: virtual std::string secret( const std::string & id ) const = 0 ;
56 public: virtual ~Secrets() ;
57 private: void operator=( const Secrets & ) ; // not implemented
58 } ;
59
60 SaslClient( const Secrets & secrets , const std::string & server_name ) ;
62
63 ~SaslClient() ;
65
66 bool active() const ;
69
70 std::string initial_response( const std::string & mechanism ,
71 bool & done , bool & error , bool & sensitive ) const ;
74
75 std::string response( const std::string & mechanism , const std::string & challenge ,
76 bool & done , bool & error , bool & sensitive ) const ;
79
80 std::string preferred( const G::Strings & mechanisms ) const ;
84
85 private:
86 SaslClient( const SaslClient & ) ; // not implemented
87 void operator=( const SaslClient & ) ; // not implemented
88
89 private:
90 SaslClientImp * m_imp ;
91 } ;
92
93 #endif
GAuth::SaslClient::preferred
std::string preferred(const G::Strings &mechanisms) const
Returns the name of the preferred mechanism taken from the given set.
Definition: gsaslclient_native.cpp:194
gstrings.h
GAuth::SaslClient::response
std::string response(const std::string &mechanism, const std::string &challenge, bool &done, bool &error, bool &sensitive) const
Returns a response to the given challenge.
Definition: gsaslclient_native.cpp:131
GAuth::SaslClient::Secrets::secret
virtual std::string secret(const std::string &id) const =0
G::Strings
std::list< std::string > Strings
A std::list of std::strings.
Definition: gstrings.h:39
GAuth::SaslClient::SaslClient
SaslClient(const Secrets &secrets, const std::string &server_name)
Constructor. The secrets reference is kept.
Definition: gsaslclient_native.cpp:87
GAuth::SaslClient::active
bool active() const
Returns true if the constructor's secrets object is valid.
Definition: gsaslclient_native.cpp:99
GAuth::SaslClientImp
A private pimple-pattern implementation class used by GAuth::SaslClient.
Definition: gsaslclient_native.cpp:40
gauth.h
GAuth::SaslClient::Secrets
An interface used by GAuth::SaslClient to obtain authentication secrets.
Definition: gsaslclient.h:52
gvalid.h
GAuth::SaslClient::Secrets::~Secrets
virtual ~Secrets()
Definition: gsaslclient_native.cpp:237
gexception.h
GAuth::SaslClient::~SaslClient
~SaslClient()
Destructor.
Definition: gsaslclient_native.cpp:94
gpath.h
GAuth::SaslClient
A class for implementing the client-side SASL challenge/response concept.
Definition: gsaslclient.h:48
GAuth::SaslClient::initial_response
std::string initial_response(const std::string &mechanism, bool &done, bool &error, bool &sensitive) const
Returns an initial_response for authentication.
Definition: gsaslclient_native.cpp:104
GAuth::SaslClient::Secrets::id
virtual std::string id(const std::string &mechanism) const =0
gaddress.h
GAuth
SASL authentication classes.
GAuth::Valid
A trivial mix-in interface containing a valid() method.
Definition: gvalid.h:35