VMime
SASLSession Class Reference
Inheritance diagram for SASLSession:
Collaboration diagram for SASLSession:

Public Member Functions

 ~SASLSession ()
 
 SASLSession (const string &serviceName, shared_ptr< SASLContext > ctx, shared_ptr< authenticator > auth, shared_ptr< SASLMechanism > mech)
 
void init ()
 
shared_ptr< authenticatorgetAuthenticator ()
 
shared_ptr< SASLMechanismgetMechanism ()
 
shared_ptr< SASLContextgetContext ()
 
bool evaluateChallenge (const byte_t *challenge, const size_t challengeLen, byte_t **response, size_t *responseLen)
 
shared_ptr< net::socketgetSecuredSocket (shared_ptr< net::socket > sok)
 
const string getServiceName () const
 

Additional Inherited Members

- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

An SASL client session.

Constructor & Destructor Documentation

SASLSession ( const string serviceName,
shared_ptr< SASLContext ctx,
shared_ptr< authenticator auth,
shared_ptr< SASLMechanism mech 
)

Construct a new SASL session.

Parameters
serviceNamename of the service using this session
ctxSASL context
authauthenticator to use for this session
mechSASL mechanism

Member Function Documentation

bool evaluateChallenge ( const byte_t challenge,
const size_t  challengeLen,
byte_t **  response,
size_t responseLen 
)

Perform one step of SASL authentication.

Accept data from the server (challenge), process it and return data to be returned in response to the server.

If the challenge is empty (challengeLen == 0), the initial response is returned, if the mechanism has one.

Parameters
challengechallenge sent from the server
challengeLenlength of challenge
responseresponse to send to the server (allocated by this function, free with delete[])
responseLenlength of response buffer
Returns
true if authentication terminated successfully, or false if the authentication process should continue
Exceptions
exceptions::sasl_exceptionif an error occured during authentication (in this case, the values in 'response' and 'responseLen' are undetermined)
shared_ptr< authenticator > getAuthenticator ( )

Return the authenticator used for this session.

This is the authenticator which has been previously set with a call to setAuthenticator().

Returns
authenticator object
shared_ptr< SASLContext > getContext ( )

Return the SASL context.

Returns
SASL context
shared_ptr< SASLMechanism > getMechanism ( )

Return the mechanism used for this session.

Returns
SASL mechanism
shared_ptr< net::socket > getSecuredSocket ( shared_ptr< net::socket sok)

Return a socket in which transmitted data is integrity and/or privacy protected, depending on the QOP (Quality of Protection) negotiated during the SASL authentication.

Parameters
soksocket to wrap
Returns
secured socket
const string getServiceName ( ) const

Return the name of the service which is using this SASL session (eg.

"imap"). This value should be returned by the authenticator when INFO_SERVICE is requested.

Returns
service name
void init ( )

Initialize this SASL session.

This must be called before calling any other method on this object (except accessors).


The documentation for this class was generated from the following files: