Esempio 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;
        }
Esempio 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);
        }