diff options
Diffstat (limited to 'src/network/ssl/qsslcertificate.cpp')
-rw-r--r-- | src/network/ssl/qsslcertificate.cpp | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 791dc7852f..28dda14436 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -373,15 +373,6 @@ QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) cons \sa subjectInfo() */ -#if QT_DEPRECATED_SINCE(5,0) -/*! - \fn QMultiMap<QSsl::AlternateNameEntryType, QString> QSslCertificate::alternateSubjectNames() const - \obsolete - - Use QSslCertificate::subjectAlternativeNames(); -*/ -#endif - /*! \fn QMultiMap<QSsl::AlternativeNameEntryType, QString> QSslCertificate::subjectAlternativeNames() const @@ -464,86 +455,6 @@ QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) cons \since 5.0 */ -#if QT_DEPRECATED_SINCE(5,15) -/*! - \obsolete - - Searches all files in the \a path for certificates encoded in the - specified \a format and returns them in a list. \a path must be a file - or a pattern matching one or more files, as specified by \a syntax. - - Example: - - \snippet code/src_network_ssl_qsslcertificate.cpp 0 - - \sa fromData() -*/ -QList<QSslCertificate> QSslCertificate::fromPath(const QString &path, - QSsl::EncodingFormat format, - QRegExp::PatternSyntax syntax) -{ - // $, (,), *, +, ., ?, [, ,], ^, {, | and }. - - // make sure to use the same path separators on Windows and Unix like systems. - QString sourcePath = QDir::fromNativeSeparators(path); - - // Find the path without the filename - QString pathPrefix = sourcePath.left(sourcePath.lastIndexOf(QLatin1Char('/'))); - - // Check if the path contains any special chars - int pos = -1; - if (syntax == QRegExp::Wildcard) - pos = pathPrefix.indexOf(QRegExp(QLatin1String("[*?[]"))); - else if (syntax != QRegExp::FixedString) - pos = sourcePath.indexOf(QRegExp(QLatin1String("[\\$\\(\\)\\*\\+\\.\\?\\[\\]\\^\\{\\}\\|]"))); - if (pos != -1) { - // there was a special char in the path so cut of the part containing that char. - pathPrefix = pathPrefix.left(pos); - const int lastIndexOfSlash = pathPrefix.lastIndexOf(QLatin1Char('/')); - if (lastIndexOfSlash != -1) - pathPrefix = pathPrefix.left(lastIndexOfSlash); - else - pathPrefix.clear(); - } else { - // Check if the path is a file. - if (QFileInfo(sourcePath).isFile()) { - QFile file(sourcePath); - QIODevice::OpenMode openMode = QIODevice::ReadOnly; - if (format == QSsl::Pem) - openMode |= QIODevice::Text; - if (file.open(openMode)) - return QSslCertificate::fromData(file.readAll(), format); - return QList<QSslCertificate>(); - } - } - - // Special case - if the prefix ends up being nothing, use "." instead. - int startIndex = 0; - if (pathPrefix.isEmpty()) { - pathPrefix = QLatin1String("."); - startIndex = 2; - } - - // The path can be a file or directory. - QList<QSslCertificate> certs; - QRegExp pattern(sourcePath, Qt::CaseSensitive, syntax); - QDirIterator it(pathPrefix, QDir::Files, QDirIterator::FollowSymlinks | QDirIterator::Subdirectories); - while (it.hasNext()) { - QString filePath = startIndex == 0 ? it.next() : it.next().mid(startIndex); - if (!pattern.exactMatch(filePath)) - continue; - - QFile file(filePath); - QIODevice::OpenMode openMode = QIODevice::ReadOnly; - if (format == QSsl::Pem) - openMode |= QIODevice::Text; - if (file.open(openMode)) - certs += QSslCertificate::fromData(file.readAll(), format); - } - return certs; -} -#endif // QT_DEPRECATED_SINCE(5,15) - /*! \since 5.15 |