Changeset View
Changeset View
Standalone View
Standalone View
src/core/ksslcertificatemanager.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 40 | public: | |||
---|---|---|---|---|---|
45 | KSslCertificateRule &operator=(const KSslCertificateRule &other); | 45 | KSslCertificateRule &operator=(const KSslCertificateRule &other); | ||
46 | 46 | | |||
47 | QSslCertificate certificate() const; | 47 | QSslCertificate certificate() const; | ||
48 | QString hostName() const; | 48 | QString hostName() const; | ||
49 | void setExpiryDateTime(const QDateTime &dateTime); | 49 | void setExpiryDateTime(const QDateTime &dateTime); | ||
50 | QDateTime expiryDateTime() const; | 50 | QDateTime expiryDateTime() const; | ||
51 | void setRejected(bool rejected); | 51 | void setRejected(bool rejected); | ||
52 | bool isRejected() const; | 52 | bool isRejected() const; | ||
53 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) | ||||
53 | /** @deprecated since 5.64, use the QSslError variant. */ | 54 | /** @deprecated since 5.64, use the QSslError variant. */ | ||
54 | KIOCORE_DEPRECATED bool isErrorIgnored(KSslError::Error error) const; | 55 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::isErrorIgnored(QSslError::SslError)") | ||
56 | bool isErrorIgnored(KSslError::Error error) const; | ||||
57 | #endif | ||||
55 | /** | 58 | /** | ||
56 | * Returns whether @p error is ignored for this certificate. | 59 | * Returns whether @p error is ignored for this certificate. | ||
57 | * @since 5.64 | 60 | * @since 5.64 | ||
58 | */ | 61 | */ | ||
59 | bool isErrorIgnored(QSslError::SslError error) const; | 62 | bool isErrorIgnored(QSslError::SslError error) const; | ||
63 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) | ||||
60 | /** @deprecated since 5.64, use the QSslError variant. */ | 64 | /** @deprecated since 5.64, use the QSslError variant. */ | ||
61 | KIOCORE_DEPRECATED void setIgnoredErrors(const QList<KSslError::Error> &errors); | 65 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::setIgnoredErrors(const QList<QSslError> &)") | ||
66 | void setIgnoredErrors(const QList<KSslError::Error> &errors); | ||||
62 | /** @deprecated since 5.64, use the QSslError variant. */ | 67 | /** @deprecated since 5.64, use the QSslError variant. */ | ||
63 | KIOCORE_DEPRECATED void setIgnoredErrors(const QList<KSslError> &errors); | 68 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::setIgnoredErrors(const QList<QSslError> &)") | ||
69 | void setIgnoredErrors(const QList<KSslError> &errors); | ||||
70 | #endif | ||||
64 | /** | 71 | /** | ||
65 | * Set the ignored errors for this certificate. | 72 | * Set the ignored errors for this certificate. | ||
66 | * @since 5.64 | 73 | * @since 5.64 | ||
67 | */ | 74 | */ | ||
68 | void setIgnoredErrors(const QList<QSslError> &errors); | 75 | void setIgnoredErrors(const QList<QSslError> &errors); | ||
69 | QList<KSslError::Error> ignoredErrors() const; // TODO KF6 return QSslError::SslError list | 76 | QList<KSslError::Error> ignoredErrors() const; // TODO KF6 return QSslError::SslError list | ||
77 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) | ||||
70 | /** @deprecated since 5.64, use the QSslError variant. */ | 78 | /** @deprecated since 5.64, use the QSslError variant. */ | ||
71 | KIOCORE_DEPRECATED QList<KSslError::Error> filterErrors(const QList<KSslError::Error> &errors) const; | 79 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::filterErrors(const QList<QSslError> &)") | ||
80 | QList<KSslError::Error> filterErrors(const QList<KSslError::Error> &errors) const; | ||||
72 | /** @deprecated since 5.64, use the QSslError variant. */ | 81 | /** @deprecated since 5.64, use the QSslError variant. */ | ||
73 | KIOCORE_DEPRECATED QList<KSslError> filterErrors(const QList<KSslError> &errors) const; | 82 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateRule::filterErrors(const QList<QSslError> &)") | ||
83 | QList<KSslError> filterErrors(const QList<KSslError> &errors) const; | ||||
84 | #endif | ||||
74 | /** | 85 | /** | ||
75 | * Filter out errors that are already ignored. | 86 | * Filter out errors that are already ignored. | ||
76 | * @since 5.64 | 87 | * @since 5.64 | ||
77 | */ | 88 | */ | ||
78 | QList<QSslError> filterErrors(const QList<QSslError> &errors) const; | 89 | QList<QSslError> filterErrors(const QList<QSslError> &errors) const; | ||
79 | private: | 90 | private: | ||
80 | KSslCertificateRulePrivate *const d; | 91 | KSslCertificateRulePrivate *const d; | ||
81 | }; | 92 | }; | ||
82 | 93 | | |||
83 | //### document this too... :/ | 94 | //### document this too... :/ | ||
84 | /** Certificate manager. */ | 95 | /** Certificate manager. */ | ||
85 | class KIOCORE_EXPORT KSslCertificateManager | 96 | class KIOCORE_EXPORT KSslCertificateManager | ||
86 | { | 97 | { | ||
87 | public: | 98 | public: | ||
88 | static KSslCertificateManager *self(); | 99 | static KSslCertificateManager *self(); | ||
89 | void setRule(const KSslCertificateRule &rule); | 100 | void setRule(const KSslCertificateRule &rule); | ||
90 | void clearRule(const KSslCertificateRule &rule); | 101 | void clearRule(const KSslCertificateRule &rule); | ||
91 | void clearRule(const QSslCertificate &cert, const QString &hostName); | 102 | void clearRule(const QSslCertificate &cert, const QString &hostName); | ||
92 | KSslCertificateRule rule(const QSslCertificate &cert, const QString &hostName) const; | 103 | KSslCertificateRule rule(const QSslCertificate &cert, const QString &hostName) const; | ||
93 | 104 | | |||
94 | // use caCertificates() instead | 105 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 6) | ||
95 | #ifndef KIOCORE_NO_DEPRECATED | 106 | /** @deprecated Since 4.6, use caCertificates() instead */ | ||
96 | KIOCORE_DEPRECATED QList<QSslCertificate> rootCertificates() const | 107 | KIOCORE_DEPRECATED_VERSION(4, 6, "Use KSslCertificateManager::caCertificates()") | ||
108 | QList<QSslCertificate> rootCertificates() const | ||||
97 | { | 109 | { | ||
98 | return caCertificates(); | 110 | return caCertificates(); | ||
99 | } | 111 | } | ||
100 | #endif | 112 | #endif | ||
101 | 113 | | |||
102 | QList<QSslCertificate> caCertificates() const; | 114 | QList<QSslCertificate> caCertificates() const; | ||
103 | 115 | | |||
116 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) | ||||
104 | /** @deprecated since 5.64, use the corresponding QSslError variant. */ | 117 | /** @deprecated since 5.64, use the corresponding QSslError variant. */ | ||
105 | static KIOCORE_DEPRECATED QList<KSslError> nonIgnorableErrors(const QList<KSslError> &); | 118 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateManager::nonIgnorableErrors(const QList<QSslError> &)") | ||
119 | static QList<KSslError> nonIgnorableErrors(const QList<KSslError> &); | ||||
106 | /** @deprecated since 5.64, use the corresponding QSslError variant. */ | 120 | /** @deprecated since 5.64, use the corresponding QSslError variant. */ | ||
107 | static KIOCORE_DEPRECATED QList<KSslError::Error> nonIgnorableErrors(const QList<KSslError::Error> &); | 121 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use KSslCertificateManager::nonIgnorableErrors(const QList<QSslError> &)") | ||
122 | static QList<KSslError::Error> nonIgnorableErrors(const QList<KSslError::Error> &); | ||||
123 | #endif | ||||
108 | /** | 124 | /** | ||
109 | * Returns the subset of @p errors that cannot be ignored, ie. that is considered fatal. | 125 | * Returns the subset of @p errors that cannot be ignored, ie. that is considered fatal. | ||
110 | * @since 5.64 | 126 | * @since 5.64 | ||
111 | */ | 127 | */ | ||
112 | static QList<QSslError> nonIgnorableErrors(const QList<QSslError> &errors); | 128 | static QList<QSslError> nonIgnorableErrors(const QList<QSslError> &errors); | ||
113 | 129 | | |||
114 | private: | 130 | private: | ||
115 | friend class KSslCertificateManagerContainer; | 131 | friend class KSslCertificateManagerContainer; | ||
116 | friend class KSslCertificateManagerPrivate; | 132 | friend class KSslCertificateManagerPrivate; | ||
117 | KSslCertificateManager(); | 133 | KSslCertificateManager(); | ||
118 | ~KSslCertificateManager(); | 134 | ~KSslCertificateManager(); | ||
119 | 135 | | |||
120 | KSslCertificateManagerPrivate *const d; | 136 | KSslCertificateManagerPrivate *const d; | ||
121 | }; | 137 | }; | ||
122 | 138 | | |||
123 | #endif | 139 | #endif |