Dolby is apparently recreating all their certificates (as they will soon expire)...
[dcpomatic.git] / src / wx / download_certificate_panel.cc
index b9680e2983f9325a0c9679b10c1da8f8930c5bce..b3de4ca2c427e16aa8981dd78ff13432073adae7 100644 (file)
 */
 
 
-#include "wx_util.h"
-#include "download_certificate_panel.h"
 #include "download_certificate_dialog.h"
-#include "lib/signal_manager.h"
+#include "download_certificate_panel.h"
+#include "wx_util.h"
 #include "lib/compose.hpp"
-#include <dcp/util.h>
+#include "lib/signal_manager.h"
 #include <dcp/certificate_chain.h>
 #include <dcp/exceptions.h>
+#include <dcp/util.h>
 #include <boost/bind/bind.hpp>
 
 
 using std::string;
-using boost::function;
 using boost::optional;
 
 
@@ -59,10 +58,11 @@ DownloadCertificatePanel::DownloadCertificatePanel (DownloadCertificateDialog* d
 
 
 optional<string>
-DownloadCertificatePanel::load_certificate (boost::filesystem::path file)
+DownloadCertificatePanel::load_certificate (boost::filesystem::path file, string url)
 {
        try {
                _certificate = dcp::Certificate (dcp::file_to_string(file));
+               _url = url;
        } catch (dcp::MiscError& e) {
                return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
        }
@@ -71,10 +71,11 @@ DownloadCertificatePanel::load_certificate (boost::filesystem::path file)
 
 
 optional<string>
-DownloadCertificatePanel::load_certificate_from_chain (boost::filesystem::path file)
+DownloadCertificatePanel::load_certificate_from_chain (boost::filesystem::path file, string url)
 {
        try {
                _certificate = dcp::CertificateChain (dcp::file_to_string(file)).leaf();
+               _url = url;
        } catch (dcp::MiscError& e) {
                return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
        }
@@ -89,6 +90,14 @@ DownloadCertificatePanel::certificate () const
 
 }
 
+
+optional<string>
+DownloadCertificatePanel::url () const
+{
+       return _url;
+
+}
+
 void
 DownloadCertificatePanel::download ()
 {