QCA::TLSContext
Search for usage in LXR
#include <QtCrypto>
TLS provider
- Note
- This class is part of the provider plugin interface and should not be used directly by applications. You probably want TLS instead.
Definition at line 2239 of file qcaprovider.h.
◆ Result
Result of a TLS operation.
Enumerator |
---|
Success | Operation completed.
|
Error | Operation failed.
|
Continue | More data needed to complete operation.
|
Definition at line 2293 of file qcaprovider.h.
◆ TLSContext()
Standard constructor.
- Parameters
-
p | the Provider associated with this context |
type | the name of the type of feature that supported by this context |
Definition at line 2306 of file qcaprovider.h.
◆ canCompress()
virtual bool QCA::TLSContext::canCompress |
( |
| ) |
const |
|
pure virtual |
Returns true if the provider supports compression.
◆ canSetHostName()
virtual bool QCA::TLSContext::canSetHostName |
( |
| ) |
const |
|
pure virtual |
Returns true if the provider supports server name indication.
◆ certificateRequested()
virtual bool QCA::TLSContext::certificateRequested |
( |
| ) |
const |
|
pure virtual |
Returns true if the peer is requesting a certificate.
This is only valid if a handshake is in progress or completed.
◆ clientHelloReceived()
virtual bool QCA::TLSContext::clientHelloReceived |
( |
| ) |
const |
|
pure virtual |
Returns true if the TLS client hello has been received.
This is only valid if a handshake is in progress or completed.
◆ dtlsTimeout
void QCA::TLSContext::dtlsTimeout |
( |
| ) |
|
|
signal |
Emit this to force the application to call update(), even with empty arguments.
◆ encoded()
virtual int QCA::TLSContext::encoded |
( |
| ) |
const |
|
pure virtual |
Returns the number of bytes of plaintext data that is encoded inside of to_net()
◆ eof()
virtual bool QCA::TLSContext::eof |
( |
| ) |
const |
|
pure virtual |
Returns true if the peer has closed the stream.
◆ hostName()
virtual QString QCA::TLSContext::hostName |
( |
| ) |
const |
|
pure virtual |
Returns the host name sent by the client using server name indication (server mode only)
This is only valid if a handshake is in progress or completed.
◆ issuerList()
Returns the issuer list sent by the server (client mode only)
This is only valid if a handshake is in progress or completed.
◆ maxSSF()
virtual int QCA::TLSContext::maxSSF |
( |
| ) |
const |
|
pure virtual |
Returns the maximum SSF supported by this provider.
◆ peerCertificateChain()
Returns the peer certificate chain.
This is only valid if a handshake is completed.
◆ peerCertificateValidity()
virtual Validity QCA::TLSContext::peerCertificateValidity |
( |
| ) |
const |
|
pure virtual |
Returns the QCA::Validity of the peer certificate.
This is only valid if a handshake is completed.
◆ reset()
virtual void QCA::TLSContext::reset |
( |
| ) |
|
|
pure virtual |
Reset the object to its initial state.
◆ result()
virtual Result QCA::TLSContext::result |
( |
| ) |
const |
|
pure virtual |
Returns the result code of an operation.
◆ resultsReady
void QCA::TLSContext::resultsReady |
( |
| ) |
|
|
signal |
◆ serverHelloReceived()
virtual bool QCA::TLSContext::serverHelloReceived |
( |
| ) |
const |
|
pure virtual |
Returns true if the TLS server hello has been received.
This is only valid if a handshake is in progress or completed.
◆ sessionInfo()
virtual SessionInfo QCA::TLSContext::sessionInfo |
( |
| ) |
const |
|
pure virtual |
Returns information about the active TLS session.
This is only valid if a handshake is completed.
◆ setCertificate()
Set the local certificate.
This function may be called at any time.
- Parameters
-
cert | the certificate and associated trust chain |
key | the private key for the local certificate |
◆ setConstraints() [1/2]
virtual void QCA::TLSContext::setConstraints |
( |
const QStringList & |
cipherSuiteList | ) |
|
|
pure virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Set the constraints of the session using a cipher suite list.
This function will be called before start().
- Parameters
-
cipherSuiteList | the list of cipher suites that may be used for this session. |
- See also
- supportedCipherSuites
◆ setConstraints() [2/2]
virtual void QCA::TLSContext::setConstraints |
( |
int |
minSSF, |
|
|
int |
maxSSF |
|
) |
| |
|
pure virtual |
Set the constraints of the session using SSF values.
This function will be called before start().
- Parameters
-
minSSF | the minimum strength factor that is acceptable |
maxSSF | the maximum strength factor that is acceptable |
◆ setIssuerList()
Set the list of acceptable issuers.
This function may be called at any time.
This function is for server mode only.
- Parameters
-
issuerList | the list of issuers that may be used |
◆ setMTU()
virtual void QCA::TLSContext::setMTU |
( |
int |
size | ) |
|
|
virtual |
Set the maximum transmission unit size.
This function is for DTLS only.
- Parameters
-
size | the maximum number of bytes in a datagram |
◆ setSessionId()
Set the TLS session id, for session resuming.
This function will be called before start().
- Parameters
-
id | the session identification |
◆ setTrustedCertificates()
Set the list of trusted certificates.
This function may be called at any time.
- Parameters
-
trusted | the trusted certificates and CRLs to be used. |
◆ setup()
virtual void QCA::TLSContext::setup |
( |
bool |
serverMode, |
|
|
const QString & |
hostName, |
|
|
bool |
compress |
|
) |
| |
|
pure virtual |
Configure a new session.
This function will be called before any other configuration functions.
- Parameters
-
serverMode | whether to operate as a server (true) or client (false) |
hostName | the hostname to use |
compress | whether to compress (true) or not (false) |
◆ shutdown()
virtual void QCA::TLSContext::shutdown |
( |
| ) |
|
|
pure virtual |
Sets the session to the shutdown state.
The actual shutdown operation will happen at a future call to update().
This function is for normal TLS only (not DTLS).
◆ start()
virtual void QCA::TLSContext::start |
( |
| ) |
|
|
pure virtual |
Begins the session, starting with the handshake.
This function returns immediately, and completion is signaled with the resultsReady() signal.
On completion, the result() function will return Success if the TLS session is able to begin, or Error if there is a failure to initialize the TLS subsystem. If successful, the session is now in the handshake state, and update() will be called repeatedly until the session ends.
◆ supportedCipherSuites()
Returns a list of supported cipher suites for the specified SSL/TLS version.
The cipher suites are specified as strings, for example: "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA" (without quotes).
- Parameters
-
version | the version of TLS to search for |
◆ to_app()
Returns data that is decoded from the network and should be processed by the application.
◆ to_net()
Returns data that should be sent across the network.
◆ unprocessed()
virtual QByteArray QCA::TLSContext::unprocessed |
( |
| ) |
|
|
pure virtual |
Returns any unprocessed network input data.
This is only valid after a successful shutdown.
◆ update()
Performs one iteration of the TLS session processing.
This function returns immediately, and completion is signaled with the resultsReady() signal.
If the session is in a handshake state, result() and to_net() will be valid. If result() is Success, then the session is now in the connected state.
If the session is in a shutdown state, result() and to_net() will be valid. If result() is Success, then the session has ended.
If the session is in a connected state, result(), to_net(), encoded(), to_app(), and eof() are valid. The result() function will return Success or Error. Note that eof() does not apply to DTLS.
For DTLS, this function operates with single packets. Many update() operations must be performed repeatedly to exchange multiple packets.
- Parameters
-
from_net | the data from the "other side" of the connection |
from_app | the data from the application of the protocol |
◆ waitForResultsReady()
virtual bool QCA::TLSContext::waitForResultsReady |
( |
int |
msecs | ) |
|
|
pure virtual |
Waits for a start() 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) |
The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:50:45 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.