Пример #1
0
        /// <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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
        /// <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();
        }