File indexing completed on 2024-05-19 05:01:24

0001 /*
0002     This file is part of the KDE project.
0003 
0004     SPDX-FileCopyrightText: 2009 Dawit Alemayehu <adawit@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 #ifndef WEBSSLINFO_H
0009 #define WEBSSLINFO_H
0010 
0011 #include <QUrl>
0012 #include <QList>
0013 #include <QString>
0014 #include <QHostAddress>
0015 #include <QSslCertificate>
0016 
0017 class WebSslInfo
0018 {
0019 public:
0020   WebSslInfo();
0021   WebSslInfo(const WebSslInfo&);
0022   virtual ~WebSslInfo();
0023 
0024   bool isValid() const;
0025   QUrl url() const;
0026   QHostAddress peerAddress() const;
0027   QHostAddress parentAddress() const;
0028   QString ciphers() const;
0029   QString protocol() const;
0030   QString certificateErrors() const;
0031   int supportedChiperBits () const;
0032   int usedChiperBits () const;
0033   QList<QSslCertificate> certificateChain() const;
0034 
0035   bool saveTo(QMap<QString, QVariant>&) const;
0036   void restoreFrom(const QVariant &, const QUrl& = QUrl(), bool reset = false);
0037 
0038   void setUrl (const QUrl &url);
0039   WebSslInfo& operator = (const WebSslInfo&);
0040 
0041 protected:
0042   void setCiphers(const QString& ciphers);
0043   void setProtocol(const QString& protocol);
0044   void setPeerAddress(const QString& address);
0045   void setParentAddress(const QString& address);
0046   void setCertificateChain(const QByteArray& chain);
0047   void setCertificateErrors(const QString& certErrors);
0048   void setUsedCipherBits(const QString& bits);
0049   void setSupportedCipherBits(const QString& bits);
0050 
0051 private:
0052   class WebSslInfoPrivate;
0053   WebSslInfoPrivate* d;
0054 };
0055 
0056 #endif // WEBSSLINFO_H