KIO
ksslcertificatemanager.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 * 00003 * Copyright (C) 2000, 2001 George Staikos <staikos@kde.org> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef _INCLUDE_KSSLCERTIFICATEMANAGER_H 00022 #define _INCLUDE_KSSLCERTIFICATEMANAGER_H 00023 00024 #include <kdecore/network/ktcpsocket.h> 00025 00026 #include <QtNetwork/QSslCertificate> 00027 #include <QtNetwork/QSslError> 00028 #include <QtCore/QString> 00029 #include <QtCore/QStringList> 00030 #include <QtCore/QDate> 00031 00032 #include <kio/kio_export.h> 00033 00034 class QSslCertificate; 00035 class KSslCertificateRulePrivate; 00036 class KSslCertificateManagerPrivate; 00037 00038 class KIO_EXPORT KSslCertificateRule 00039 { 00040 public: 00041 KSslCertificateRule(const QSslCertificate &cert = QSslCertificate(), 00042 const QString &hostName = QString()); 00043 KSslCertificateRule(const KSslCertificateRule &other); 00044 ~KSslCertificateRule(); 00045 KSslCertificateRule &operator=(const KSslCertificateRule &other); 00046 00047 QSslCertificate certificate() const; 00048 QString hostName() const; 00049 void setExpiryDateTime(const QDateTime &dateTime); 00050 QDateTime expiryDateTime() const; 00051 void setRejected(bool rejected); 00052 bool isRejected() const; 00053 bool isErrorIgnored(KSslError::Error error) const; 00054 void setIgnoredErrors(const QList<KSslError::Error> &errors); 00055 void setIgnoredErrors(const QList<KSslError> &errors); 00056 QList<KSslError::Error> ignoredErrors() const; 00057 QList<KSslError::Error> filterErrors(const QList<KSslError::Error> &errors) const; 00058 QList<KSslError> filterErrors(const QList<KSslError> &errors) const; 00059 private: 00060 KSslCertificateRulePrivate *const d; 00061 }; 00062 00063 00064 class KIO_EXPORT KSslCertificateManager 00065 { 00066 public: 00067 static KSslCertificateManager *self(); 00068 void setRule(const KSslCertificateRule &rule); 00069 void clearRule(const KSslCertificateRule &rule); 00070 void clearRule(const QSslCertificate &cert, const QString &hostName); 00071 KSslCertificateRule rule(const QSslCertificate &cert, const QString &hostName) const; 00072 00073 void setRootCertificates(const QList<QSslCertificate> &rootCertificates); 00074 QList<QSslCertificate> rootCertificates() const; 00075 private: 00076 friend class KSslCertificateManagerContainer; 00077 KSslCertificateManager(); 00078 ~KSslCertificateManager(); 00079 00080 KSslCertificateManagerPrivate *const d; 00081 }; 00082 00083 00084 #endif