QCA::SASLContext

Search for usage in LXR

#include <QtCrypto>

Inheritance diagram for QCA::SASLContext:

Classes

class  HostPort
 

Public Types

enum  Result {
  Success , Error , Params , AuthCheck ,
  Continue
}
 
- Public Types inherited from QObject
typedef  QObjectList
 

Signals

void resultsReady ()
 

Public Member Functions

 SASLContext (Provider *p)
 
virtual SASL::AuthCondition authCondition () const =0
 
virtual QString authzid () const =0
 
virtual SASL::Params clientParams () const =0
 
virtual int encoded () const =0
 
virtual bool haveClientInit () const =0
 
virtual QString mech () const =0
 
virtual QStringList mechlist () const =0
 
virtual void nextStep (const QByteArray &from_net)=0
 
virtual QStringList realmlist () const =0
 
virtual void reset ()=0
 
virtual Result result () const =0
 
virtual void serverFirstStep (const QString &mech, const QByteArray *clientInit)=0
 
virtual void setClientParams (const QString *user, const QString *authzid, const SecureArray *pass, const QString *realm)=0
 
virtual void setConstraints (SASL::AuthFlags f, int minSSF, int maxSSF)=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 int ssf () const =0
 
virtual void startClient (const QStringList &mechlist, bool allowClientSendFirst)=0
 
virtual void startServer (const QString &realm, bool disableServerSendLast)=0
 
virtual QByteArray stepData () const =0
 
virtual QByteArray to_app ()=0
 
virtual QByteArray to_net ()=0
 
virtual void tryAgain ()=0
 
virtual void update (const QByteArray &from_net, const QByteArray &from_app)=0
 
virtual QString username () const =0
 
virtual bool waitForResultsReady (int msecs)=0
 
- Public Member Functions inherited from QCA::Provider::Context
virtual Contextclone () const =0
 
Providerprovider () const
 
bool sameProvider (const Context *c) const
 
QString type () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QCA::Provider::Context
 Context (const Context &from)
 
 Context (Provider *parent, const QString &type)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

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.

Definition at line 2601 of file qcaprovider.h.

Member Enumeration Documentation

◆ 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.

Definition at line 2631 of file qcaprovider.h.

Constructor & Destructor Documentation

◆ SASLContext()

QCA::SASLContext::SASLContext ( Provider * p)
inline

Standard constructor.

Parameters
pthe Provider associated with this context

Definition at line 2645 of file qcaprovider.h.

Member Function Documentation

◆ authCondition()

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.

◆ authzid()

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.

◆ clientParams()

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.

◆ encoded()

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

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

◆ haveClientInit()

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

Returns true if the client has initialization data.

◆ mech()

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

Returns the mechanism selected.

◆ mechlist()

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

Returns the mechanism list (server mode only)

◆ nextStep()

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.

Parameters
from_netthe data from the "other side" of the protocol to be used for the next step.

◆ realmlist()

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.

◆ reset()

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

Reset the object to its initial state.

◆ result()

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

Returns the result code of an operation.

◆ resultsReady

void QCA::SASLContext::resultsReady ( )
signal

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

◆ serverFirstStep()

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.

Parameters
mechthe mechanism to use
clientInitinitial data from the client, or 0 if there is no such data

◆ setClientParams()

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)

Parameters
userthe user name
authzidthe authorization name / role
passthe password
realmthe realm to authenticate in

◆ setConstraints()

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

Parameters
fthe flags to use
minSSFthe minimum strength factor that is acceptable
maxSSFthe maximum strength factor that is acceptable

◆ setup()

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.

Parameters
servicethe name of the network service being provided by this application, which can be used by the SASL system for policy control. Examples: "imap", "xmpp"
hostthe hostname that the application is interacting with or as
localpointer to a HostPort representing the local end of a network socket, or 0 if this information is unknown or not available
remotepointer to a HostPort representing the peer end of a network socket, or 0 if this information is unknown or not available
ext_idthe id to be used for SASL EXTERNAL (client only)
ext_ssfthe SSF of the external authentication channel (client only)

◆ ssf()

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

Returns the SSF of the active SASL session.

This is only valid after authentication success.

◆ startClient()

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.

Parameters
mechlistthe list of mechanisms
allowClientSendFirstwhether the client sends first (true) or the server sends first (false)

◆ startServer()

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.

Parameters
realmthe realm to authenticate in
disableServerSendLastwhether the client sends first (true) or the server sends first (false)

◆ stepData()

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

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

◆ to_app()

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

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

◆ to_net()

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

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

◆ tryAgain()

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.

◆ update()

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.

Parameters
from_netthe data from the "other side" of the protocol
from_appthe data from the application of the protocol

◆ username()

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.

◆ waitForResultsReady()

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
msecsnumber of milliseconds to wait (-1 to wait forever)

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.