diff --git a/Pdf4QtViewer/pdfviewersettingsdialog.cpp b/Pdf4QtViewer/pdfviewersettingsdialog.cpp index b6f1fd2..063c665 100644 --- a/Pdf4QtViewer/pdfviewersettingsdialog.cpp +++ b/Pdf4QtViewer/pdfviewersettingsdialog.cpp @@ -30,8 +30,6 @@ #include #include #include -#include -#include #include #include @@ -73,9 +71,7 @@ PDFViewerSettingsDialog::PDFViewerSettingsDialog(const PDFViewerSettings::Settin m_isLoadingData(false), m_certificateStore(certificateStore), m_enabledPlugins(enabledPlugins), - m_plugins(plugins), - m_networkAccessManager(nullptr), - m_downloadCertificatesFromEUTLReply(nullptr) + m_plugins(plugins) { ui->setupUi(this); @@ -830,12 +826,6 @@ void PDFViewerSettingsDialog::setSpeechEngine(const QString& engine) bool PDFViewerSettingsDialog::canCloseDialog() { - if (m_downloadCertificatesFromEUTLReply) - { - QMessageBox::warning(this, tr("Download"), tr("Downloading certificates from EUTL didn't finish yet. Can't close the dialog.")); - return false; - } - return true; } @@ -871,62 +861,6 @@ void PDFViewerSettingsDialog::on_cmsProfileDirectoryButton_clicked() } } -void PDFViewerSettingsDialog::on_trustedCertificateStoreDownloadEUTLButton_clicked() -{ - if (m_downloadCertificatesFromEUTLReply) - { - // Jakub Melka: We are already downloading the data - return; - } - - if (QMessageBox::question(this, tr("Download EUTL"), tr("Do you want do download EU trusted certificates list from https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml ?")) == QMessageBox::Yes) - { - if (!m_networkAccessManager) - { - m_networkAccessManager = new QNetworkAccessManager(this); - } - - m_downloadCertificatesFromEUTLReply = m_networkAccessManager->get(QNetworkRequest(QUrl("https://ec.europa.eu/information_society/policy/esignature/trusted-list/tl-mp.xml"))); - - auto onFinished = [this]() - { - QNetworkReply::NetworkError error = m_downloadCertificatesFromEUTLReply->error(); - - if (error == QNetworkReply::NoError) - { - QByteArray data = m_downloadCertificatesFromEUTLReply->readAll(); - - QDomDocument document; - QString errorMessage; - if (document.setContent(data, &errorMessage)) - { - QDomNodeList certificateElements = document.elementsByTagName("X509Certificate"); - for (int i = 0; i < certificateElements.count(); ++i) - { - QDomElement certificateElement = certificateElements.at(i).toElement(); - QString certificateBase64Encoded = certificateElement.text(); - QByteArray certificateData = QByteArray::fromBase64(certificateBase64Encoded.toLatin1(), QByteArray::Base64Encoding); - m_certificateStore.add(pdf::PDFCertificateStore::EntryType::EUTL, certificateData); - } - updateTrustedCertificatesTable(); - } - else - { - QMessageBox::critical(this, tr("Error"), errorMessage); - } - } - else - { - QMessageBox::critical(this, tr("Error"), m_downloadCertificatesFromEUTLReply->errorString()); - } - - m_downloadCertificatesFromEUTLReply->deleteLater(); - m_downloadCertificatesFromEUTLReply = nullptr; - }; - connect(m_downloadCertificatesFromEUTLReply, &QNetworkReply::finished, this, onFinished); - } -} - void PDFViewerSettingsDialog::on_removeCertificateButton_clicked() { std::set rows; diff --git a/Pdf4QtViewer/pdfviewersettingsdialog.h b/Pdf4QtViewer/pdfviewersettingsdialog.h index 73aea6e..e7613ef 100644 --- a/Pdf4QtViewer/pdfviewersettingsdialog.h +++ b/Pdf4QtViewer/pdfviewersettingsdialog.h @@ -24,8 +24,6 @@ #include class QListWidgetItem; -class QNetworkReply; -class QNetworkAccessManager; namespace Ui { @@ -93,9 +91,6 @@ public: private slots: void on_optionsPagesWidget_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous); void on_cmsProfileDirectoryButton_clicked(); - - void on_trustedCertificateStoreDownloadEUTLButton_clicked(); - void on_removeCertificateButton_clicked(); private: @@ -129,8 +124,6 @@ private: pdf::PDFCertificateStore m_certificateStore; QStringList m_enabledPlugins; pdf::PDFPluginInfos m_plugins; - QNetworkAccessManager* m_networkAccessManager; - QNetworkReply* m_downloadCertificatesFromEUTLReply; }; } // namespace pdfviewer diff --git a/Pdf4QtViewer/pdfviewersettingsdialog.ui b/Pdf4QtViewer/pdfviewersettingsdialog.ui index 1dc2046..6edda82 100644 --- a/Pdf4QtViewer/pdfviewersettingsdialog.ui +++ b/Pdf4QtViewer/pdfviewersettingsdialog.ui @@ -35,7 +35,7 @@ - 5 + 10 @@ -1346,13 +1346,6 @@ - - - - Download EUTL - - - @@ -1365,7 +1358,7 @@ - <html><head/><body><p>Settings for verification of digital signatures. Digital signatures are verified as strict, as possible, to avoid any malicious content or signature manipulation. Verification can also be turned off, if it is not wanted. When <span style=" font-weight:600;">Strict mode</span> is turned on, every warning is treated as error. You can also ignore certificate expiration date, but do this only, if you know what you are doing, because it is dangerous. For verification, list of trusted certificates is used. System certificates can be inserted into the list, and also you can manage your own list of trusted certificates. Also, certificates from EUTL (EU trusted list) can be downloaded into the trusted certificate storage.</p></body></html> + <html><head/><body><p>Settings for verification of digital signatures. Digital signatures are verified as strict, as possible, to avoid any malicious content or signature manipulation. Verification can also be turned off, if it is not wanted. When <span style=" font-weight:600;">Strict mode</span> is turned on, every warning is treated as error. You can also ignore certificate expiration date, but do this only, if you know what you are doing, because it is dangerous. For verification, list of trusted certificates is used. System certificates can be inserted into the list, and also you can manage your own list of trusted certificates. </p></body></html> true