Пример #1
0
        private void buttonGenerate_Click(object sender, EventArgs e)
        {
            PublicKeyAlgorithm algorithm;

            if (algorithmBox.Text == "RSA")
            {
                algorithm = PublicKeyAlgorithm.RSA;
            }
            else
            {
                algorithm = PublicKeyAlgorithm.DSA;
            }
            labelfingerprint.Hide();
            labelpublicKey.Hide();
            labelTag.Hide();
            textBoxTag.Hide();
            publicKeyBox.Hide();
            fingerprintBox.Hide();
            labelRandomness.Show();
            progressBarGenerate.Show();
            _gotKey        = false;
            _key           = null;
            _OpenSSHstring = "";
            KeyGenThread t = new KeyGenThread(this, algorithm, Int32.Parse(bitCountBox.Text));

            _mmhandler = t.OnMouseMove;
            progressBarGenerate.MouseMove += _mmhandler;
            this.MouseMove += _mmhandler;
            t.Start();
        }
Пример #2
0
        private void comboBoxKey_SelectedIndexChanged(object sender, EventArgs e)
        {
            // TODO SSH1 ?
            string tag = (string)comboBoxKey.SelectedItem;

            if (!string.IsNullOrEmpty(tag))
            {
                string          keytext = keysSection.Keys[tag].Key;
                SSH2UserAuthKey key     = SSH2UserAuthKey.FromBase64String(keytext);
                openSSHTextBox.Text = key.PublicPartInOpenSSHStyle() + " " + tag;
            }
        }
Пример #3
0
        private AuthMethod CheckPublickKey(String key, AuthMethod authMethod, string SSH2PrivateKeyFile)
        {
            if (authMethod == AuthMethod.PublicKey)
            {
                if (string.IsNullOrEmpty(key) && string.IsNullOrEmpty(SSH2PrivateKeyFile))
                {
                    return(AuthMethod.Password);
                }

                if (string.IsNullOrEmpty(SSH2PrivateKeyFile))
                {
                    this.Key = SSH2UserAuthKey.FromBase64String(key).toSECSHStyle("");
                }
            }

            return(authMethod);
        }
Пример #4
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     _key = null;
     Close();
 }
Пример #5
0
 public void SetResultKey(SSH2UserAuthKey k)
 {
     _key = k;
 }
Пример #6
0
 public SSHKeyElement(string tag, SSH2UserAuthKey key)
 {
     this.tag = tag;
      this.key = key;
 }
Пример #7
0
 public void SetResultKey(SSH2UserAuthKey k)
 {
     _key = k;
 }
Пример #8
0
 private void buttonGenerate_Click(object sender, EventArgs e)
 {
     PublicKeyAlgorithm algorithm;
     if (algorithmBox.Text == "RSA")
         algorithm= PublicKeyAlgorithm.RSA;
     else
         algorithm= PublicKeyAlgorithm.DSA;
     labelfingerprint.Hide();
     labelpublicKey.Hide();
     labelTag.Hide();
     textBoxTag.Hide();
     publicKeyBox.Hide();
     fingerprintBox.Hide();
     labelRandomness.Show();
     progressBarGenerate.Show();
     _gotKey = false;
     _key = null;
     _OpenSSHstring = "";
     KeyGenThread t = new KeyGenThread(this, algorithm, Int32.Parse(bitCountBox.Text));
     _mmhandler = t.OnMouseMove;
     progressBarGenerate.MouseMove += _mmhandler;
     this.MouseMove += _mmhandler;
     t.Start();
 }
Пример #9
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     _key = null;
     Close();
 }
Пример #10
0
 public SSHKeyElement(string tag, SSH2UserAuthKey key)
 {
     this.tag = tag;
     this.key = key;
 }