KIO

ksslinfodialog.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 2000-2003 George Staikos <[email protected]>
4  SPDX-FileCopyrightText: 2000 Malte Starostik <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef _KSSLINFODIALOG_H
10 #define _KSSLINFODIALOG_H
11 
12 #include <QDialog>
13 #include <QSslError>
14 
15 #include "kiowidgets_export.h"
16 #include "ktcpsocket.h" // TODO KF6 remove this include
17 
18 #include <memory>
19 
20 /**
21  * KDE SSL Information Dialog
22  *
23  * This class creates a dialog that can be used to display information about
24  * an SSL session.
25  *
26  * There are NO GUARANTEES that KSslInfoDialog will remain binary compatible/
27  * Contact [email protected] for details if needed.
28  *
29  * @author George Staikos <[email protected]>
30  * @see KSSL
31  * @short KDE SSL Information Dialog
32  */
33 class KIOWIDGETS_EXPORT KSslInfoDialog : public QDialog
34 {
35  Q_OBJECT
36 public:
37  /**
38  * Construct a KSSL Information Dialog
39  *
40  * @param parent the parent widget
41  */
42  explicit KSslInfoDialog(QWidget *parent = nullptr);
43 
44  /**
45  * Destroy this dialog
46  */
47  ~KSslInfoDialog() override;
48 
49 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64)
50  /**
51  * Set information to display about the SSL connection.
52  *
53  * @param certificateChain the certificate chain leading from the certificate
54  * authority to the peer.
55  * @param ip the ip of the remote host
56  * @param host the remote hostname
57  * @param sslProtocol the version of SSL in use (SSLv2, SSLv3, TLSv1)
58  * @param cipher the cipher in use
59  * @param usedBits the used bits of the key
60  * @param bits the key size of the cipher in use
61  * @param validationErrors errors validating the certificates, if any
62  * @deprecated since 5.64, use the QSslError variant
63  */
64  KIOCORE_DEPRECATED_VERSION(5, 64, "use the QSslError variant")
65  void setSslInfo(const QList<QSslCertificate> &certificateChain,
66  const QString &ip,
67  const QString &host,
68  const QString &sslProtocol,
69  const QString &cipher,
70  int usedBits,
71  int bits,
72  const QList<QList<KSslError::Error>> &validationErrors); // TODO KF6 remove
73 #endif
74 
75  /**
76  * Set information to display about the SSL connection.
77  *
78  * @param certificateChain the certificate chain leading from the certificate
79  * authority to the peer.
80  * @param ip the ip of the remote host
81  * @param host the remote hostname
82  * @param sslProtocol the version of SSL in use (SSLv2, SSLv3, TLSv1)
83  * @param cipher the cipher in use
84  * @param usedBits the used bits of the key
85  * @param bits the key size of the cipher in use
86  * @param validationErrors errors validating the certificates, if any
87  * @since 5.64
88  */
89  void setSslInfo(const QList<QSslCertificate> &certificateChain,
90  const QString &ip,
91  const QString &host,
92  const QString &sslProtocol,
93  const QString &cipher,
94  int usedBits,
95  int bits,
96  const QList<QList<QSslError::SslError>> &validationErrors);
97 
98  void setMainPartEncrypted(bool);
99  void setAuxiliaryPartsEncrypted(bool);
100 
101 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 65)
102  /** @deprecated since 5.65, use certificateErrorsFromString */
103  KIOCORE_DEPRECATED_VERSION(5, 65, "use the QSslError variant")
104  static QList<QList<KSslError::Error>> errorsFromString(const QString &s); // TODO KF6 remove
105 #endif
106  /**
107  * Converts certificate errors as provided in the "ssl_cert_errors" meta data
108  * to a list of QSslError::SslError values per certificate in the certificate chain.
109  * @since 5.65
110  */
111  static QList<QList<QSslError::SslError>> certificateErrorsFromString(const QString &errorsString);
112 
113 private:
114  KIOWIDGETS_NO_EXPORT void updateWhichPartsEncrypted();
115 
116  class KSslInfoDialogPrivate;
117  std::unique_ptr<KSslInfoDialogPrivate> const d;
118 
119 private Q_SLOTS:
120  KIOWIDGETS_NO_EXPORT void displayFromChain(int);
121 };
122 
123 #endif
Q_SLOTSQ_SLOTS
KDE SSL Information Dialog.
ScriptableExtension * host() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:54:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.