qca
QCA::SASL Class Reference
[QCA user API]
#include <QtCrypto>

Detailed Description
Simple Authentication and Security Layer protocol implementation.This class implements the Simple Authenication and Security Layer protocol, which is described in RFC2222 - see http://www.ietf.org/rfc/rfc2222.txt.
As the name suggests, SASL provides authentication (eg, a "login" of some form), for a connection oriented protocol, and can also provide protection for the subsequent connection.
The SASL protocol is designed to be extensible, through a range of "mechanisms", where a mechanism is the actual authentication method. Example mechanisms include Anonymous, LOGIN, Kerberos V4, and GSSAPI. Mechanisms can be added (potentially without restarting the server application) by the system administrator.
It is important to understand that SASL is neither "network aware" nor "protocol aware". That means that SASL does not understand how the client connects to the server, and SASL does not understand the actual application protocol.
Definition at line 831 of file qca_securelayer.h.
Member Enumeration Documentation
Possible authentication error states.
- Enumerator:
Definition at line 848 of file qca_securelayer.h.
| enum QCA::SASL::AuthFlags |
Authentication requirement flag values.
- Enumerator:
-
AuthFlagsNone AllowPlain AllowAnonymous RequireForwardSecrecy RequirePassCredentials RequireMutualAuth RequireAuthzidSupport
Definition at line 867 of file qca_securelayer.h.
| enum QCA::SASL::Error |
Possible errors that may occur when using SASL.
- Enumerator:
-
ErrorInit problem starting up SASL ErrorHandshake problem during the authentication process ErrorCrypt problem at anytime after
Definition at line 838 of file qca_securelayer.h.
Constructor & Destructor Documentation
Standard constructor.
- Parameters:
-
parent the parent object for this SASL connection provider if specified, the provider to use. If not specified, or specified as empty, then any provider is acceptable.
Definition at line 1773 of file qca_securelayer.cpp.
| QCA::SASL::~SASL | ( | ) |
Definition at line 1779 of file qca_securelayer.cpp.
Member Function Documentation
This signal is emitted when the server needs to perform the authentication check.
If the user and authzid are valid, call continueAfterAuthCheck().
- Parameters:
-
user the user identification name authzid the user authorization name
| SASL::AuthCondition QCA::SASL::authCondition | ( | ) | const |
| void QCA::SASL::authenticated | ( | ) | [signal] |
This signal is emitted when authentication is complete.
| int QCA::SASL::bytesAvailable | ( | ) | const [virtual] |
Returns the number of bytes available to be read() on the application side.
Implements QCA::SecureLayer.
Definition at line 1941 of file qca_securelayer.cpp.
| int QCA::SASL::bytesOutgoingAvailable | ( | ) | const [virtual] |
Returns the number of bytes available to be readOutgoing() on the network side.
Implements QCA::SecureLayer.
Definition at line 1946 of file qca_securelayer.cpp.
| void QCA::SASL::clientStarted | ( | bool | clientInit, | |
| const QByteArray & | clientInitData | |||
| ) | [signal] |
This signal is emitted when the client has been successfully started.
- Parameters:
-
clientInit true if the client should send an initial response to the server clientInitData the initial response to send to the server. Do note that there is a difference in SASL between an empty initial response and no initial response, and so even if clientInitData is an empty array, you still need to send an initial response if clientInit is true.
| void QCA::SASL::continueAfterAuthCheck | ( | ) |
Continue negotiation after auth ids have been checked (server).
Definition at line 1916 of file qca_securelayer.cpp.
| void QCA::SASL::continueAfterParams | ( | ) |
Continue negotiation after parameters have been set (client).
Definition at line 1911 of file qca_securelayer.cpp.
| int QCA::SASL::convertBytesWritten | ( | qint64 | encryptedBytes | ) | [virtual] |
Convert encrypted bytes written to plain text bytes written.
- Parameters:
-
encryptedBytes the number of bytes to convert
Implements QCA::SecureLayer.
Definition at line 1982 of file qca_securelayer.cpp.
| SASL::Error QCA::SASL::errorCode | ( | ) | const |
| QString QCA::SASL::mechanism | ( | ) | const |
| QStringList QCA::SASL::mechanismList | ( | ) | const |
| void QCA::SASL::needParams | ( | const QCA::SASL::Params & | params | ) | [signal] |
This signal is emitted when the client needs additional parameters.
After receiving this signal, the application should set the required parameter values appropriately and then call continueAfterParams().
- Parameters:
-
params the parameters that are required by the client
| void QCA::SASL::nextStep | ( | const QByteArray & | stepData | ) | [signal] |
This signal is emitted when there is data required to be sent over the network to complete the next step in the authentication process.
- Parameters:
-
stepData the data to send over the network
| void QCA::SASL::putServerFirstStep | ( | const QString & | mech, | |
| const QByteArray & | clientInit | |||
| ) |
Process the first step in server mode (server).
Call this with the mechanism selected by the client, and initial client data. If there is no initial client data, call the other version of this function instead.
- Parameters:
-
mech the mechanism to be used clientInit the initial data provided by the client side
Definition at line 1873 of file qca_securelayer.cpp.
| void QCA::SASL::putServerFirstStep | ( | const QString & | mech | ) |
Process the first step in server mode (server).
Call this with the mechanism selected by the client. If there is initial client data, call the other version of this function instead.
- Parameters:
-
mech the mechanism to be used.
Definition at line 1868 of file qca_securelayer.cpp.
| void QCA::SASL::putStep | ( | const QByteArray & | stepData | ) |
Process an authentication step.
Call this with authentication data received from the network. The only exception is the first step in server mode, in which case putServerFirstStep must be called.
- Parameters:
-
stepData the authentication data from the network
Definition at line 1878 of file qca_securelayer.cpp.
| QByteArray QCA::SASL::read | ( | ) | [virtual] |
This method reads decrypted (plain) data from the SecureLayer implementation.
You normally call this function on the application side after receiving the readyRead() signal.
Implements QCA::SecureLayer.
Definition at line 1958 of file qca_securelayer.cpp.
| QByteArray QCA::SASL::readOutgoing | ( | int * | plainBytes = 0 |
) | [virtual] |
This method provides encoded (typically encrypted) data.
You normally call this function to get data to write out to the network socket (e.g. using QTcpSocket::write()) after receiving the readyReadOutgoing() signal.
- Parameters:
-
plainBytes the number of bytes that were read.
Implements QCA::SecureLayer.
Definition at line 1971 of file qca_securelayer.cpp.
| QStringList QCA::SASL::realmList | ( | ) | const |
| void QCA::SASL::reset | ( | ) |
| void QCA::SASL::serverStarted | ( | ) | [signal] |
This signal is emitted after the server has been successfully started.
| void QCA::SASL::setAuthzid | ( | const QString & | auth | ) |
Specify the authorization identity to use in authentication.
- Parameters:
-
auth the authorization identity to use
Definition at line 1890 of file qca_securelayer.cpp.
| void QCA::SASL::setConstraints | ( | AuthFlags | f, | |
| int | minSSF, | |||
| int | maxSSF | |||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Unless you have a specific reason for directly specifying a strength factor, you probably should use the method above.
- Parameters:
-
f the authentication requirements, which you typically build using a binary OR function (eg AllowPlain | AllowAnonymous) minSSF the minimum security strength factor that is required maxSSF the maximum security strength factor that is required
- Note:
- Security strength factors are a rough approximation to key length in the encryption function (eg if you are securing with plain DES, the security strength factor would be 56).
Definition at line 1816 of file qca_securelayer.cpp.
| void QCA::SASL::setConstraints | ( | AuthFlags | f, | |
| SecurityLevel | s = SL_None | |||
| ) |
Specify connection constraints.
SASL supports a range of authentication requirements, and a range of security levels. This method allows you to specify the requirements for your connection.
- Parameters:
-
f the authentication requirements, which you typically build using a binary OR function (eg AllowPlain | AllowAnonymous) s the security level of the encryption, if used. See SecurityLevel for details of what each level provides.
Definition at line 1799 of file qca_securelayer.cpp.
| void QCA::SASL::setExternalAuthId | ( | const QString & | authid | ) |
Specify the id of the externally secured connection.
- Parameters:
-
authid the id of the connection
Definition at line 1824 of file qca_securelayer.cpp.
| void QCA::SASL::setExternalSSF | ( | int | strength | ) |
Specify a security strength factor for an externally secured connection.
- Parameters:
-
strength the security strength factor of the connection
Definition at line 1829 of file qca_securelayer.cpp.
| void QCA::SASL::setLocalAddress | ( | const QString & | addr, | |
| quint16 | port | |||
| ) |
Specify the local address.
- Parameters:
-
addr the address of the local part of the connection port the port number of the local part of the connection
Definition at line 1834 of file qca_securelayer.cpp.
| void QCA::SASL::setPassword | ( | const SecureArray & | pass | ) |
Specify the password to use in authentication.
- Parameters:
-
pass the password to use
Definition at line 1897 of file qca_securelayer.cpp.
| void QCA::SASL::setRealm | ( | const QString & | realm | ) |
Specify the realm to use in authentication.
- Parameters:
-
realm the realm to use
Definition at line 1904 of file qca_securelayer.cpp.
| void QCA::SASL::setRemoteAddress | ( | const QString & | addr, | |
| quint16 | port | |||
| ) |
Specify the peer address.
- Parameters:
-
addr the address of the peer side of the connection port the port number of the peer side of the connection
Definition at line 1841 of file qca_securelayer.cpp.
| void QCA::SASL::setUsername | ( | const QString & | user | ) |
Specify the username to use in authentication.
- Parameters:
-
user the username to use
Definition at line 1883 of file qca_securelayer.cpp.
| int QCA::SASL::ssf | ( | ) | const |
Return the security strength factor of the connection.
Definition at line 1936 of file qca_securelayer.cpp.
| void QCA::SASL::startClient | ( | const QString & | service, | |
| const QString & | host, | |||
| const QStringList & | mechlist, | |||
| ClientSendMode | mode = AllowClientSendFirst | |||
| ) |
Initialise the client side of the connection.
startClient must be called on the client side of the connection. clientStarted will be emitted when the operation is completed.
- Parameters:
-
service the name of the service host the client side host name mechlist the list of mechanisms which can be used mode the mode to use on the client side
Definition at line 1848 of file qca_securelayer.cpp.
| void QCA::SASL::startServer | ( | const QString & | service, | |
| const QString & | host, | |||
| const QString & | realm, | |||
| ServerSendMode | mode = DisableServerSendLast | |||
| ) |
Initialise the server side of the connection.
startServer must be called on the server side of the connection. serverStarted will be emitted when the operation is completed.
- Parameters:
-
service the name of the service host the server side host name realm the realm to use mode which mode to use on the server side
Definition at line 1858 of file qca_securelayer.cpp.
| void QCA::SASL::write | ( | const QByteArray & | a | ) | [virtual] |
This method writes unencrypted (plain) data to the SecureLayer implementation.
You normally call this function on the application side.
- Parameters:
-
a the source of the application-side data
Implements QCA::SecureLayer.
Definition at line 1951 of file qca_securelayer.cpp.
| void QCA::SASL::writeIncoming | ( | const QByteArray & | a | ) | [virtual] |
This method accepts encoded (typically encrypted) data for processing.
You normally call this function using data read from the network socket (e.g. using QTcpSocket::readAll()) after receiving a signal that indicates that the socket has data to read.
- Parameters:
-
a the ByteArray to take network-side data from
Implements QCA::SecureLayer.
Definition at line 1965 of file qca_securelayer.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference