E-MailRelay
|
A class that implements the client-side SASL challenge/response concept. More...
#include <gsaslclient.h>
Classes | |
struct | Response |
Result structure returned from GAuth::SaslClient::response. More... | |
Public Member Functions | |
SaslClient (const SaslClientSecrets &secrets, const std::string &config) | |
Constructor. The secrets reference is kept. More... | |
~SaslClient () | |
Destructor. | |
bool | active () const |
Returns true if the constructor's secrets object is valid. More... | |
Response | response (const std::string &mechanism, const std::string &challenge) const |
Returns a response to the given challenge. More... | |
std::string | initialResponse (std::size_t limit=0U) const |
Returns an optional initial response. More... | |
std::string | mechanism (const G::StringArray &mechanisms) const |
Returns the name of the preferred mechanism taken from the given set, taking into account what client secrets are available. More... | |
bool | next () |
Moves to the next preferred mechanism. More... | |
std::string | next (const std::string &) |
A convenience overload that moves to the next() mechanism and returns it. More... | |
std::string | mechanism () const |
Returns the name of the current mechanism once next() has returned true. More... | |
std::string | id () const |
Returns the authentication id, valid after the last response(). More... | |
std::string | info () const |
Returns logging and diagnostic information, valid after the last response(). More... | |
SaslClient (const SaslClient &)=delete | |
SaslClient (SaslClient &&)=delete | |
void | operator= (const SaslClient &)=delete |
void | operator= (SaslClient &&)=delete |
A class that implements the client-side SASL challenge/response concept.
Definition at line 40 of file gsaslclient.h.
|
explicit |
Constructor. The secrets reference is kept.
Definition at line 270 of file gsaslclient.cpp.
bool GAuth::SaslClient::active | ( | ) | const |
Returns true if the constructor's secrets object is valid.
Definition at line 278 of file gsaslclient.cpp.
std::string GAuth::SaslClient::id | ( | ) | const |
Returns the authentication id, valid after the last response().
Definition at line 314 of file gsaslclient.cpp.
std::string GAuth::SaslClient::info | ( | ) | const |
Returns logging and diagnostic information, valid after the last response().
Definition at line 319 of file gsaslclient.cpp.
std::string GAuth::SaslClient::initialResponse | ( | std::size_t | limit = 0U | ) | const |
Returns an optional initial response.
Always returns the empty string if the mechanism is 'server-first'. Returns the empty string, with no side-effects, if the initial response is longer than the specified limit. Zero-length initial-responses are not distinguishable from absent initial-responses.
Definition at line 288 of file gsaslclient.cpp.
std::string GAuth::SaslClient::mechanism | ( | ) | const |
Returns the name of the current mechanism once next() has returned true.
Definition at line 309 of file gsaslclient.cpp.
std::string GAuth::SaslClient::mechanism | ( | const G::StringArray & | mechanisms | ) | const |
Returns the name of the preferred mechanism taken from the given set, taking into account what client secrets are available.
Returns the empty string if none is supported or if not active().
Definition at line 293 of file gsaslclient.cpp.
bool GAuth::SaslClient::next | ( | ) |
Moves to the next preferred mechanism.
Returns false if there are no more mechanisms.
Definition at line 298 of file gsaslclient.cpp.
std::string GAuth::SaslClient::next | ( | const std::string & | s | ) |
A convenience overload that moves to the next() mechanism and returns it.
Returns the empty string if the given string is empty or if there are no more mechanisms.
Definition at line 303 of file gsaslclient.cpp.
GAuth::SaslClient::Response GAuth::SaslClient::response | ( | const std::string & | mechanism, |
const std::string & | challenge | ||
) | const |
Returns a response to the given challenge.
The mechanism is used to choose the appropriate entry in the secrets file.
Definition at line 283 of file gsaslclient.cpp.