VMime
SASLContext Class Reference

#include <SASLContext.hpp>

Inheritance diagram for SASLContext:
Collaboration diagram for SASLContext:

Public Member Functions

 ~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)

Static Public Member Functions

static shared_ptr< SASLContext > create ()

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

◆ ~SASLContext()

~SASLContext ( )

Member Function Documentation

◆ create()

shared_ptr< SASLContext > create ( )
static

Construct and initialize a new SASL context.

Returns
pointer to a new SASL context

Referenced by builtinSASLMechanism.

◆ createMechanism()

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(), vmime::dynamicCast(), and SASLMechanismFactory::getInstance().

Referenced by builtinSASLMechanism.

◆ createSession()

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

References SASLSession::create(), and vmime::dynamicCast().

Referenced by builtinSASLMechanism.

◆ decodeB64()

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().

Referenced by builtinSASLMechanism.

◆ encodeB64()

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().

Referenced by builtinSASLMechanism.

◆ suggestMechanism()

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)

Referenced by builtinSASLMechanism.


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