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

Public Member Functions

 ~SASLContext ()
 
 SASLContext ()
 
shared_ptr< SASLSessioncreateSession (const string &serviceName, shared_ptr< authenticator > auth, shared_ptr< SASLMechanism > mech)
 
shared_ptr< SASLMechanismcreateMechanism (const string &name)
 
shared_ptr< SASLMechanismsuggestMechanism (const std::vector< shared_ptr< SASLMechanism > > &mechs)
 
void decodeB64 (const string &input, byte_t **output, size_t *outputLen)
 
const string encodeB64 (const byte_t *input, const size_t inputLen)
 

Additional Inherited Members

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

Detailed Description

An SASL client context.

Constructor & Destructor Documentation

Construct and initialize a new SASL context.

Member Function Documentation

shared_ptr< SASLMechanism > createMechanism ( const string name)

Create an instance of an SASL mechanism.

Parameters
namemechanism name
Returns
a new instance of the specified SASL mechanism
Exceptions
exceptions::no_such_mechanismif no mechanism is registered for the specified name

References SASLMechanismFactory::create(), and SASLMechanismFactory::getInstance().

shared_ptr< SASLSession > createSession ( const string serviceName,
shared_ptr< authenticator auth,
shared_ptr< SASLMechanism mech 
)

Create and initialize a new SASL session.

Parameters
serviceNamename of the service which will use the session
authauthenticator object to use during the session
mechSASL mechanism
Returns
a new SASL session
void decodeB64 ( const string input,
byte_t **  output,
size_t outputLen 
)

Helper function for decoding Base64-encoded challenge.

Parameters
inputinput buffer
outputoutput buffer
outputLenlength of output buffer

References encoderFactory::getInstance().

const string encodeB64 ( const byte_t input,
const size_t  inputLen 
)

Helper function for encoding challenge in Base64.

Parameters
inputinput buffer
inputLenlength of input buffer
Returns
Base64-encoded challenge

References encoderFactory::getInstance().

shared_ptr< SASLMechanism > suggestMechanism ( const std::vector< shared_ptr< SASLMechanism > > &  mechs)

Suggests an SASL mechanism among a set of mechanisms supported by the server.

Parameters
mechslist of mechanisms
Returns
suggested mechanism (usually the safest mechanism supported by both the client and the server)

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