+
+ void set (TrustedDevice t)
+ {
+ _certificate = t.certificate ();
+ _thumbprint->SetValue (std_to_wx(t.thumbprint()));
+ }
+
+ optional<TrustedDevice> get ()
+ {
+ string const t = wx_to_std (_thumbprint->GetValue ());
+ if (_certificate && _certificate->thumbprint() == t) {
+ return TrustedDevice (*_certificate);
+ } else if (t.length() == 28) {
+ return TrustedDevice (t);
+ }
+
+ return optional<TrustedDevice> ();
+ }
+
+private:
+ wxTextCtrl* _thumbprint;
+ wxButton* _file;
+ boost::optional<dcp::Certificate> _certificate;