+ wxFont font = ip.GetFont ();
+ font.SetFamily (wxFONTFAMILY_TELETYPE);
+ ip.SetFont (font);
+
+ _certificates->InsertColumn (1, ip);
+ }
+
+ certificates_sizer->Add (_certificates, 1, wxEXPAND);
+
+ {
+ auto s = new wxBoxSizer (wxVERTICAL);
+ _add_certificate = new Button (this, _("Add..."));
+ s->Add (_add_certificate, 1, wxTOP | wxBOTTOM | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
+ _remove_certificate = new Button (this, _("Remove"));
+ s->Add (_remove_certificate, 1, wxTOP | wxBOTTOM | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
+ _export_certificate = new Button (this, _("Export certificate..."));
+ s->Add (_export_certificate, 1, wxTOP | wxBOTTOM | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
+ _export_chain = new Button (this, _("Export chain..."));
+ s->Add (_export_chain, 1, wxTOP | wxBOTTOM | wxEXPAND, DCPOMATIC_BUTTON_STACK_GAP);
+ certificates_sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
+ }
+
+ auto table = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+ _sizer->Add (table, 1, wxALL | wxEXPAND, border);
+ int r = 0;
+
+ add_label_to_sizer (table, this, _("Leaf private key"), true, wxGBPosition (r, 0));
+ _private_key = new StaticText (this, wxT(""));
+ wxFont font = _private_key->GetFont ();
+ font.SetFamily (wxFONTFAMILY_TELETYPE);
+ _private_key->SetFont (font);
+ table->Add (_private_key, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
+ _import_private_key = new Button (this, _("Import..."));
+ table->Add (_import_private_key, wxGBPosition (r, 2));
+ _export_private_key = new Button (this, _("Export..."));
+ table->Add (_export_private_key, wxGBPosition (r, 3));
+ ++r;
+
+ _button_sizer = new wxBoxSizer (wxHORIZONTAL);
+ _remake_certificates = new Button (this, _("Re-make certificates and key..."));
+ _button_sizer->Add (_remake_certificates, 1, wxRIGHT, border);
+ table->Add (_button_sizer, wxGBPosition (r, 0), wxGBSpan (1, 4));
+ ++r;
+
+ _private_key_bad = new StaticText (this, _("Leaf private key does not match leaf certificate!"));
+ font = *wxSMALL_FONT;
+ font.SetWeight (wxFONTWEIGHT_BOLD);
+ _private_key_bad->SetFont (font);
+ table->Add (_private_key_bad, wxGBPosition (r, 0), wxGBSpan (1, 3));
+ ++r;
+
+ _add_certificate->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::add_certificate, this));
+ _remove_certificate->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::remove_certificate, this));
+ _export_certificate->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::export_certificate, this));
+ _certificates->Bind (wxEVT_LIST_ITEM_SELECTED, bind (&CertificateChainEditor::update_sensitivity, this));
+ _certificates->Bind (wxEVT_LIST_ITEM_DESELECTED, bind (&CertificateChainEditor::update_sensitivity, this));
+ _remake_certificates->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::remake_certificates, this));
+ _export_chain->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::export_chain, this));
+ _import_private_key->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::import_private_key, this));
+ _export_private_key->Bind (wxEVT_BUTTON, bind (&CertificateChainEditor::export_private_key, this));
+
+ auto buttons = CreateSeparatedButtonSizer (wxCLOSE);
+ if (buttons) {
+ _sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
+ }
+
+ SetSizerAndFit (_sizer);
+
+ update_certificate_list ();
+ update_private_key ();
+ update_sensitivity ();
+}