Пример #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;
        }
Пример #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);
        }
Пример #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();
 }
Пример #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();
        }
Пример #5
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     this._key = null;
     this.Close();
 }
Пример #6
0
 public void SetResultKey(SSH2UserAuthKey k)
 {
     this._key = k;
 }
Пример #7
0
 private void buttonCancel_Click(object sender, EventArgs e)
 {
     this._key = null;
     this.Close();
 }
Пример #8
0
 public void SetResultKey(SSH2UserAuthKey k)
 {
     this._key = k;
 }