class SASL
|
SASL authentication mechanism. More... |
|
|
Public Methods
Public Static Methods
- static bool parsePlain (const DataBlock& buf, String& user, String& pwd,
String* authzid = 0)
- static void buildMD5Digest (String& dest, const NamedList& params,
const char* password, bool challengeRsp = true)
Public Members
This class handles PLAIN (rfc 4616) and DIGEST (rfc 2831) SASL authentication
SASL (bool plain, const char* realm = 0)
| SASL |
Constructor
Parameters:
plain | True to build a plain password auth object
|
realm | Optional server realm
|
Destructor
void setAuthParams (const char* user = 0, const char* pwd = 0)
| setAuthParams |
Set auth params
Parameters:
user | Optional username
|
pwd | Optional password
|
bool buildAuthRsp (String& buf, const char* digestUri = 0)
| buildAuthRsp |
Build a client initial auth or challenge response
Parameters:
buf | Destination buffer. It will be filled with Base64 encoded result
|
digestUri | Digest MD5 URI
|
Returns: True on success
inline void buildAuthRspReply (String& buf, const String& rsp)
| buildAuthRspReply |
Build a server reply to challenge response
Parameters:
buf | Destination buffer. It will be filled with Base64 encoded result
|
rsp | The response
|
inline bool validAuthReply (const String& reply)
| validAuthReply |
Check if a challenge response reply is valid
Parameters:
Returns: True if valid
bool buildMD5Challenge (String& buf)
| buildMD5Challenge |
Build an MD5 challenge from this object.
Generate a new nonce and increase nonce count
Parameters:
Returns: True on success
inline void buildMD5Digest (String& dest, const char* password,
bool challengeRsp = true)
| buildMD5Digest |
Build a Digest MD5 SASL (RFC 2831) to be sent with authentication responses
Parameters:
dest | Destination string
|
password | The password to use
|
challengeRsp | True if building a Digest MD5 challenge response, false if
building a challenge response reply
|
bool parsePlain (const DataBlock& buf)
| parsePlain |
Parse plain password auth data
Parameters:
Returns: True if succesfully parsed
bool parseMD5Challenge (const String& buf)
| parseMD5Challenge |
Parse and decode a buffer containing a SASL Digest MD5 challenge.
Parameters:
buf | Already checked for valid UTF8 characters input string
|
Returns: True on success
bool parseMD5ChallengeRsp (const String& buf)
| parseMD5ChallengeRsp |
Parse and decode a buffer containing a SASL Digest MD5 response.
Check realm, nonce and nonce count
Parameters:
buf | Already checked for valid UTF8 characters input string
|
Returns: True on success
bool parsePlain (const DataBlock& buf, String& user, String& pwd,
String* authzid = 0)
| parsePlain |
[static]
Parse and decode a buffer containing SASL plain authentication data
as defined in RFC 4616
Parameters:
buf | Input buffer
|
user | Destination buffer for username part
|
pwd | Destination buffer for password part
|
authzid | Optional destination buffer for authorization identity part
|
Returns: True on success
void buildMD5Digest (String& dest, const NamedList& params,
const char* password, bool challengeRsp = true)
| buildMD5Digest |
[static]
Build a Digest MD5 SASL (RFC 2831) to be sent with authentication responses
Parameters:
dest | Destination string
|
params | List of parameters
|
password | The password to use
|
challengeRsp | True if building a Digest MD5 challenge response, false if
building a challenge response reply
|
NamedList* m_params
| m_params |
unsigned int m_nonceCount
| m_nonceCount |
Generated by: paulc on bussard on Fri Apr 1 18:17:10 2011, using kdoc 2.0a54. |