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(); }
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; } }
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); }
private void buttonCancel_Click(object sender, EventArgs e) { _key = null; Close(); }
public void SetResultKey(SSH2UserAuthKey k) { _key = k; }
public SSHKeyElement(string tag, SSH2UserAuthKey key) { this.tag = tag; this.key = key; }
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(); }