QCA::SASLContext Class Reference
[QCA provider API]

SASL provider. More...

#include <QtCrypto>

Inheritance diagram for QCA::SASLContext:

QCA::Provider::Context Collaboration diagram for QCA::SASLContext:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Result {
  Success, Error, Params, AuthCheck,
  Continue
}

Signals

void resultsReady ()

Public Member Functions

 SASLContext (Provider *p)
virtual void reset ()=0
virtual void setup (const QString &service, const QString &host, const HostPort *local, const HostPort *remote, const QString &ext_id, int ext_ssf)=0
virtual void setConstraints (SASL::AuthFlags f, int minSSF, int maxSSF)=0
virtual void startClient (const QStringList &mechlist, bool allowClientSendFirst)=0
virtual void startServer (const QString &realm, bool disableServerSendLast)=0
virtual void serverFirstStep (const QString &mech, const QByteArray *clientInit)=0
virtual void nextStep (const QByteArray &from_net)=0
virtual void tryAgain ()=0
virtual void update (const QByteArray &from_net, const QByteArray &from_app)=0
virtual bool waitForResultsReady (int msecs)=0
virtual Result result () const=0
virtual QStringList mechlist () const=0
virtual QString mech () const=0
virtual bool haveClientInit () const=0
virtual QByteArray stepData () const=0
virtual QByteArray to_net ()=0
virtual int encoded () const=0
virtual QByteArray to_app ()=0
virtual int ssf () const=0
virtual SASL::AuthCondition authCondition () const=0
virtual SASL::Params clientParams () const=0
virtual void setClientParams (const QString *user, const QString *authzid, const SecureArray *pass, const QString *realm)=0
virtual QStringList realmlist () const=0
virtual QString username () const=0
virtual QString authzid () const=0

Classes

class  HostPort
 Convenience class to hold an IP address and an associated port. More...

Detailed Description

SASL provider.

Note:
This class is part of the provider plugin interface and should not be used directly by applications. You probably want SASL instead.


Member Enumeration Documentation

enum QCA::SASLContext::Result

Result of a SASL operation.

Enumerator:
Success  Operation completed.
Error  Operation failed.
Params  Parameters are needed to complete authentication.
AuthCheck  Client login can be inspected (server only).
Continue  More steps needed to complete authentication.


Constructor & Destructor Documentation

QCA::SASLContext::SASLContext ( Provider p  )  [inline]

Standard constructor.


Member Function Documentation

virtual void QCA::SASLContext::reset (  )  [pure virtual]

Reset the object to its initial state.

virtual void QCA::SASLContext::setup ( const QString service,
const QString host,
const HostPort local,
const HostPort remote,
const QString ext_id,
int  ext_ssf 
) [pure virtual]

Configure a new session.

This function will be called before any other configuration functions.

virtual void QCA::SASLContext::setConstraints ( SASL::AuthFlags  f,
int  minSSF,
int  maxSSF 
) [pure virtual]

Set the constraints of the session using SSF values.

This function will be called before startClient() or startServer().

virtual void QCA::SASLContext::startClient ( const QStringList mechlist,
bool  allowClientSendFirst 
) [pure virtual]

Begins the session in client mode, starting with the authentication.

This function returns immediately, and completion is signaled with the resultsReady() signal.

On completion, result(), mech(), haveClientInit(), and stepData() will be valid. If result() is Success, then the session is now in the connected state.

virtual void QCA::SASLContext::startServer ( const QString realm,
bool  disableServerSendLast 
) [pure virtual]

Begins the session in server mode, starting with the authentication.

This function returns immediately, and completion is signaled with the resultsReady() signal.

On completion, result() and mechlist() will be valid. The result() function will return Success or Error. If the result is Success, then serverFirstStep() will be called next.

virtual void QCA::SASLContext::serverFirstStep ( const QString mech,
const QByteArray clientInit 
) [pure virtual]

Finishes server startup.

This function returns immediately, and completion is signaled with the resultsReady() signal.

On completion, result() and stepData() will be valid. If result() is Success, then the session is now in the connected state.

virtual void QCA::SASLContext::nextStep ( const QByteArray from_net  )  [pure virtual]

Perform another step of the SASL authentication.

This function returns immediately, and completion is signaled with the resultsReady() signal.

On completion, result() and stepData() will be valid.

virtual void QCA::SASLContext::tryAgain (  )  [pure virtual]

Attempt the most recent operation again.

This is used if the result() of an operation is Params or AuthCheck.

This function returns immediately, and completion is signaled with the resultsReady() signal.

On completion, result() and stepData() will be valid.

virtual void QCA::SASLContext::update ( const QByteArray from_net,
const QByteArray from_app 
) [pure virtual]

Performs one iteration of the SASL security layer processing.

This function returns immediately, and completion is signaled with the resultsReady() signal.

On completion, result(), to_net(), encoded(), and to_app() will be valid. The result() function will return Success or Error.

virtual bool QCA::SASLContext::waitForResultsReady ( int  msecs  )  [pure virtual]

Waits for a startClient(), startServer(), serverFirstStep(), nextStep(), tryAgain(), or update() operation to complete.

In this case, the resultsReady() signal is not emitted. Returns true if the operation completed or false if this function times out.

This function is blocking.

Parameters:
msecs number of milliseconds to wait (-1 to wait forever)

virtual Result QCA::SASLContext::result (  )  const [pure virtual]

Returns the result code of an operation.

virtual QStringList QCA::SASLContext::mechlist (  )  const [pure virtual]

Returns the mechanism list (server mode only).

virtual QString QCA::SASLContext::mech (  )  const [pure virtual]

Returns the mechanism selected.

virtual bool QCA::SASLContext::haveClientInit (  )  const [pure virtual]

Returns true if the client has initialization data.

virtual QByteArray QCA::SASLContext::stepData (  )  const [pure virtual]

Returns an authentication payload for to be transmitted over the network.

virtual QByteArray QCA::SASLContext::to_net (  )  [pure virtual]

Returns data that should be sent across the network (for the security layer).

virtual int QCA::SASLContext::encoded (  )  const [pure virtual]

Returns the number of bytes of plaintext data that is encoded inside of to_net().

virtual QByteArray QCA::SASLContext::to_app (  )  [pure virtual]

Returns data that is decoded from the network and should be processed by the application.

virtual int QCA::SASLContext::ssf (  )  const [pure virtual]

Returns the SSF of the active SASL session.

This is only valid after authentication success.

virtual SASL::AuthCondition QCA::SASLContext::authCondition (  )  const [pure virtual]

Returns the reason for failure, if the authentication was not successful.

This is only valid after authentication failure.

virtual SASL::Params QCA::SASLContext::clientParams (  )  const [pure virtual]

Returns the needed/optional client parameters.

This is only valid after receiving the Params result code.

virtual void QCA::SASLContext::setClientParams ( const QString user,
const QString authzid,
const SecureArray pass,
const QString realm 
) [pure virtual]

Set some of the client parameters (pass 0 to not set a field).

virtual QStringList QCA::SASLContext::realmlist (  )  const [pure virtual]

Returns the realm list (client mode only).

This is only valid after receiving the Params result code and SASL::Params::canSendRealm is set to true.

virtual QString QCA::SASLContext::username (  )  const [pure virtual]

Returns the username attempting to authenticate (server mode only).

This is only valid after receiving the AuthCheck result code.

virtual QString QCA::SASLContext::authzid (  )  const [pure virtual]

Returns the authzid attempting to authorize (server mode only).

This is only valid after receiving the AuthCheck result code.

void QCA::SASLContext::resultsReady (  )  [signal]

Emit this when a startClient(), startServer(), serverFirstStep(), nextStep(), tryAgain(), or update() operation has completed.


The documentation for this class was generated from the following file:
Generated on Tue Aug 28 08:23:10 2007 for Qt Cryptographic Architecture by  doxygen 1.5.2