diff options
author | Richard Moore <rich@kde.org> | 2011-11-11 23:08:42 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-14 10:39:47 +0100 |
commit | e66d3d98996c918162f2bf5bf94a0d356a39b5af (patch) | |
tree | 75862d157b9beb114d3293bc6d401b6b4b5827e2 /src/network/ssl/qsslcertificate.h | |
parent | fd3d7429b2b00fe2e3f8ca7b41a04273b42077e8 (diff) |
Deprecate QSslCertificate::isValid() replace with isBlacklisted()
Currently isValid wrongly gives the impression it checks a certificate
for validity - it doesn't. It merely checks if the certificate dates
are valid and if the certificate is blacklisted. Since it's already
easy for users to check the dates, let's just give them access to the
ability to check for blacklisting.
Change-Id: I25be3bde6a01063034702a9574b28469bf4882cd
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'src/network/ssl/qsslcertificate.h')
-rw-r--r-- | src/network/ssl/qsslcertificate.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index 07a8df308c..711ee055e2 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -46,6 +46,7 @@ #include <QtCore/qnamespace.h> #include <QtCore/qbytearray.h> #include <QtCore/qcryptographichash.h> +#include <QtCore/qdatetime.h> #include <QtCore/qregexp.h> #include <QtCore/qsharedpointer.h> #include <QtCore/qmap.h> @@ -94,7 +95,15 @@ public: inline bool operator!=(const QSslCertificate &other) const { return !operator==(other); } bool isNull() const; - bool isValid() const; +#if QT_DEPRECATED_SINCE(5,0) + QT_DEPRECATED inline bool isValid() const { + const QDateTime currentTime = QDateTime::currentDateTime(); + return currentTime >= effectiveDate() && + currentTime <= expiryDate() && + !isBlacklisted(); + } +#endif + bool isBlacklisted() const; void clear(); // Certificate info |