#include <QtCrypto>
Inheritance diagram for QCA::TLSContext:


Public Types | |
| enum | Result { Success, Error, Continue } |
Signals | |
| void | resultsReady () |
| void | dtlsTimeout () |
Public Member Functions | |
| TLSContext (Provider *p, const QString &type) | |
| virtual void | reset ()=0 |
| virtual QStringList | supportedCipherSuites (const TLS::Version &version) const=0 |
| virtual bool | canCompress () const=0 |
| virtual bool | canSetHostName () const=0 |
| virtual int | maxSSF () const=0 |
| virtual void | setup (bool serverMode, const QString &hostName, bool compress)=0 |
| virtual void | setConstraints (int minSSF, int maxSSF)=0 |
| virtual void | setConstraints (const QStringList &cipherSuiteList)=0 |
| virtual void | setTrustedCertificates (const CertificateCollection &trusted)=0 |
| virtual void | setIssuerList (const QList< CertificateInfoOrdered > &issuerList)=0 |
| virtual void | setCertificate (const CertificateChain &cert, const PrivateKey &key)=0 |
| virtual void | setSessionId (const TLSSessionContext &id)=0 |
| virtual void | shutdown ()=0 |
| virtual void | setMTU (int size) |
| virtual void | start ()=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 QByteArray | to_net ()=0 |
| virtual int | encoded () const=0 |
| virtual QByteArray | to_app ()=0 |
| virtual bool | eof () const=0 |
| virtual bool | clientHelloReceived () const=0 |
| virtual bool | serverHelloReceived () const=0 |
| virtual QString | hostName () const=0 |
| virtual bool | certificateRequested () const=0 |
| virtual QList< CertificateInfoOrdered > | issuerList () const=0 |
| virtual Validity | peerCertificateValidity () const=0 |
| virtual CertificateChain | peerCertificateChain () const=0 |
| virtual SessionInfo | sessionInfo () const=0 |
| virtual QByteArray | unprocessed ()=0 |
Classes | |
| class | SessionInfo |
| Information about an active TLS connection. More... | |
Result of a TLS operation.
| virtual void QCA::TLSContext::reset | ( | ) | [pure virtual] |
Reset the object to its initial state.
| virtual QStringList QCA::TLSContext::supportedCipherSuites | ( | const TLS::Version & | version | ) | const [pure virtual] |
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).
| virtual bool QCA::TLSContext::canCompress | ( | ) | const [pure virtual] |
Returns true if the provider supports compression.
| virtual bool QCA::TLSContext::canSetHostName | ( | ) | const [pure virtual] |
Returns true if the provider supports server name indication.
| virtual int QCA::TLSContext::maxSSF | ( | ) | const [pure virtual] |
Returns the maximum SSF supported by this provider.
| 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.
| 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().
| 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().
| virtual void QCA::TLSContext::setTrustedCertificates | ( | const CertificateCollection & | trusted | ) | [pure virtual] |
Set the list of trusted certificates.
This function may be called at any time.
| virtual void QCA::TLSContext::setIssuerList | ( | const QList< CertificateInfoOrdered > & | issuerList | ) | [pure virtual] |
Set the list of acceptable issuers.
This function may be called at any time.
This function is for server mode only.
| virtual void QCA::TLSContext::setCertificate | ( | const CertificateChain & | cert, | |
| const PrivateKey & | key | |||
| ) | [pure virtual] |
Set the local certificate.
This function may be called at any time.
| virtual void QCA::TLSContext::setSessionId | ( | const TLSSessionContext & | id | ) | [pure virtual] |
| virtual void QCA::TLSContext::shutdown | ( | ) | [pure virtual] |
| virtual void QCA::TLSContext::setMTU | ( | int | size | ) | [virtual] |
Set the maximum transmission unit size.
This function is for DTLS only.
| 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.
| virtual void QCA::TLSContext::update | ( | const QByteArray & | from_net, | |
| const QByteArray & | from_app | |||
| ) | [pure virtual] |
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.
| 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.
| msecs | number of milliseconds to wait (-1 to wait forever) |
| virtual Result QCA::TLSContext::result | ( | ) | const [pure virtual] |
Returns the result code of an operation.
| virtual QByteArray QCA::TLSContext::to_net | ( | ) | [pure virtual] |
Returns data that should be sent across the network.
| virtual int QCA::TLSContext::encoded | ( | ) | const [pure virtual] |
Returns the number of bytes of plaintext data that is encoded inside of to_net().
| virtual QByteArray QCA::TLSContext::to_app | ( | ) | [pure virtual] |
Returns data that is decoded from the network and should be processed by the application.
| virtual bool QCA::TLSContext::eof | ( | ) | const [pure virtual] |
Returns true if the peer has closed the stream.
| 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.
| 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.
| 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.
| 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.
| virtual QList<CertificateInfoOrdered> QCA::TLSContext::issuerList | ( | ) | const [pure virtual] |
Returns the issuer list sent by the server (client mode only).
This is only valid if a handshake is in progress or completed.
| 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.
| virtual CertificateChain QCA::TLSContext::peerCertificateChain | ( | ) | const [pure virtual] |
Returns the peer certificate chain.
This is only valid if a handshake is completed.
| virtual SessionInfo QCA::TLSContext::sessionInfo | ( | ) | const [pure virtual] |
Returns information about the active TLS session.
This is only valid if a handshake is completed.
| virtual QByteArray QCA::TLSContext::unprocessed | ( | ) | [pure virtual] |
Returns any unprocessed network input data.
This is only valid after a successful shutdown.
| void QCA::TLSContext::resultsReady | ( | ) | [signal] |
| void QCA::TLSContext::dtlsTimeout | ( | ) | [signal] |
Emit this to force the application to call update(), even with empty arguments.
1.5.2