Exemplo n.º 1
0
        private void comboBoxKey_SelectedIndexChanged(object sender, EventArgs e)
        {
            string          tag     = (string)this.comboBoxKey.SelectedItem;
            string          keytext = this.keysSection.Keys[tag].Key;
            SSH2UserAuthKey key     = SSH2UserAuthKey.FromBase64String(keytext);

            this.openSSHTextBox.Text = key.PublicPartInOpenSSHStyle() + " " + tag;
        }
Exemplo n.º 2
0
        private AuthMethod CheckPublickKey(String key, AuthMethod authMethod)
        {
            if (authMethod == AuthMethod.PublicKey)
            {
                if (string.IsNullOrEmpty(key))
                {
                    return(AuthMethod.Password);
                }

                this.Key = SSH2UserAuthKey.FromBase64String(key).toSECSHStyle("");
            }

            return(authMethod);
        }
Exemplo n.º 3
0
 private void buttonGenerate_Click(object sender, EventArgs e)
 {
     PublicKeyAlgorithm algorithm;
     algorithm = this.algorithmBox.Text == "RSA" ? PublicKeyAlgorithm.RSA : PublicKeyAlgorithm.DSA;
     this.labelfingerprint.Hide();
     this.labelpublicKey.Hide();
     this.labelTag.Hide();
     this.textBoxTag.Hide();
     this.publicKeyBox.Hide();
     this.fingerprintBox.Hide();
     this.labelRandomness.Show();
     this.progressBarGenerate.Show();
     this._gotKey = false;
     this._key = null;
     this._OpenSSHstring = "";
     KeyGenThread t = new KeyGenThread(this, algorithm, Int32.Parse(this.bitCountBox.Text));
     this._mmhandler = t.OnMouseMove;
     this.progressBarGenerate.MouseMove += this._mmhandler;
     t.Start();
 }
Exemplo n.º 4
0
        private void buttonGenerate_Click(object sender, EventArgs e)
        {
            PublicKeyAlgorithm algorithm;

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

            this._mmhandler = t.OnMouseMove;
            this.progressBarGenerate.MouseMove += this._mmhandler;
            t.Start();
        }
Exemplo n.º 5
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     this._key = null;
     this.Close();
 }
Exemplo n.º 6
0
 public void SetResultKey(SSH2UserAuthKey k)
 {
     this._key = k;
 }
Exemplo n.º 7
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     this._key = null;
     this.Close();
 }
Exemplo n.º 8
0
 public void SetResultKey(SSH2UserAuthKey k)
 {
     this._key = k;
 }