File indexing completed on 2023-05-30 09:18:40
0001 /* This file is part of the KDE project 0002 * 0003 * Copyright (C) 2000-2003 George Staikos <staikos@kde.org> 0004 * Copyright (C) 2000 Malte Starostik <malte@kde.org> 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Library General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Library General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Library General Public License 0017 * along with this library; see the file COPYING.LIB. If not, write to 0018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0019 * Boston, MA 02110-1301, USA. 0020 */ 0021 0022 #ifndef _KSSLINFODIALOG_H 0023 #define _KSSLINFODIALOG_H 0024 0025 #include <kssl.h> 0026 #include <kdialog.h> 0027 0028 #include "ktcpsocket.h" 0029 0030 /** 0031 * KDE SSL Information Dialog 0032 * 0033 * This class creates a dialog that can be used to display information about 0034 * an SSL session. 0035 * 0036 * There are NO GUARANTEES that KSslInfoDialog will remain binary compatible/ 0037 * Contact staikos@kde.org for details if needed. 0038 * 0039 * @author George Staikos <staikos@kde.org> 0040 * @see KSSL 0041 * @short KDE SSL Information Dialog 0042 */ 0043 class KIO_EXPORT KSslInfoDialog : public QDialog { 0044 Q_OBJECT 0045 public: 0046 /** 0047 * Construct a KSSL Information Dialog 0048 * 0049 * @param parent the parent widget 0050 */ 0051 explicit KSslInfoDialog(QWidget *parent = 0); 0052 0053 /** 0054 * Destroy this dialog 0055 */ 0056 virtual ~KSslInfoDialog(); 0057 0058 /** 0059 * Tell the dialog if the connection has portions that may not be 0060 * secure (ie. a mixture of secure and insecure frames) 0061 * 0062 * @param isIt true if security is in question 0063 */ 0064 void setSecurityInQuestion(bool isIt); 0065 0066 /** 0067 * Set information to display about the SSL connection. 0068 * 0069 * @param certificateChain the certificate chain leading from the certificate 0070 * authority to the peer. 0071 * @param ip the ip of the remote host 0072 * @param host the remote hostname 0073 * @param sslProtocol the version of SSL in use (SSLv2, SSLv3, TLSv1) 0074 * @param cipher the cipher in use 0075 * @param usedBits the used bits of the key 0076 * @param bits the key size of the cipher in use 0077 * @param validationErrors errors validating the certificates, if any 0078 */ 0079 void setSslInfo(const QList<QSslCertificate> &certificateChain, 0080 const QString &ip, const QString &host, 0081 const QString &sslProtocol, const QString &cipher, 0082 int usedBits, int bits, 0083 const QList<QList<KSslError::Error> > &validationErrors); 0084 0085 void setMainPartEncrypted(bool); 0086 void setAuxiliaryPartsEncrypted(bool); 0087 0088 static QList<QList<KSslError::Error> > errorsFromString(const QString &s); 0089 0090 private: 0091 void updateWhichPartsEncrypted(); 0092 0093 class KSslInfoDialogPrivate; 0094 KSslInfoDialogPrivate* const d; 0095 0096 private Q_SLOTS: 0097 void launchConfig(); 0098 void displayFromChain(int); 0099 }; 0100 0101 #endif