Public Member Functions
|virtual int||bytesAvailable () const =0|
|virtual int||bytesOutgoingAvailable () const =0|
|virtual void||close ()|
|virtual int||convertBytesWritten (qint64 encryptedBytes)=0|
|virtual bool||isClosable () const|
|virtual QByteArray||read ()=0|
|virtual QByteArray||readOutgoing (int *plainBytes=0)=0|
|virtual QByteArray||readUnprocessed ()|
|SecureLayer (QObject *parent=0)|
|virtual void||write (const QByteArray &a)=0|
|virtual void||writeIncoming (const QByteArray &a)=0|
SecureLayer is normally used between an application and a potentially insecure network. It provides secure communications over that network.
The concept is that (after some initial setup), the application can write() some data to the SecureLayer implementation, and that data is encrypted (or otherwise protected, depending on the setup). The SecureLayer implementation then emits the readyReadOutgoing() signal, and the application uses readOutgoing() to retrieve the the encrypted data from the SecureLayer implementation. The encrypted data is then sent out on the network.
When some encrypted data comes back from the network, the application does a writeIncoming() to the SecureLayer implementation. Some time later, the SecureLayer implementation may emit readyRead() to the application, which then read()s the decrypted data from the SecureLayer implementation.
Note that sometimes data is sent or received between the SecureLayer implementation and the network without any data being sent between the application and the SecureLayer implementation. This is a result of the initial negotiation activities (which require network traffic to agree a configuration to use) and other overheads associated with the secure link.
|QCA::SecureLayer::SecureLayer||(||QObject *|| parent =
Constructor for an abstract secure communications layer.
|parent||the parent object for this object|
|virtual int QCA::SecureLayer::bytesAvailable||(||)|| const
|virtual int QCA::SecureLayer::bytesOutgoingAvailable||(||)|| const
|virtual void QCA::SecureLayer::close||(||)||
This signal is emitted when the SecureLayer connection is closed.
|virtual int QCA::SecureLayer::convertBytesWritten||(||qint64||encryptedBytes||)||
This signal is emitted when an error is detected.
You can determine the error type using errorCode().
|virtual bool QCA::SecureLayer::isClosable||(||)|| const
Returns true if the layer has a meaningful "close".
Reimplemented in QCA::TLS.
|virtual QByteArray QCA::SecureLayer::read||(||)||
|virtual QByteArray QCA::SecureLayer::readOutgoing||(||int *|| plainBytes =
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.
|plainBytes||the number of bytes that were read.|
|virtual QByteArray QCA::SecureLayer::readUnprocessed||(||)||
This allows you to read data without having it decrypted first.
This is intended to be used for protocols that close off the connection and return to plain text transfer. You do not normally need to use this function.
Reimplemented in QCA::TLS.
|virtual void QCA::SecureLayer::write||(||const QByteArray &||a||)||
|virtual void QCA::SecureLayer::writeIncoming||(||const QByteArray &||a||)||
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.
|a||the ByteArray to take network-side data from|