/// <summary> /// Shows a dialog asking the user to enter a passphrase /// for a symmetrically encrypted message /// </summary> public void ShowSingleKeyDialog(System.Xml.XmlElement xmlKey) { this.cmbSecretKeys.Items.Clear(); this.cmbSecretKeys.Enabled = false; if (xmlKey.Name != "SecretKey") { throw new ArgumentException("You have to give exactly one key as argument to ShowSingleKeyDialog!"); } ComboBoxKeyItem cbkiKey = new ComboBoxKeyItem(xmlKey); this.cmbSecretKeys.Items.Add(cbkiKey); this.cmbSecretKeys.SelectedIndex = 0; this.ShowDialog(); }
public void ShowMultiKeyDialog(System.Xml.XmlElement xmlKeyRing) { this.cmbSecretKeys.Items.Clear(); this.cmbSecretKeys.Enabled = true; XmlNodeList xnlSecretKeys = xmlKeyRing.GetElementsByTagName("SecretKey"); IEnumerator ieKeys = xnlSecretKeys.GetEnumerator(); while (ieKeys.MoveNext()) { XmlElement xmlKey = (XmlElement)ieKeys.Current; ComboBoxKeyItem cbkiKey = new ComboBoxKeyItem(xmlKey); cmbSecretKeys.Items.Add(cbkiKey); } cmbSecretKeys.SelectedIndex = 0; this.ShowDialog(); }
/// <summary> /// Shows a dialog asking the user to enter a passphrase /// for a symmetrically encrypted message /// </summary> public void ShowSingleKeyDialog(System.Xml.XmlElement xmlKey) { this.cmbSecretKeys.Items.Clear(); this.cmbSecretKeys.Enabled = false; if (xmlKey.Name != "SecretKey") throw new ArgumentException("You have to give exactly one key as argument to ShowSingleKeyDialog!"); ComboBoxKeyItem cbkiKey = new ComboBoxKeyItem(xmlKey); this.cmbSecretKeys.Items.Add(cbkiKey); this.cmbSecretKeys.SelectedIndex = 0; this.ShowDialog(); }