コード例 #1
0
        public void showKey()
        {
            _OpenSSHstring = _key.PublicPartInOpenSSHStyle();
            String alg;

            if (_key.Algorithm == PublicKeyAlgorithm.DSA)
            {
                alg = "dsa";
            }
            else
            {
                alg = "rsa";
            }
            DateTime n       = DateTime.Now;
            String   comment = alg + "-key-" + n.ToString("yyyyMMdd");

            labelpublicKey.Show();
            publicKeyBox.Text = _OpenSSHstring + " " + textBoxTag.Text;
            publicKeyBox.Show();
            //labelfingerprint.Show();
            //fingerprintBox.Text = _key.
            //fingerprintBox.Show();
            labelTag.Show();
            textBoxTag.Show();
            textBoxTag.Text = comment;
        }
コード例 #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;
            }
        }