qca_securelayer.h
Go to the documentation of this file.
/*
* qca_securelayer.h - Qt Cryptographic Architecture
* Copyright (C) 2003-2007 Justin Karneges <justin@affinix.com>
* Copyright (C) 2004-2006 Brad Hards <bradh@frogmouth.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef QCA_SECURELAYER_H
#define QCA_SECURELAYER_H
#include "qca_cert.h"
#include "qca_core.h"
#include "qca_publickey.h"
#include <QObject>
namespace QCA {
enum SecurityLevel
{
SL_None,
SL_Integrity,
SL_Export,
SL_Baseline,
SL_High,
SL_Highest
};
class QCA_EXPORT SecureLayer : public QObject
{
Q_OBJECT
public:
SecureLayer(QObject *parent = nullptr);
virtual bool isClosable() const;
virtual int bytesAvailable() const = 0;
virtual int bytesOutgoingAvailable() const = 0;
virtual void close();
virtual void write(const QByteArray &a) = 0;
virtual QByteArray read() = 0;
virtual void writeIncoming(const QByteArray &a) = 0;
virtual QByteArray readOutgoing(int *plainBytes = nullptr) = 0;
virtual QByteArray readUnprocessed();
virtual int convertBytesWritten(qint64 encryptedBytes) = 0;
Q_SIGNALS:
void readyRead();
void readyReadOutgoing();
void closed();
void error();
private:
Q_DISABLE_COPY(SecureLayer)
};
class QCA_EXPORT TLSSession : public Algorithm
{
public:
TLSSession();
TLSSession(const TLSSession &from);
~TLSSession() override;
TLSSession &operator=(const TLSSession &from);
bool isNull() const;
};
class QCA_EXPORT TLS : public SecureLayer, public Algorithm
{
Q_OBJECT
public:
enum Mode
{
Stream,
Datagram
};
enum Version
{
TLS_v1,
SSL_v3,
SSL_v2,
DTLS_v1
};
enum Error
{
ErrorSignerExpired,
ErrorSignerInvalid,
ErrorCertKeyMismatch,
ErrorInit,
ErrorHandshake,
ErrorCrypt
};
enum IdentityResult
{
Valid,
HostMismatch,
InvalidCertificate,
NoCertificate
};
explicit TLS(QObject *parent = nullptr, const QString &provider = QString());
explicit TLS(Mode mode, QObject *parent = nullptr, const QString &provider = QString());
~TLS() override;
void reset();
QStringList supportedCipherSuites(const Version &version = TLS_v1) const;
void setCertificate(const CertificateChain &cert, const PrivateKey &key);
void setCertificate(const KeyBundle &kb);
CertificateCollection trustedCertificates() const;
void setTrustedCertificates(const CertificateCollection &trusted);
void setConstraints(SecurityLevel s);
void setConstraints(int minSSF, int maxSSF);
void setConstraints(const QStringList &cipherSuiteList);
QList<CertificateInfoOrdered> issuerList() const;
void setIssuerList(const QList<CertificateInfoOrdered> &issuers);
void setSession(const TLSSession &session);
bool canCompress() const;
bool canSetHostName() const;
bool compressionEnabled() const;
void setCompressionEnabled(bool b);
QString hostName() const;
void startClient(const QString &host = QString());
void startServer();
void continueAfterStep();
bool isHandshaken() const;
bool isCompressed() const;
Version version() const;
QString cipherSuite() const;
int cipherBits() const;
int cipherMaxBits() const;
TLSSession session() const;
Error errorCode() const;
IdentityResult peerIdentityResult() const;
Validity peerCertificateValidity() const;
CertificateChain localCertificateChain() const;
PrivateKey localPrivateKey() const;
CertificateChain peerCertificateChain() const;
// reimplemented
bool isClosable() const override;
int bytesAvailable() const override;
int bytesOutgoingAvailable() const override;
void close() override;
void write(const QByteArray &a) override;
QByteArray read() override;
void writeIncoming(const QByteArray &a) override;
QByteArray readOutgoing(int *plainBytes = nullptr) override;
QByteArray readUnprocessed() override;
int convertBytesWritten(qint64 encryptedBytes) override;
int packetsAvailable() const;
int packetsOutgoingAvailable() const;
int packetMTU() const;
void setPacketMTU(int size) const;
Q_SIGNALS:
void hostNameReceived();
void certificateRequested();
void peerCertificateAvailable();
void handshaken();
protected:
void connectNotify(const QMetaMethod &signal) override;
void disconnectNotify(const QMetaMethod &signal) override;
private:
Q_DISABLE_COPY(TLS)
class Private;
friend class Private;
Private *d;
};
class QCA_EXPORT SASL : public SecureLayer, public Algorithm
{
Q_OBJECT
public:
enum Error
{
ErrorInit,
ErrorHandshake,
ErrorCrypt
};
enum AuthCondition
{
AuthFail,
NoMechanism,
BadProtocol,
BadServer,
BadAuth,
NoAuthzid,
TooWeak,
NeedEncrypt,
Expired,
Disabled,
NoUser,
RemoteUnavailable
};
enum AuthFlags
{
AuthFlagsNone = 0x00,
AllowPlain = 0x01,
AllowAnonymous = 0x02,
RequireForwardSecrecy = 0x04,
RequirePassCredentials = 0x08,
RequireMutualAuth = 0x10,
RequireAuthzidSupport = 0x20 // server-only
};
enum ClientSendMode
{
AllowClientSendFirst,
DisableClientSendFirst
};
enum ServerSendMode
{
AllowServerSendLast,
DisableServerSendLast
};
class QCA_EXPORT Params
{
public:
Params();
Params(bool user, bool authzid, bool pass, bool realm);
Params(const Params &from);
~Params();
Params &operator=(const Params &from);
bool needUsername() const;
bool canSendAuthzid() const;
bool needPassword() const;
bool canSendRealm() const;
private:
class Private;
Private *d;
};
explicit SASL(QObject *parent = nullptr, const QString &provider = QString());
~SASL() override;
void reset();
void setConstraints(AuthFlags f, SecurityLevel s = SL_None);
void setConstraints(AuthFlags f, int minSSF, int maxSSF);
void setLocalAddress(const QString &addr, quint16 port);
void setRemoteAddress(const QString &addr, quint16 port);
void setExternalAuthId(const QString &authid);
void setExternalSSF(int strength);
void startClient(const QString &service,
const QString &host,
const QStringList &mechlist,
ClientSendMode mode = AllowClientSendFirst);
void startServer(const QString &service,
const QString &host,
const QString &realm,
ServerSendMode mode = DisableServerSendLast);
void putServerFirstStep(const QString &mech);
void putServerFirstStep(const QString &mech, const QByteArray &clientInit);
void putStep(const QByteArray &stepData);
QString mechanism() const;
QStringList mechanismList() const;
QStringList realmList() const;
int ssf() const;
Error errorCode() const;
AuthCondition authCondition() const;
void setUsername(const QString &user);
void setAuthzid(const QString &auth);
void setPassword(const SecureArray &pass);
void setRealm(const QString &realm);
void continueAfterParams();
void continueAfterAuthCheck();
// reimplemented
int bytesAvailable() const override;
int bytesOutgoingAvailable() const override;
void write(const QByteArray &a) override;
QByteArray read() override;
void writeIncoming(const QByteArray &a) override;
QByteArray readOutgoing(int *plainBytes = nullptr) override;
int convertBytesWritten(qint64 encryptedBytes) override;
Q_SIGNALS:
void clientStarted(bool clientInit, const QByteArray &clientInitData);
void serverStarted();
void nextStep(const QByteArray &stepData);
void needParams(const QCA::SASL::Params &params);
void authCheck(const QString &user, const QString &authzid);
void authenticated();
private:
Q_DISABLE_COPY(SASL)
class Private;
friend class Private;
Private *d;
};
}
#endif
QCA::Algorithm::provider
Provider * provider() const
The name of the provider.
QCA::Algorithm::Algorithm
Algorithm(const Algorithm &from)
Standard copy constructor.
QCA::CertificateChain
A chain of related Certificates.
Definition qca_cert.h:1226
QCA::CertificateCollection
Bundle of Certificates and CRLs.
Definition qca_cert.h:1929
QCA::KeyBundle
Certificate chain and private key pair.
Definition qca_cert.h:2176
QCA::PrivateKey
Generic private key.
Definition qca_publickey.h:833
QCA::SASL::Params
Parameter flags for the SASL authentication.
Definition qca_securelayer.h:907
QCA::SASL::Params::needPassword
bool needPassword() const
Password is needed.
QCA::SASL::Params::canSendAuthzid
bool canSendAuthzid() const
An Authorization ID can be sent if desired.
QCA::SASL::Params::needUsername
bool needUsername() const
User is needed.
QCA::SASL::Params::canSendRealm
bool canSendRealm() const
A Realm can be sent if desired.
QCA::SASL::Params::Params
Params(bool user, bool authzid, bool pass, bool realm)
Standard constructor.
QCA::SASL::Params::operator=
Params & operator=(const Params &from)
Standard assignment operator.
QCA::SASL::Params::Params
Params(const Params &from)
Standard copy constructor.
QCA::SASL::startServer
void startServer(const QString &service, const QString &host, const QString &realm, ServerSendMode mode=DisableServerSendLast)
Initialise the server side of the connection.
QCA::SASL::putServerFirstStep
void putServerFirstStep(const QString &mech)
Process the first step in server mode (server).
QCA::SASL::setUsername
void setUsername(const QString &user)
Specify the username to use in authentication.
QCA::SASL::setExternalSSF
void setExternalSSF(int strength)
Specify a security strength factor for an externally secured connection.
QCA::SASL::errorCode
Error errorCode() const
Return the error code.
QCA::SASL::authCheck
void authCheck(const QString &user, const QString &authzid)
This signal is emitted when the server needs to perform the authentication check.
QCA::SASL::continueAfterParams
void continueAfterParams()
Continue negotiation after parameters have been set (client).
QCA::SASL::write
void write(const QByteArray &a) override
This method writes unencrypted (plain) data to the SecureLayer implementation.
QCA::SASL::startClient
void startClient(const QString &service, const QString &host, const QStringList &mechlist, ClientSendMode mode=AllowClientSendFirst)
Initialise the client side of the connection.
QCA::SASL::convertBytesWritten
int convertBytesWritten(qint64 encryptedBytes) override
Convert encrypted bytes written to plain text bytes written.
QCA::SASL::SASL
SASL(QObject *parent=nullptr, const QString &provider=QString())
Standard constructor.
QCA::SASL::setConstraints
void setConstraints(AuthFlags f, SecurityLevel s=SL_None)
Specify connection constraints.
QCA::SASL::setAuthzid
void setAuthzid(const QString &auth)
Specify the authorization identity to use in authentication.
QCA::SASL::nextStep
void nextStep(const QByteArray &stepData)
This signal is emitted when there is data required to be sent over the network to complete the next s...
QCA::SASL::continueAfterAuthCheck
void continueAfterAuthCheck()
Continue negotiation after auth ids have been checked (server).
QCA::SASL::writeIncoming
void writeIncoming(const QByteArray &a) override
This method accepts encoded (typically encrypted) data for processing.
QCA::SASL::AuthCondition
AuthCondition
Possible authentication error states.
Definition qca_securelayer.h:849
QCA::SASL::NeedEncrypt
@ NeedEncrypt
Encryption is needed in order to use mechanism (server side only).
Definition qca_securelayer.h:857
QCA::SASL::TooWeak
@ TooWeak
Mechanism too weak for this user (server side only).
Definition qca_securelayer.h:856
QCA::SASL::AuthFail
@ AuthFail
Generic authentication failure.
Definition qca_securelayer.h:850
QCA::SASL::BadProtocol
@ BadProtocol
Bad protocol or cancelled.
Definition qca_securelayer.h:852
QCA::SASL::NoUser
@ NoUser
User not found (server side only).
Definition qca_securelayer.h:860
QCA::SASL::NoMechanism
@ NoMechanism
No compatible/appropriate authentication mechanism.
Definition qca_securelayer.h:851
QCA::SASL::BadServer
@ BadServer
Server failed mutual authentication (client side only).
Definition qca_securelayer.h:853
QCA::SASL::RemoteUnavailable
@ RemoteUnavailable
Remote service needed for auth is gone (server side only).
Definition qca_securelayer.h:861
QCA::SASL::Expired
@ Expired
Passphrase expired, has to be reset (server side only).
Definition qca_securelayer.h:858
QCA::SASL::Disabled
@ Disabled
Account is disabled (server side only).
Definition qca_securelayer.h:859
QCA::SASL::BadAuth
@ BadAuth
Authentication failure (server side only).
Definition qca_securelayer.h:854
QCA::SASL::NoAuthzid
@ NoAuthzid
Authorization failure (server side only).
Definition qca_securelayer.h:855
QCA::SASL::ServerSendMode
ServerSendMode
Mode options for server side sending.
Definition qca_securelayer.h:891
QCA::SASL::mechanism
QString mechanism() const
Return the mechanism selected (client).
QCA::SASL::serverStarted
void serverStarted()
This signal is emitted after the server has been successfully started.
QCA::SASL::setPassword
void setPassword(const SecureArray &pass)
Specify the password to use in authentication.
QCA::SASL::setExternalAuthId
void setExternalAuthId(const QString &authid)
Specify the id of the externally secured connection.
QCA::SASL::realmList
QStringList realmList() const
Return the realm list, if available (client).
QCA::SASL::bytesOutgoingAvailable
int bytesOutgoingAvailable() const override
Returns the number of bytes available to be readOutgoing() on the network side.
QCA::SASL::clientStarted
void clientStarted(bool clientInit, const QByteArray &clientInitData)
This signal is emitted when the client has been successfully started.
QCA::SASL::read
QByteArray read() override
This method reads decrypted (plain) data from the SecureLayer implementation.
QCA::SASL::ClientSendMode
ClientSendMode
Mode options for client side sending.
Definition qca_securelayer.h:882
QCA::SASL::needParams
void needParams(const QCA::SASL::Params &params)
This signal is emitted when the client needs additional parameters.
QCA::SASL::mechanismList
QStringList mechanismList() const
Return the mechanism list (server).
QCA::SASL::Error
Error
Possible errors that may occur when using SASL.
Definition qca_securelayer.h:839
QCA::SASL::ErrorInit
@ ErrorInit
problem starting up SASL
Definition qca_securelayer.h:840
QCA::SASL::ErrorCrypt
@ ErrorCrypt
problem at anytime after
Definition qca_securelayer.h:842
QCA::SASL::ErrorHandshake
@ ErrorHandshake
problem during the authentication process
Definition qca_securelayer.h:841
QCA::SASL::ssf
int ssf() const
Return the security strength factor of the connection.
QCA::SASL::setRemoteAddress
void setRemoteAddress(const QString &addr, quint16 port)
Specify the peer address.
QCA::SASL::setConstraints
void setConstraints(AuthFlags f, int minSSF, int maxSSF)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCA::SASL::putServerFirstStep
void putServerFirstStep(const QString &mech, const QByteArray &clientInit)
Process the first step in server mode (server).
QCA::SASL::setRealm
void setRealm(const QString &realm)
Specify the realm to use in authentication.
QCA::SASL::reset
void reset()
Reset the SASL mechanism.
QCA::SASL::bytesAvailable
int bytesAvailable() const override
Returns the number of bytes available to be read() on the application side.
QCA::SASL::authCondition
AuthCondition authCondition() const
Return the reason for authentication failure.
QCA::SASL::authenticated
void authenticated()
This signal is emitted when authentication is complete.
QCA::SASL::setLocalAddress
void setLocalAddress(const QString &addr, quint16 port)
Specify the local address.
QCA::SASL::readOutgoing
QByteArray readOutgoing(int *plainBytes=nullptr) override
This method provides encoded (typically encrypted) data.
QCA::SASL::putStep
void putStep(const QByteArray &stepData)
Process an authentication step.
QCA::SASL::AuthFlags
AuthFlags
Authentication requirement flag values.
Definition qca_securelayer.h:868
QCA::SecureArray
Secure array of bytes.
Definition qca_tools.h:317
QCA::SecureLayer::write
virtual void write(const QByteArray &a)=0
This method writes unencrypted (plain) data to the SecureLayer implementation.
QCA::SecureLayer::convertBytesWritten
virtual int convertBytesWritten(qint64 encryptedBytes)=0
Convert encrypted bytes written to plain text bytes written.
QCA::SecureLayer::readUnprocessed
virtual QByteArray readUnprocessed()
This allows you to read data without having it decrypted first.
QCA::SecureLayer::SecureLayer
SecureLayer(QObject *parent=nullptr)
Constructor for an abstract secure communications layer.
QCA::SecureLayer::writeIncoming
virtual void writeIncoming(const QByteArray &a)=0
This method accepts encoded (typically encrypted) data for processing.
QCA::SecureLayer::bytesAvailable
virtual int bytesAvailable() const =0
Returns the number of bytes available to be read() on the application side.
QCA::SecureLayer::readOutgoing
virtual QByteArray readOutgoing(int *plainBytes=nullptr)=0
This method provides encoded (typically encrypted) data.
QCA::SecureLayer::error
void error()
This signal is emitted when an error is detected.
QCA::SecureLayer::close
virtual void close()
Close the link.
QCA::SecureLayer::readyReadOutgoing
void readyReadOutgoing()
This signal is emitted when SecureLayer has encrypted (network side) data ready to be read.
QCA::SecureLayer::read
virtual QByteArray read()=0
This method reads decrypted (plain) data from the SecureLayer implementation.
QCA::SecureLayer::closed
void closed()
This signal is emitted when the SecureLayer connection is closed.
QCA::SecureLayer::isClosable
virtual bool isClosable() const
Returns true if the layer has a meaningful "close".
QCA::SecureLayer::bytesOutgoingAvailable
virtual int bytesOutgoingAvailable() const =0
Returns the number of bytes available to be readOutgoing() on the network side.
QCA::SecureLayer::readyRead
void readyRead()
This signal is emitted when SecureLayer has decrypted (application side) data ready to be read.
QCA::TLSSession
Session token, used for TLS resuming.
Definition qca_securelayer.h:239
QCA::TLSSession::operator=
TLSSession & operator=(const TLSSession &from)
Assignment operator.
QCA::TLSSession::TLSSession
TLSSession(const TLSSession &from)
Copy constructor.
QCA::TLSSession::isNull
bool isNull() const
Test if the session token is valid.
QCA::TLS::setConstraints
void setConstraints(SecurityLevel s)
The security level required for this link.
QCA::TLS::packetsOutgoingAvailable
int packetsOutgoingAvailable() const
Determine the number of packets available to be read on the network side.
QCA::TLS::setPacketMTU
void setPacketMTU(int size) const
Set the maximum packet size to use.
QCA::TLS::TLS
TLS(Mode mode, QObject *parent=nullptr, const QString &provider=QString())
Constructor for Transport Layer Security connection.
QCA::TLS::cipherMaxBits
int cipherMaxBits() const
The number of bits of security that the cipher could use.
QCA::TLS::write
void write(const QByteArray &a) override
This method writes unencrypted (plain) data to the SecureLayer implementation.
QCA::TLS::startClient
void startClient(const QString &host=QString())
Start the TLS/SSL connection as a client.
QCA::TLS::version
Version version() const
The protocol version that is in use for this connection.
QCA::TLS::writeIncoming
void writeIncoming(const QByteArray &a) override
This method accepts encoded (typically encrypted) data for processing.
QCA::TLS::Mode
Mode
Operating mode.
Definition qca_securelayer.h:297
QCA::TLS::Stream
@ Stream
stream mode
Definition qca_securelayer.h:298
QCA::TLS::Datagram
@ Datagram
datagram mode
Definition qca_securelayer.h:299
QCA::TLS::setConstraints
void setConstraints(int minSSF, int maxSSF)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCA::TLS::continueAfterStep
void continueAfterStep()
Resumes TLS processing.
QCA::TLS::localPrivateKey
PrivateKey localPrivateKey() const
The PrivateKey for the local host certificate.
QCA::TLS::hostNameReceived
void hostNameReceived()
Emitted if a host name is set by the client.
QCA::TLS::cipherBits
int cipherBits() const
The number of effective bits of security being used for this connection.
QCA::TLS::bytesOutgoingAvailable
int bytesOutgoingAvailable() const override
Returns the number of bytes available to be readOutgoing() on the network side.
QCA::TLS::~TLS
~TLS() override
Destructor.
QCA::TLS::hostName
QString hostName() const
Returns the host name specified or an empty string if no host name is specified.
QCA::TLS::session
TLSSession session() const
The session object of the TLS connection, which can be used for resuming.
QCA::TLS::Error
Error
Type of error.
Definition qca_securelayer.h:317
QCA::TLS::ErrorHandshake
@ ErrorHandshake
problem during the negotiation
Definition qca_securelayer.h:322
QCA::TLS::ErrorCertKeyMismatch
@ ErrorCertKeyMismatch
certificate and private key don't match
Definition qca_securelayer.h:320
QCA::TLS::ErrorSignerExpired
@ ErrorSignerExpired
local certificate is expired
Definition qca_securelayer.h:318
QCA::TLS::ErrorSignerInvalid
@ ErrorSignerInvalid
local certificate is invalid in some way
Definition qca_securelayer.h:319
QCA::TLS::ErrorInit
@ ErrorInit
problem starting up TLS
Definition qca_securelayer.h:321
QCA::TLS::ErrorCrypt
@ ErrorCrypt
problem at anytime after
Definition qca_securelayer.h:323
QCA::TLS::setTrustedCertificates
void setTrustedCertificates(const CertificateCollection &trusted)
Set up the set of trusted certificates that will be used to verify that the certificate provided is v...
QCA::TLS::reset
void reset()
Reset the connection.
QCA::TLS::isClosable
bool isClosable() const override
Returns true if the layer has a meaningful "close".
QCA::TLS::startServer
void startServer()
Start the TLS/SSL connection as a server.
QCA::TLS::setConstraints
void setConstraints(const QStringList &cipherSuiteList)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCA::TLS::supportedCipherSuites
QStringList supportedCipherSuites(const Version &version=TLS_v1) const
Get the list of cipher suites that are available for use.
QCA::TLS::issuerList
QList< CertificateInfoOrdered > issuerList() const
Retrieve the list of allowed issuers by the server, if the server has provided them.
QCA::TLS::trustedCertificates
CertificateCollection trustedCertificates() const
Return the trusted certificates set for this object.
QCA::TLS::peerIdentityResult
IdentityResult peerIdentityResult() const
After the SSL/TLS handshake is complete, this method allows you to determine if the other end of the ...
QCA::TLS::readOutgoing
QByteArray readOutgoing(int *plainBytes=nullptr) override
This method provides encoded (typically encrypted) data.
QCA::TLS::IdentityResult
IdentityResult
Type of identity.
Definition qca_securelayer.h:330
QCA::TLS::HostMismatch
@ HostMismatch
valid cert provided, but wrong owner
Definition qca_securelayer.h:332
QCA::TLS::InvalidCertificate
@ InvalidCertificate
invalid cert
Definition qca_securelayer.h:333
QCA::TLS::Valid
@ Valid
identity is verified
Definition qca_securelayer.h:331
QCA::TLS::NoCertificate
@ NoCertificate
identity unknown
Definition qca_securelayer.h:334
QCA::TLS::TLS
TLS(QObject *parent=nullptr, const QString &provider=QString())
Constructor for Transport Layer Security connection.
QCA::TLS::canSetHostName
bool canSetHostName() const
Test if the link can specify a hostname (Server Name Indication).
QCA::TLS::close
void close() override
Close the link.
QCA::TLS::read
QByteArray read() override
This method reads decrypted (plain) data from the SecureLayer implementation.
QCA::TLS::connectNotify
void connectNotify(const QMetaMethod &signal) override
Called when a connection is made to a particular signal.
QCA::TLS::isHandshaken
bool isHandshaken() const
test if the handshake is complete
QCA::TLS::packetsAvailable
int packetsAvailable() const
Determine the number of packets available to be read on the application side.
QCA::TLS::peerCertificateValidity
Validity peerCertificateValidity() const
After the SSL/TLS handshake is valid, this method allows you to check if the received certificate fro...
QCA::TLS::readUnprocessed
QByteArray readUnprocessed() override
This allows you to read data without having it decrypted first.
QCA::TLS::Version
Version
Version of TLS or SSL.
Definition qca_securelayer.h:306
QCA::TLS::SSL_v2
@ SSL_v2
Secure Socket Layer, version 2.
Definition qca_securelayer.h:309
QCA::TLS::DTLS_v1
@ DTLS_v1
Datagram Transport Layer Security, version 1.
Definition qca_securelayer.h:310
QCA::TLS::TLS_v1
@ TLS_v1
Transport Layer Security, version 1.
Definition qca_securelayer.h:307
QCA::TLS::SSL_v3
@ SSL_v3
Secure Socket Layer, version 3.
Definition qca_securelayer.h:308
QCA::TLS::packetMTU
int packetMTU() const
Return the currently configured maximum packet size.
QCA::TLS::errorCode
Error errorCode() const
This method returns the type of error that has occurred.
QCA::TLS::compressionEnabled
bool compressionEnabled() const
Returns true if compression is enabled.
QCA::TLS::canCompress
bool canCompress() const
Test if the link can use compression.
QCA::TLS::convertBytesWritten
int convertBytesWritten(qint64 encryptedBytes) override
Convert encrypted bytes written to plain text bytes written.
QCA::TLS::peerCertificateChain
CertificateChain peerCertificateChain() const
The CertificateChain from the peer (other end of the connection to the trusted root certificate).
QCA::TLS::bytesAvailable
int bytesAvailable() const override
Returns the number of bytes available to be read() on the application side.
QCA::TLS::peerCertificateAvailable
void peerCertificateAvailable()
Emitted when a certificate is received from the peer.
QCA::TLS::cipherSuite
QString cipherSuite() const
The cipher suite that has been negotiated for this connection.
QCA::TLS::setCertificate
void setCertificate(const CertificateChain &cert, const PrivateKey &key)
The local certificate to use.
QCA::TLS::isCompressed
bool isCompressed() const
test if the link is compressed
QCA::TLS::handshaken
void handshaken()
Emitted when the protocol handshake is complete.
QCA::TLS::disconnectNotify
void disconnectNotify(const QMetaMethod &signal) override
Called when a connection is removed from a particular signal.
QCA::TLS::setIssuerList
void setIssuerList(const QList< CertificateInfoOrdered > &issuers)
Sets the issuer list to present to the client.
QCA::TLS::setSession
void setSession(const TLSSession &session)
Resume a TLS session using the given session object.
QCA::TLS::certificateRequested
void certificateRequested()
Emitted when the server requests a certificate.
QCA::TLS::setCertificate
void setCertificate(const KeyBundle &kb)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QCA::TLS::localCertificateChain
CertificateChain localCertificateChain() const
The CertificateChain for the local host certificate.
QCA::TLS::setCompressionEnabled
void setCompressionEnabled(bool b)
Set the link to use compression.
QList
QObject
QCA
QCA - the Qt Cryptographic Architecture.
Definition qca_basic.h:41
QCA::Validity
Validity
The validity (or otherwise) of a certificate.
Definition qca_cert.h:497
QCA::SecurityLevel
SecurityLevel
Specify the lower-bound for acceptable TLS/SASL security layers.
Definition qca_securelayer.h:60
QCA::SL_Baseline
@ SL_Baseline
must be 128 bit or more
Definition qca_securelayer.h:64
QCA::SL_Integrity
@ SL_Integrity
must at least get integrity protection
Definition qca_securelayer.h:62
QCA::SL_High
@ SL_High
must be more than 128 bit
Definition qca_securelayer.h:65
QCA::SL_Export
@ SL_Export
must be export level bits or more
Definition qca_securelayer.h:63
QCA::SL_Highest
@ SL_Highest
SL_High or max possible, whichever is greater.
Definition qca_securelayer.h:66
QCA::SL_None
@ SL_None
indicates that no security is ok
Definition qca_securelayer.h:61
qca_cert.h
Header file for PGP key and X.509 certificate related classes.
qca_core.h
Header file for core QCA infrastructure.
qca_publickey.h
Header file for PublicKey and PrivateKey related classes.