コード例 #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
ファイル: Preferences.cs プロジェクト: zoroz/Terminals
        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
ファイル: Protocol.cs プロジェクト: zoroz/Terminals
        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
ファイル: KeySettings.cs プロジェクト: zoroz/Terminals
 public SSHKeyElement(string tag, SSH2UserAuthKey key)
 {
     this.tag = tag;
     this.key = key;
 }