2
* tlshandler.cpp - abstract wrapper for TLS
3
* Copyright (C) 2003 Justin Karneges
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
//----------------------------------------------------------------------------
30
//----------------------------------------------------------------------------
31
TLSHandler::TLSHandler(QObject *parent)
36
TLSHandler::~TLSHandler()
41
//----------------------------------------------------------------------------
43
//----------------------------------------------------------------------------
44
class QCATLSHandler::Private
51
QCATLSHandler::QCATLSHandler(QCA::TLS *parent)
56
connect(d->tls, SIGNAL(handshaken()), SLOT(tls_handshaken()));
57
connect(d->tls, SIGNAL(readyRead()), SLOT(tls_readyRead()));
58
connect(d->tls, SIGNAL(readyReadOutgoing(int)), SLOT(tls_readyReadOutgoing(int)));
59
connect(d->tls, SIGNAL(closed()), SLOT(tls_closed()));
60
connect(d->tls, SIGNAL(error(int)), SLOT(tls_error(int)));
65
QCATLSHandler::~QCATLSHandler()
70
QCA::TLS *QCATLSHandler::tls() const
75
int QCATLSHandler::tlsError() const
80
void QCATLSHandler::reset()
86
void QCATLSHandler::startClient(const QString &host)
90
if(!d->tls->startClient(host))
91
QTimer::singleShot(0, this, SIGNAL(fail()));
94
void QCATLSHandler::write(const QByteArray &a)
99
void QCATLSHandler::writeIncoming(const QByteArray &a)
101
d->tls->writeIncoming(a);
104
void QCATLSHandler::continueAfterHandshake()
112
void QCATLSHandler::tls_handshaken()
118
void QCATLSHandler::tls_readyRead()
120
readyRead(d->tls->read());
123
void QCATLSHandler::tls_readyReadOutgoing(int plainBytes)
125
readyReadOutgoing(d->tls->readOutgoing(), plainBytes);
128
void QCATLSHandler::tls_closed()
133
void QCATLSHandler::tls_error(int x)