//  
//   Rebex Sample Code License
// 
//   Copyright 2026, REBEX CR s.r.o.
//   All rights reserved.
//   https://www.rebex.net/
// 
//   Permission to use, copy, modify, and/or distribute this software for any
//   purpose with or without fee is hereby granted.
// 
//   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
//   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
//   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//   OTHER DEALINGS IN THE SOFTWARE.
// 

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Security.Cryptography.X509Certificates;
using System.Windows.Forms;
using Rebex.Net;
using Rebex.Security.Certificates;

namespace Rebex.Samples
{
    public class UcConnectionEditor : UserControl
    {
        #region Private variables

        /// <summary>
        /// A mode "before selection has changed" is remembered here
        /// </summary>
        private FileTransferMode _previousMode;

        #endregion 

        #region Events

        [Description("Occurs when height of inner controls has been recalculated according to current visibility of their content.")]
        /// <summary>
        /// Occurs when height of inner controls has been recalculated according to current visibility of their content.
        /// </summary>
        public event EventHandler HeightRecalculated;

        /// <summary>
        /// Occurs when rearranging within some inner control starts.<br/>
        /// Can be used as an extension point for adding new inner controls to the sender.
        /// </summary>
        protected event EventHandler ControlsRearranging;

        /// <summary>
        /// Occurs when rearranging within some inner control is finished.<br/>
        /// Can be used as an extension point for adding new inner controls to the sender.
        /// </summary>
        protected event EventHandler ControlsRearranged;

        #endregion 

        #region Ctor
        public UcConnectionEditor()
        {
            InitializeComponent();

            // design-time bining should be done in ctor (regardless filtering)
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                BindComboBoxes();
        }
        #endregion

        #region Field values properties

        #region Connection

        /// <summary>
        /// Gets or sets server host address.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ServerHost
        {
            get { return tbServerHost.Text; }
            set { tbServerHost.Text = value; }
        }

        /// <summary>
        /// Gets or sets server port.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public int ServerPort
        {
            get
            {
                int ret = 0;
                int.TryParse(tbServerPort.Text, out ret);
                return ret;
            }
            set { tbServerPort.Text = (value == 0) ? "" : value.ToString(); }
        }

        /// <summary>
        /// Gets or sets used file transfer protocol mode.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public FileTransferMode FileTransferMode
        {
            get 
            {
                // if nothing is selected...
                if (cmbProtocol.SelectedValue == null)
                    cmbProtocol.SelectedIndex = 0;    // ... select the first item
                return (FileTransferMode)cmbProtocol.SelectedValue;
            }
            set { cmbProtocol.SelectedValue = value; }
        }

        /// <summary>
        /// Gets or sets passive mode.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool PassiveMode
        {
            get { return cbPassive.Checked; }
            set { cbPassive.Checked = value; }
        }

        #endregion

        #region Credentials

        /// <summary>
        /// Gets or sets server login name.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ServerUser
        {
            get { return tbServerUser.Text; }
            set { tbServerUser.Text = value; }
        }

        /// <summary>
        /// Gets or sets server login password.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ServerPassword
        {
            get { return tbServerPassword.Text; }
            set { tbServerPassword.Text = value; }
        }

        /// <summary>
        /// Gets or sets server login domain (used for Gss Api).
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ServerDomain
        {
            get { return tbServerDomain.Text; }
            set { tbServerDomain.Text = value; }
        }

        /// <summary>
        /// Gets or sets private key used for SSH authentication.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public SshPrivateKey PrivateKey
        {
            set
            {
                _privateKey = value;
                RefreshPrivateKeyField();
            }
            get
            {
                return _privateKey;
            }
        }
        private SshPrivateKey _privateKey = null;

        /// <summary>
        /// Gets or sets private key filename used to load a private key for SSH authentication.
        /// </summary>
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string PrivateKeyFilename
        {
            set
            {
                _privateKeyFilename = value;
                RefreshPrivateKeyField();
            }
            get
            {
                return _privateKeyFilename;
            }
        }

        private string _privateKeyFilename = "";

        /// <summary>
        /// Gets or sets client certificate used for SSL authentication.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public CertificateChain ClientCertificate
        {
            set
            {
                _clientCertificate = value;
                RefreshClientCertificateField();
            }
            get
            {
                return _clientCertificate;
            }
        }
        private CertificateChain _clientCertificate = null;
        private Panel panel1;
        private ComboBox cmbSuites;
        private CheckBox cbAllowTls13;
        private CheckBox cbAllowTls12;
        private CheckBox cbAllowTls11;
        private CheckBox cbAllowTls10;
        private Label label23;
        private Label label22;
        private ComboBox cmbSshSuites;
        private Label label24;

        /// <summary>
        /// Gets or sets filename used to load a client certificate for SSL authentication.
        /// </summary>
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ClientCertificateFilename
        {
            set
            {
                _clientCertificateFilename = value;
                RefreshClientCertificateField();
            }
            get
            {
                return _clientCertificateFilename;
            }
        }
        private string _clientCertificateFilename = null;

        /// <summary>
        /// Gets or sets a value, indicating whether the password can be persisted to a file (outside the control). 
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool StorePassword
        {
            get { return cbStorePassword.Checked; }
            set { cbStorePassword.Checked = value; }
        }

        /// <summary>
        /// Gets or sets GSS API mode.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool UseGssApi
        {
            get { return cbUseGssApi.Checked; }
            set { cbUseGssApi.Checked = value; }
        }

        /// <summary>
        /// Gets or sets Clear Command Channel mode.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool ClearCommandChannel
        {
            get { return cbClearCommandChannel.Checked; }
            set { cbClearCommandChannel.Checked = value; }
        }

        #endregion 

        #region Proxy

        /// <summary>
        /// Gets or sets used proxy type (or <see cref="FileTransferProxyType.None"/> when no proxy is used).
        /// </summary>
        /// <remarks>
        /// We have to use generalized enum <see cref="FileTransferProxyType"/> since e.g. specialized FtpProxyType 
        /// is declared in Rebex.Ftp assembly and that assembly would not be available even when using this user control.<br/>
        /// Fortunately, int values of the FtpProxyType are compatible with the <see cref="FileTransferProxyType"/> 
        /// and int values of the ProxyType (used in Sftp) are a subset of the <see cref="FileTransferProxyType"/>.
        /// </remarks>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public FileTransferProxyType ProxyType
        {
            get
            {
                // if nothing is selected...
                if (cmbProxyType.SelectedValue == null)
                {
                    if (cmbProxyType.Items == null || cmbProxyType.Items.Count <= 0)
                        return FileTransferProxyType.None;  // ... and nothing can be selected -> just return the default
                    cmbProxyType.SelectedIndex = 0;         // ... and something can be selected -> select the first item as a side effect
                }
                return (FileTransferProxyType)cmbProxyType.SelectedValue;
            }
            set
            {
                cmbProxyType.SelectedValue = value;
            }
        }

        /// <summary>
        /// Gets or sets proxy host address.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ProxyHost
        {
            get { return tbProxyHost.Text; }
            set { tbProxyHost.Text = value; }
        }

        /// <summary>
        /// Gets or sets proxy port.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public int ProxyPort
        {
            get
            {
                int ret = 0;
                int.TryParse(tbProxyPort.Text, out ret);
                return ret;
            }
            set { tbProxyPort.Text = (value == 0) ? "" : value.ToString(); }
        }

        /// <summary>
        /// Gets or sets proxy login name.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ProxyUser
        {
            get { return tbProxyUsername.Text; }
            set { tbProxyUsername.Text = value; }
        }

        /// <summary>
        /// Gets or sets proxy login password.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ProxyPassword
        {
            get { return tbProxyPassword.Text; }
            set { tbProxyPassword.Text = value; }
        }

        #endregion 

        #region SSL specifics

        /// <summary>
        /// Gets or sets hash value used for validating SSL server certificate 
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public CertificateVerifyingMode ServerCertificateVerifyingMode
        {
            get 
            {
                if (rbServerCertificateAny.Checked)
                    return CertificateVerifyingMode.AcceptAnyCertificate;
                if (rbServerCertificateWindows.Checked)
                    return CertificateVerifyingMode.UseWindowsInfrastructure;
                if (rbServerCertificateStored.Checked)
                    return CertificateVerifyingMode.LocalyStoredThumbprint;
                if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                    return (CertificateVerifyingMode)0;    // we should not throw exception in design time - let's return some invalid value instead
                throw new InvalidOperationException("No CertfificateVerifyingMode has been chosen.");
            }
            set 
            {
                switch (value)
                {
                    case CertificateVerifyingMode.AcceptAnyCertificate:
                        rbServerCertificateAny.Checked = true;
                        break;
                    case CertificateVerifyingMode.UseWindowsInfrastructure:
                        rbServerCertificateWindows.Checked = true;
                        break;
                    case CertificateVerifyingMode.LocalyStoredThumbprint:
                        rbServerCertificateStored.Checked = true;
                        break;
                    default:
                        throw new InvalidOperationException(string.Format("Unexpected enum value '{0}'", value));
                }
            }
        }

        /// <summary>
        /// Gets or sets hash value used for validating SSL server certificate 
        /// (when <see cref="ServerCertificateVerifyingMode"/> is <c>LocalyStoredThumbprint</c>).
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ServerCertificateThumbprint
        {
            get { return tbServerCertificateThumbprint.Text; }
            set { tbServerCertificateThumbprint.Text = value; }
        }

        /// <summary>
        /// Gets or sets TLS/SSL protocol version.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public TlsVersion Protocol
        {
            set
            {
                cbAllowTls13.Checked = ((value & TlsVersion.TLS13) != 0);
                cbAllowTls12.Checked = ((value & TlsVersion.TLS12) != 0);
                cbAllowTls11.Checked = ((value & TlsVersion.TLS11) != 0);
                cbAllowTls10.Checked = ((value & TlsVersion.TLS10) != 0);
            }
            get
            {
                TlsVersion version = TlsVersion.None;
                if (cbAllowTls13.Checked)
                    version |= TlsVersion.TLS13;
                if (cbAllowTls12.Checked)
                    version |= TlsVersion.TLS12;
                if (cbAllowTls11.Checked)
                    version |= TlsVersion.TLS11;
                if (cbAllowTls10.Checked)
                    version |= TlsVersion.TLS10;
                return version;
            }
        }

        /// <summary>
        /// Gets or sets allowed secure suites.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public TlsCipherSuite AllowedSuite
        {
            get
            {
                if (cmbSuites.SelectedIndex == 0)
                    return TlsCipherSuite.All;
                else
                    return TlsCipherSuite.Secure;
            }
            set
            {
                if (value == TlsCipherSuite.All)
                    cmbSuites.SelectedIndex = 0;
                else
                    cmbSuites.SelectedIndex = 1;
            }
        }

        #endregion 

        #region SSH specifics

        /// <summary>
        /// Gets or sets fingerprint used for validating SSH server key
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public KeyVerifyingMode ServerKeyVerifyingMode
        {
            get
            {
                if (rbServerKeyAny.Checked)
                    return KeyVerifyingMode.AcceptAnyKey;
                if (rbServerKeyStored.Checked)
                    return KeyVerifyingMode.LocalyStoredFingerprint;
                if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                    return (KeyVerifyingMode)0;    // we should not throw an exception in design time - let's return some invalid value instead
                throw new InvalidOperationException("No KeyVerifyingMode has been chosen.");
            }
            set
            {
                switch (value)
                {
                    case KeyVerifyingMode.AcceptAnyKey:
                        rbServerKeyAny.Checked = true;
                        break;
                    case KeyVerifyingMode.LocalyStoredFingerprint:
                        rbServerKeyStored.Checked = true;
                        break;
                    default:
                        throw new InvalidOperationException(string.Format("Unexpected enum value '{0}'", value));
                }
            }
        }


        /// <summary>
        /// Gets or sets algorithm for server key used for verifying <see cref="ServerKeyFingerprint"/>
        /// (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public SshHostKeyAlgorithm ServerKeyAlgorithm
        {
            get
            {
                // if nothing is selected...
                if (cmbServerKeyAlgorithm.SelectedValue == null)
                {
                    if (cmbServerKeyAlgorithm.Items.Count <= 0)
                        return SshHostKeyAlgorithm.None;
                    cmbServerKeyAlgorithm.SelectedIndex = 0;    // ... select the first item
                }
                return (SshHostKeyAlgorithm)cmbServerKeyAlgorithm.SelectedValue;
            }
            set { cmbServerKeyAlgorithm.SelectedValue = value; }
        }

        /// <summary>
        /// Gets or sets hash algorithm used for <see cref="ServerKeyFingerprint"/>
        /// (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public SignatureHashAlgorithm ServerKeyHashAlgorithm
        {
            get
            {
                // if nothing is selected...
                if (cmbServerKeyHashAlgorithm.SelectedValue == null)
                {
                    if (cmbServerKeyHashAlgorithm.Items.Count <= 0)
                        return SignatureHashAlgorithm.Unsupported;
                    cmbServerKeyHashAlgorithm.SelectedIndex = 0;    // ... select the first item
                }
                return (SignatureHashAlgorithm)cmbServerKeyHashAlgorithm.SelectedValue;
            }
            set { cmbServerKeyHashAlgorithm.SelectedValue = value; }
        }


        /// <summary>
        /// Gets or sets fingerprint used for validating SSH server key
        /// (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ServerKeyFingerprint
        {
            get { return tbServerKeyFingerprint.Text; }
            set { tbServerKeyFingerprint.Text = value; }
        }

        /// <summary>
        /// Gets or sets allowed secure suites.
        /// </summary>
        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool AllowWeakSuites
        {
            get
            {
                if (cmbSshSuites.SelectedIndex == 0)
                    return true;
                else
                    return false;
            }
            set
            {
                if (value)
                    cmbSshSuites.SelectedIndex = 0;
                else
                    cmbSshSuites.SelectedIndex = 1;
            }
        }

        #endregion

        #region Transform from/to ConnectionData

        public void GetData(ConnectionData data)
        {
            if (data == null)
                throw new ArgumentNullException("data");

            data.ClearCommandChannel = ClearCommandChannel;
            data.ClientCertificate = ClientCertificate;
            data.ClientCertificateFilename = ClientCertificateFilename;
            data.PassiveMode = PassiveMode;
            data.PrivateKey = PrivateKey;
            data.PrivateKeyFilename = PrivateKeyFilename;
            data.ProxyHost = ProxyHost;
            data.ProxyPassword = ProxyPassword;
            data.ProxyPort = ProxyPort;
            data.ProxyType = ProxyType;
            data.ProxyUser = ProxyUser;
            data.FileTransferMode = FileTransferMode;
            data.ServerCertificateThumbprint = ServerCertificateThumbprint;
            data.ServerCertificateVerifyingMode = ServerCertificateVerifyingMode;
            data.ServerDomain = ServerDomain;
            data.ServerHost = ServerHost;
            data.ServerKeyAlgorithm = ServerKeyAlgorithm;
            data.ServerKeyFingerprint = ServerKeyFingerprint;
            data.ServerKeyHashAlgorithm = ServerKeyHashAlgorithm;
            data.ServerKeyVerifyingMode = ServerKeyVerifyingMode;
            data.ServerPassword = ServerPassword;
            data.ServerPort = ServerPort;
            data.ServerUser = ServerUser;
            data.StorePassword = StorePassword;
            data.UseGssApi = UseGssApi;
            data.AllowedSuite = AllowedSuite;
            data.AllowWeakSuites = AllowWeakSuites;
            data.TlsProtocol = Protocol;

        }

        public void SetData(ConnectionData data)
        {
            if (data == null)
                throw new ArgumentNullException("data");

            FileTransferMode = data.FileTransferMode;

            ServerHost = data.ServerHost;
            ServerPort = data.ServerPort;
            ServerPassword = data.ServerPassword;
            ServerUser = data.ServerUser;

            ClearCommandChannel = data.ClearCommandChannel;
            PassiveMode = data.PassiveMode;

            UseGssApi = data.UseGssApi;
            ServerDomain = data.ServerDomain;
    
            PrivateKey = data.PrivateKey;
            PrivateKeyFilename = data.PrivateKeyFilename;
            
            ProxyHost = data.ProxyHost;
            ProxyPassword = data.ProxyPassword;
            ProxyPort = data.ProxyPort;
            ProxyType = data.ProxyType;
            ProxyUser = data.ProxyUser;
            
            ServerKeyVerifyingMode = data.ServerKeyVerifyingMode;
            ServerKeyAlgorithm = data.ServerKeyAlgorithm;
            ServerKeyHashAlgorithm = data.ServerKeyHashAlgorithm;
            ServerKeyFingerprint = data.ServerKeyFingerprint;
            
            ServerCertificateVerifyingMode = data.ServerCertificateVerifyingMode;
            ServerCertificateThumbprint = data.ServerCertificateThumbprint;
            
            ClientCertificate = data.ClientCertificate;
            ClientCertificateFilename = data.ClientCertificateFilename;
            
            StorePassword = data.StorePassword;

            AllowedSuite = data.AllowedSuite;
            AllowWeakSuites = data.AllowWeakSuites;
            Protocol = data.TlsProtocol;
        }

        #endregion

        #endregion

        #region Visibility and accessibility properties

        /// <summary>
        /// Gets or sets information, whether controls and values used for FTP or FTP/SSL specific settings should be hidden.<br/>
        /// NOTE: Value does not affect controls directly, it is processed just once when initializing this user control.
        /// </summary>
        [Description("Hide controls and values used for FTP or FTP/SSL specific settings. (used when working in SFTP-only mode)")]
        [DefaultValue(false)]
        public bool HideFtpGui { set { _hideFtpGui = value; } get { return _hideFtpGui; } }
        private bool _hideFtpGui;

        /// <summary>
        /// Gets or sets information, whether controls and values used for SFTP specific settings should be hidden.<br/>
        /// NOTE: Value does not affect controls directly, it is processed just once when initializing this user control.
        /// </summary>
        [Description("Hide controls and values used for SFTP specific settings. (used when working in FTP-only mode)")]
        [DefaultValue(false)]
        public bool HideSftpGui { set { _hideSftpGui = value; } get { return _hideSftpGui; } }
        private bool _hideSftpGui;

        /// <summary>
        /// Gets information, whether checkbox "Passive mode" is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsPassiveEnabled
        {
            get { return FileTransferMode != FileTransferMode.Sftp; }
        }

        /// <summary>
        /// Gets information, whether GUI for settings of SFTP private key is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsPrivateKeyEnabled
        {
            get { return FileTransferMode == FileTransferMode.Sftp; }
        }

        /// <summary>
        /// Gets information, whether GUI for settings of SSL client certificate is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsClientCertificateEnabled
        {
            get
            {
                return FileTransferMode == FileTransferMode.FtpSslExplicit
                    || FileTransferMode == FileTransferMode.FtpSslImplicit
                    || FileTransferMode == FileTransferMode.Sftp;
            }
        }

        /// <summary>
        /// Gets information, whether checkbox "Use GSS API" is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsUseGssApiEnabled
        {
            get { return FileTransferMode == FileTransferMode.Sftp; }
        }

        /// <summary>
        /// Gets information, whether checkbox "Clear Command Channel" is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsClearCommandChannelEnabled
        {
            get
            {
                return FileTransferMode == FileTransferMode.FtpSslExplicit
                    || FileTransferMode == FileTransferMode.FtpSslImplicit;
            }
        }

        /// <summary>
        /// Gets information, whether the SSH tab is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsSshTabEnabled
        {
            get { return FileTransferMode == FileTransferMode.Sftp; }
        }

        /// <summary>
        /// Gets information, whether the SSL tab is currently enabled.
        /// </summary>
        [Browsable(false)]
        [DefaultValue(false)]
        public bool IsSslTabEnabled
        {
            get
            {
                return FileTransferMode == FileTransferMode.FtpSslExplicit
                    || FileTransferMode == FileTransferMode.FtpSslImplicit;
            }
        }

        #endregion

        #region Validation

        /// <summary>
        /// Validates all static rules. Returns collection of errors.
        /// </summary>
        /// <returns>Collection of error messages or empty collection on success.</returns>
        public List<string> GetValidationErrors()
        {
            List<string> errors = new List<string>();

            if (string.IsNullOrEmpty(ServerHost))
                errors.Add("Server host name is a required field.");
            if (ServerPort <= 0)
                errors.Add("Server port is a required non-zero field.");

            if (ProxyType != FileTransferProxyType.None)
            {
                if (string.IsNullOrEmpty(ProxyHost))
                    errors.Add("Proxy host name is a required field.");
                if (ProxyPort <= 0)
                    errors.Add("Proxy port is a required non-zero field.");

                if (FileTransferMode == FileTransferMode.FtpSslExplicit || FileTransferMode == FileTransferMode.FtpSslImplicit)
                {
                    FileTransferProxyType[] proxyWhenSecure = new FileTransferProxyType[] { FileTransferProxyType.Socks4, FileTransferProxyType.Socks4a, FileTransferProxyType.Socks5, FileTransferProxyType.HttpConnect };
                    bool ok = false;

                for (int i = 0; i < proxyWhenSecure.Length; i++)
                {
                    if (proxyWhenSecure[i] == ProxyType) 
                        ok = true;
                }

                if (!ok)
                    errors.Add("This proxy type is not allowed when using SSL.");
                }

            }

            if ((PrivateKey != null || !string.IsNullOrEmpty(PrivateKeyFilename)) && 
                (ClientCertificate != null || !string.IsNullOrEmpty(ClientCertificateFilename)))
                errors.Add("Private key and Client certificate cannot be used together.");

            return errors;
        }

        #endregion 

        #region GUI behavior methods

        /// <summary>
        /// Recomputes visibility of inner controls and values according to <see cref="HideFtpGui"/> and <see cref="HideSftpGui"/>,
        /// then removes all invisible controls from this user control 
        /// and adjusts height both of the user control and of the parent form where the user control is placed in.
        /// </summary>
        public void AdaptToCurrentVisibility()
        {
            // don't execute this method in design-time
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                return;

            RecalculateProtocolSpecificVisibility();

            BindComboBoxes();

            RecomputeProtocolSpecificFields();

            if (ParentForm == null)
                throw new InvalidOperationException("AdaptToCurrentVisibility can be called only if the user control is placed into some ParentForm.");

            // store current anchor settings and clear bottom and right anchor (that anchors would mess-up the resizing)
            AnchorStyles origAnchor = Anchor;
            Anchor = AnchorStyles.Left | AnchorStyles.Top;

            int heightDelta = ParentForm.Height - Height;
            RearrangeVisibleControls();

            ParentForm.Size = new Size(ParentForm.Width, Height + heightDelta);
            ParentForm.MinimumSize = new Size(ParentForm.MinimumSize.Width, ParentForm.Height);

            Anchor = origAnchor;
        }

        /// <summary>
        /// Fill lists in combo boxes
        /// </summary>
        private void BindComboBoxes()
        {
            // cmbProtocol
            List<FileTransferMode> protoclExclusions = null;
            if (HideFtpGui)
            {
                protoclExclusions = new List<FileTransferMode>();
                protoclExclusions.Add(FileTransferMode.Ftp);
                protoclExclusions.Add(FileTransferMode.FtpSslExplicit);
                protoclExclusions.Add(FileTransferMode.FtpSslImplicit);
            }
            if (HideSftpGui)
            {
                protoclExclusions = new List<FileTransferMode>();
                protoclExclusions.Add(FileTransferMode.Sftp);
            }

            ConnectionEditorUtils.BindComboWithEnum<FileTransferMode>(cmbProtocol, protoclExclusions);

            // cmbServerKeyAlgorithm
            if (!HideSftpGui)
            {
                List<SshHostKeyAlgorithm> hka = new List<SshHostKeyAlgorithm>();
                hka.Add(SshHostKeyAlgorithm.None);
                hka.Add(SshHostKeyAlgorithm.Any);
                hka.Add(SshHostKeyAlgorithm.Certificate);
                ConnectionEditorUtils.BindComboWithEnum<SshHostKeyAlgorithm>(cmbServerKeyAlgorithm, hka);
            }

            // cmbServerKeyHashAlgorithm
            if (!HideSftpGui)
            {
                List<SignatureHashAlgorithm> ha = new List<SignatureHashAlgorithm>();
                ha.Add(SignatureHashAlgorithm.MD5SHA1);
                ha.Add(SignatureHashAlgorithm.Unsupported);
                ConnectionEditorUtils.BindComboWithEnum<SignatureHashAlgorithm>(cmbServerKeyHashAlgorithm, ha);
            }

            // cmbProxyType
            RebindProxyTypeCombo();
        }

        /// <summary>
        /// Recalculates visibility of protocol specific controls according to 
        /// <see cref="HideFtpGui"/> and <see cref="HideSftpGui"/> property values.
        /// </summary>
        /// <remarks>
        /// NOTE: <see cref="HideFtpGui"/> and <see cref="HideSftpGui"/> property values affect also some listbox values etc (and they are not affected by this method).
        /// </remarks>
        private void RecalculateProtocolSpecificVisibility()
        {
            if (HideFtpGui && HideSftpGui)
                throw new InvalidOperationException("Both 'HideFtpGui' and 'HideStpGui' properties cannot be set to true.");

            if (HideFtpGui)
            {
                cbPassive.Visible =
                    pnlClearCommandChannel.Visible = false;
                tabControlMain.TabPages.RemoveByKey("tabSsl");
            }

            if (HideSftpGui)
            {
                pnlDomain.Visible =
                    cbUseGssApi.Visible =
                    pnlPrivateKey.Visible = false;
                tabControlMain.TabPages.RemoveByKey("tabSsh");
            }
        }

        /// <summary>
        /// Removes all invisible controls from this user control's docking containers
        /// and adjusts height of the containers and of this control according to current content.
        /// </summary>
        private void RearrangeVisibleControls()
        {
            // don't execute this method in design-time
            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
                return;

            int thisHeaderHeight = this.Height - tabControlMain.Height;
            // unfortunately, we cannot compute height of the remaining part of tab control using
            // tabControlMain.Height - tabControlMain.TabPages["tabServer"].Height;
            // because tabPage.Height is not affected by tabControl resizing performed by docking
            int tabHeaderHeight = 26;

            int maxHeight = 0;

            // tabServer
            RearrangeVisibleControls(grpConnection);
            RearrangeVisibleControls(grpCredentials);
            RearrangeVisibleControls(tabControlMain.TabPages["tabServer"]);
            if (tabControlMain.TabPages["tabServer"].Height > maxHeight)
                maxHeight = tabControlMain.TabPages["tabServer"].Height;

            // tabProxy
            RearrangeVisibleControls(tabControlMain.TabPages["tabProxy"]);
            if (tabControlMain.TabPages["tabProxy"].Height > maxHeight)
                maxHeight = tabControlMain.TabPages["tabProxy"].Height;

            // tabSsl
            if (tabControlMain.TabPages.ContainsKey("tabSsl"))
            {
                RearrangeVisibleControls(tabControlMain.TabPages["tabSsl"]);
                if (tabControlMain.TabPages["tabSsl"].Height > maxHeight)
                    maxHeight = tabControlMain.TabPages["tabSsl"].Height;
            }

            // tabSsh
            if (tabControlMain.TabPages.ContainsKey("tabSsh"))
            {
                RearrangeVisibleControls(tabControlMain.TabPages["tabSsh"]);
                if (tabControlMain.TabPages["tabSsh"].Height > maxHeight)
                    maxHeight = tabControlMain.TabPages["tabSsh"].Height;
            }


            this.SuspendLayout();
            tabControlMain.Size = new Size(tabControlMain.Width, maxHeight + tabHeaderHeight);
            this.Size = new Size(this.Width, tabControlMain.Height + thisHeaderHeight);
            this.MinimumSize = new Size(this.MinimumSize.Width, this.Height);
            this.ResumeLayout();

            OnHeightRecalculated();
        }

        /// <summary>
        /// Removes all invisible controls from given <paramref name="container"/>
        /// and adjusts height of the container up to the last visible control.<br/>
        /// Using <see cref="ControlsRearranging"/> or <see cref="ControlsRearranged"/> events it can be extended 
        /// to add new controls to the beginning or to the end of the controls collection.
        /// </summary>
        private void RearrangeVisibleControls(Control container)
        {
            container.SuspendLayout();

            // rebuild control collection - remove invisible controls
            ArrayList lst = new ArrayList(container.Controls);
            container.Controls.Clear();

            OnControlsRearranging(container);

            foreach (Control control in lst)
                if (control.Visible)
                    container.Controls.Add(control);

            OnControlsRearranged(container);

            container.ResumeLayout();
            
            // recalculate height of the container
            Control lastControl = container.Controls[0];    // docked controls are sorted in reversed order unlike the Controls collection order
            container.Size = new Size(container.Size.Width, lastControl.Location.Y + lastControl.Size.Height + container.Padding.Bottom);

        }

        /// <summary>
        /// Enables or disables some controls and resets default values of some controls depending on the currently set protocol.
        /// </summary>
        public void RecomputeProtocolSpecificFields()
        {
            cbPassive.Enabled = IsPassiveEnabled;
            pnlPrivateKey.Enabled = IsPrivateKeyEnabled;
            pnlClientCertificate.Enabled = IsClientCertificateEnabled;
            cbClearCommandChannel.Enabled = IsClearCommandChannelEnabled;
            RecomputeGssApiSpecificFields();

            if (!HideFtpGui)    // that property removes the whole tab page
                tabControlMain.TabPages["tabSsl"].Enabled = IsSslTabEnabled;
            if (!HideSftpGui)   // that property removes the whole tab page
                tabControlMain.TabPages["tabSsh"].Enabled = IsSshTabEnabled;
            FileTransferMode previousProtocolCopy = _previousMode;

            ConnectionEditorUtils.SetProtocol(
                _previousMode,
                FileTransferMode,
                delegate(FileTransferMode p) { _previousMode = p; },
                ServerPort,
                delegate(int p) { tbServerPort.Text = (p == 0) ? "" : p.ToString(); },
                ProxyType,
                delegate(FileTransferProxyType p) { ProxyType = p; }
            );

            if (FileTransferMode != previousProtocolCopy) RebindProxyTypeCombo();
        }

        /// <summary>
        /// (re)binds values of cmbProxyType according to current SecureFtpProtocol.
        /// Tries to keep the selected value.
        /// </summary>
        private void RebindProxyTypeCombo()
        {
            // store old selected value
            FileTransferProxyType oldValue = FileTransferProxyType.None;
            if (cmbProxyType.SelectedValue != null)
                oldValue = (FileTransferProxyType)cmbProxyType.SelectedValue;

            // rebind combo
            List<FileTransferProxyType> proxyExclusions = null;
            switch (FileTransferMode)
            {
                case FileTransferMode.Ftp:
                case FileTransferMode.FtpSslExplicit:
                case FileTransferMode.FtpSslImplicit:
                    // hide nothing
                    break;
                case FileTransferMode.Sftp:
                    proxyExclusions = new List<FileTransferProxyType>();
                    proxyExclusions.Add(FileTransferProxyType.FtpOpen);
                    proxyExclusions.Add(FileTransferProxyType.FtpSite);
                    proxyExclusions.Add(FileTransferProxyType.FtpUser);
                    break;
                default:
                    proxyExclusions = new List<FileTransferProxyType>();
                    // exclude anything except the "None" value
                    foreach (FileTransferProxyType item in Enum.GetValues(typeof(FileTransferProxyType)))
                    {
                        if (item == FileTransferProxyType.None)
                            continue;
                        proxyExclusions.Add(item);
                    }
                    break;
            }

            ConnectionEditorUtils.BindComboWithEnum<FileTransferProxyType>(cmbProxyType, proxyExclusions);

            // try to select previous value
            if (oldValue != FileTransferProxyType.None)
            {
                for (int i = 0; i < cmbProxyType.Items.Count; i++)
                {
                    Tuple<FileTransferProxyType, string> item = (Tuple<FileTransferProxyType, string>) cmbProxyType.Items[i];
                    if (item.First == oldValue)
                    {
                        cmbProxyType.SelectedIndex = i;
                        break;
                    }
                }
            }

            RecomputeProxySpecificFields();
        }

        private void RecomputeProxySpecificFields()
        {
            tbProxyHost.Enabled =
                tbProxyPort.Enabled =
                tbProxyUsername.Enabled =
                tbProxyPassword.Enabled =
                (ProxyType != FileTransferProxyType.None);
        }

        private void RecomputeGssApiSpecificFields()
        {
            cbUseGssApi.Enabled = IsUseGssApiEnabled;
            tbServerDomain.Enabled = IsUseGssApiEnabled && cbUseGssApi.Checked;
        }

        private void RefreshPrivateKeyField()
        {
            if (_privateKey != null)
                tbPrivateKey.Text = string.Format("Fingerprint: {0}", BitConverter.ToString(_privateKey.Fingerprint.ToArray(SignatureHashAlgorithm.MD5)));
            else if (!string.IsNullOrEmpty(_privateKeyFilename))
                tbPrivateKey.Text = string.Format("Load from: {0}", PrivateKeyFilename);
            else
                tbPrivateKey.Text = "";
        }

        private void RefreshClientCertificateField()
        {
            if (_clientCertificate != null)
                tbClientCertificate.Text = string.Format("CN: {0}, expires: {1:d}", _clientCertificate.LeafCertificate.GetCommonName(), _clientCertificate.LeafCertificate.GetExpirationDate());
            else if (!string.IsNullOrEmpty(_clientCertificateFilename))
                tbClientCertificate.Text = string.Format("Load from: {0}", ClientCertificateFilename);
            else
                tbClientCertificate.Text = "";
        }

        /// <summary>
        /// If the <see cref="ClientCertificateFilename"/> is defined, but the certificate has not been loaded to the <see cref="ClientCertificate"/> property, it loads the certificate.<br/>
        /// If the certificate requires a password, the method prompts for the password.
        /// </summary>
        /// <returns>False - an error has occurred.</returns>
        public bool EnsureClientCertificate()
        {
            if (ClientCertificate == null && !string.IsNullOrEmpty(ClientCertificateFilename))
                return LoadClientCertificate();
            return true;
        }

        /// <summary>
        /// Loads a certificate from the <paramref name="ClientCertificateFilename"/> into the <see cref="ClientCertificate"/> property.<br/>
        /// If the certificate requires a password, the method prompts for the password.
        /// </summary>
        /// <returns>True - the key certificate been loaded or an user does not want any certificate. False - an error occurred.</returns>
        private bool LoadClientCertificate()
        {
            try
            {
                // try to load the certificate 
                CertificateChain certificate = null;
                // (first attempt will be with empty password - only if it won't succeed, we will prompt for the password
                bool firstAttempt = true;
                string password = "";
                while (certificate == null)
                {
                    try
                    {
                        ClientCertificate = CertificateChain.LoadPfx(ClientCertificateFilename, password, KeySetOptions.Exportable);
                        // success
                        return true;
                    }
                    // handle invalid password
                    catch (CertificateException ex)
                    {
                        if (ex.Message != "PFX password is not valid.")
                        {
                            ConnectionEditorUtils.ShowException("Error occurred when importing certificate.", "Import failed", ex);
                            return false;
                        }
                        PassphraseDialog pd = new PassphraseDialog(firstAttempt ? "The certificate is password protected.\r\nEnter the certificate password:" : "The password is wrong.\r\nEnter again?");
                        pd.Size = new Size(pd.Width, pd.Height + 13);    // add extra line for the 2-lines password prompt
                        if (pd.ShowDialog() != DialogResult.OK)
                            return true;
                        password = pd.Passphrase;
                        firstAttempt = false;
                    }
                    catch (Exception ex)
                    {
                        ConnectionEditorUtils.ShowException("Error occurred when importing certificate.", "Import failed", ex);
                        return false;
                    }
                }
                return false; // never reached
            }
            finally
            {
                // once the certificate has not been successfully loaded, clear the stored filename
                if (ClientCertificate == null)
                    ClientCertificateFilename = null;
            }
        }

        /// <summary>
        /// If the <see cref="PrivateKeyFilename"/> is defined, but the key has not been loaded to the <see cref="PrivateKey"/> property, it loads the key.<br/>
        /// If the key requires a password, the method prompts for the password.
        /// </summary>
        /// <returns>False - an error has occurred.</returns>
        public bool EnsurePrivateKey()
        {
            if (PrivateKey == null && !string.IsNullOrEmpty(PrivateKeyFilename))
                return LoadPrivateKey();
            return true;
        }
        /// <summary>
        /// Loads a key from the <see cref="PrivateKeyFilename"/> into the <see cref="PrivateKey"/> property.<br/>
        /// If the key requires a password, the method prompts for the password.
        /// </summary>
        /// <returns>True - the key has been loaded or an user does not want any key. False - an error occurred.</returns>
        private bool LoadPrivateKey()
        {
            try
            {
                // try to load the key 
                SshPrivateKey key = null;
                // (first attempt will be with empty password - only if it won't succeed, we will prompt for the password
                bool firstAttempt = true;
                string password = "";
                while (key == null)
                {
                    try
                    {
                        PrivateKey = new SshPrivateKey(PrivateKeyFilename, password);
                        // success
                        return true;
                    }
                    // handle invalid password
                    catch (System.Security.Cryptography.CryptographicException ex)
                    {
                        if (ex.Message != "Invalid password or bad data.")
                        {
                            ConnectionEditorUtils.ShowException("Error occured when importing key.", "Import failed", ex);
                            return false;
                        }
                        PassphraseDialog pd = new PassphraseDialog(firstAttempt ? "The private key is password protected.\r\nEnter the private key password:" : "The password is wrong.\r\nEnter again?");
                        pd.Size = new Size(pd.Width, pd.Height + 13);    // add extra line for the 2-lines password prompt
                        if (pd.ShowDialog() != DialogResult.OK)
                        {
                            PrivateKeyFilename = "";
                            return true;
                        }
                        password = pd.Passphrase;
                        firstAttempt = false;
                    }
                    catch (Exception ex)
                    {
                        PrivateKeyFilename = "";
                        ConnectionEditorUtils.ShowException("Error occured when importing key.", "Import failed", ex);
                        return false;
                    }
                }
                return false;        // never reached
            }
            finally
            {
                // once the key has not been successfully loaded, clear the stored filename
                if (PrivateKey == null)
                    PrivateKeyFilename = null;
            }
        }

        #endregion

        #region Event handlers

        private void OnHeightRecalculated()
        {
            if (HeightRecalculated != null)
                HeightRecalculated(this, EventArgs.Empty);
        }

        private void OnControlsRearranging(object sender)
        {
            if (ControlsRearranging != null)
                ControlsRearranging(sender, EventArgs.Empty);
        }

        private void OnControlsRearranged(object sender)
        {
            if (ControlsRearranged != null)
                ControlsRearranged(sender, EventArgs.Empty);
        }

        private void cmbProtocol_SelectedIndexChanged(object sender, EventArgs e)
        {
            RecomputeProtocolSpecificFields();
        }

        private void cmbProxyType_SelectedIndexChanged(object sender, EventArgs e)
        {
            RecomputeProxySpecificFields();
        }

        private void cbUseGssApi_CheckedChanged(object sender, EventArgs e)
        {
            if (!cbUseGssApi.Checked)      // when clearing GssApi checbox...
                tbServerDomain.Text = "";  // ...clear the domain name as well
            RecomputeGssApiSpecificFields();
        }

        private void tbServerHostOrPort_TextChanged(object sender, EventArgs e)
        {
            // since we are using another server, clear server certificate or fingerprint
            switch (FileTransferMode)
            {
                case FileTransferMode.FtpSslExplicit:
                case FileTransferMode.FtpSslImplicit:
                    ServerCertificateThumbprint = "";
                    break;
                case FileTransferMode.Sftp:
                    ServerKeyFingerprint = "";
                    break;
            }
        }

        private void btnImportClientCertificate_Click(object sender, EventArgs e)
        {
            // ask for certificate
            ImportCertificateDialog import = new ImportCertificateDialog();

            if (import.ShowDialog() == DialogResult.OK)
            {
                ClientCertificateFilename = import.ClientCertificateFilename;
                ClientCertificate = import.ClientCertificate;
            }
        }

        private void btnViewClientCertificate_Click(object sender, EventArgs e)
        {
            EnsureClientCertificate();

            if (ClientCertificate == null)
            {
                ConnectionEditorUtils.ShowWarning("No certificate has been defined.", "View certificate");
                return;
            }

            X509Certificate2UI.DisplayCertificate(new X509Certificate2(ClientCertificate.LeafCertificate.GetRawCertData()));
        }

        private void btnClearClientCertificate_Click(object sender, EventArgs e)
        {
            ClientCertificate = null;
            ClientCertificateFilename = "";
        }

        private void btnImportPrivateKey_Click(object sender, EventArgs e)
        {
            // ask for private key file
            OpenFileDialog fd = new OpenFileDialog();
            fd.Title = "Choose private key file";
            if (fd.ShowDialog() != DialogResult.OK)
                return;
            PrivateKeyFilename = fd.FileName;
            LoadPrivateKey();
        }

        private void btnClearPrivateKey_Click(object sender, EventArgs e)
        {
            PrivateKey = null;
            PrivateKeyFilename = "";
        }

        protected virtual void rbServerCertificateStored_CheckedChanged(object sender, EventArgs e)
        {
            pnlLocalyStoredCertificate.Enabled = rbServerCertificateStored.Checked;
        }

        protected virtual void rbServerKeyStored_CheckedChanged(object sender, EventArgs e)
        {
            pnlLocalyStoredKey.Enabled = rbServerKeyStored.Checked;
        }

        private void cmbServerKeyHashAlgorithm_SelectedValueChanged(object sender, EventArgs e)
        {
            ServerKeyFingerprint = "";
        }

        #endregion


        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.tabControlMain = new System.Windows.Forms.TabControl();
            this.tabServer = new System.Windows.Forms.TabPage();
            this.grpCredentials = new System.Windows.Forms.GroupBox();
            this.pnlClearCommandChannel = new System.Windows.Forms.Panel();
            this.cbClearCommandChannel = new System.Windows.Forms.CheckBox();
            this.pnlPrivateKey = new System.Windows.Forms.Panel();
            this.lblPrivateKey = new System.Windows.Forms.Label();
            this.btnClearPrivateKey = new System.Windows.Forms.Button();
            this.tbPrivateKey = new System.Windows.Forms.TextBox();
            this.btnImportPrivateKey = new System.Windows.Forms.Button();
            this.pnlClientCertificate = new System.Windows.Forms.Panel();
            this.label8 = new System.Windows.Forms.Label();
            this.btnClearClientCertificate = new System.Windows.Forms.Button();
            this.tbClientCertificate = new System.Windows.Forms.TextBox();
            this.btnViewClientCertificate = new System.Windows.Forms.Button();
            this.btnImportClientCertificate = new System.Windows.Forms.Button();
            this.pnlDomain = new System.Windows.Forms.Panel();
            this.tbServerDomain = new System.Windows.Forms.TextBox();
            this.lblDomain = new System.Windows.Forms.Label();
            this.pnlUsernamePassword = new System.Windows.Forms.Panel();
            this.cbStorePassword = new System.Windows.Forms.CheckBox();
            this.cbUseGssApi = new System.Windows.Forms.CheckBox();
            this.tbServerUser = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.tbServerPassword = new System.Windows.Forms.TextBox();
            this.grpConnection = new System.Windows.Forms.GroupBox();
            this.pnlHostnameProtocol = new System.Windows.Forms.Panel();
            this.cbPassive = new System.Windows.Forms.CheckBox();
            this.tbServerPort = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.cmbProtocol = new System.Windows.Forms.ComboBox();
            this.tbServerHost = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.tabProxy = new System.Windows.Forms.TabPage();
            this.pnlProxy = new System.Windows.Forms.Panel();
            this.label19 = new System.Windows.Forms.Label();
            this.tbProxyUsername = new System.Windows.Forms.TextBox();
            this.label11 = new System.Windows.Forms.Label();
            this.cmbProxyType = new System.Windows.Forms.ComboBox();
            this.label13 = new System.Windows.Forms.Label();
            this.label14 = new System.Windows.Forms.Label();
            this.tbProxyPassword = new System.Windows.Forms.TextBox();
            this.tbProxyPort = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.tbProxyHost = new System.Windows.Forms.TextBox();
            this.label12 = new System.Windows.Forms.Label();
            this.tabSsl = new System.Windows.Forms.TabPage();
            this.panel1 = new System.Windows.Forms.Panel();
            this.cmbSuites = new System.Windows.Forms.ComboBox();
            this.cbAllowTls13 = new System.Windows.Forms.CheckBox();
            this.cbAllowTls12 = new System.Windows.Forms.CheckBox();
            this.cbAllowTls11 = new System.Windows.Forms.CheckBox();
            this.cbAllowTls10 = new System.Windows.Forms.CheckBox();
            this.label23 = new System.Windows.Forms.Label();
            this.label22 = new System.Windows.Forms.Label();
            this.pnlServerCertificate = new System.Windows.Forms.Panel();
            this.pnlLocalyStoredCertificate = new System.Windows.Forms.Panel();
            this.label9 = new System.Windows.Forms.Label();
            this.tbServerCertificateThumbprint = new System.Windows.Forms.TextBox();
            this.label10 = new System.Windows.Forms.Label();
            this.rbServerCertificateAny = new System.Windows.Forms.RadioButton();
            this.rbServerCertificateStored = new System.Windows.Forms.RadioButton();
            this.rbServerCertificateWindows = new System.Windows.Forms.RadioButton();
            this.label7 = new System.Windows.Forms.Label();
            this.tabSsh = new System.Windows.Forms.TabPage();
            this.pnlServerKey = new System.Windows.Forms.Panel();
            this.cmbSshSuites = new System.Windows.Forms.ComboBox();
            this.label24 = new System.Windows.Forms.Label();
            this.pnlLocalyStoredKey = new System.Windows.Forms.Panel();
            this.label21 = new System.Windows.Forms.Label();
            this.label20 = new System.Windows.Forms.Label();
            this.cmbServerKeyAlgorithm = new System.Windows.Forms.ComboBox();
            this.label18 = new System.Windows.Forms.Label();
            this.tbServerKeyFingerprint = new System.Windows.Forms.TextBox();
            this.cmbServerKeyHashAlgorithm = new System.Windows.Forms.ComboBox();
            this.label15 = new System.Windows.Forms.Label();
            this.label16 = new System.Windows.Forms.Label();
            this.rbServerKeyAny = new System.Windows.Forms.RadioButton();
            this.rbServerKeyStored = new System.Windows.Forms.RadioButton();
            this.label17 = new System.Windows.Forms.Label();
            this.tabControlMain.SuspendLayout();
            this.tabServer.SuspendLayout();
            this.grpCredentials.SuspendLayout();
            this.pnlClearCommandChannel.SuspendLayout();
            this.pnlPrivateKey.SuspendLayout();
            this.pnlClientCertificate.SuspendLayout();
            this.pnlDomain.SuspendLayout();
            this.pnlUsernamePassword.SuspendLayout();
            this.grpConnection.SuspendLayout();
            this.pnlHostnameProtocol.SuspendLayout();
            this.tabProxy.SuspendLayout();
            this.pnlProxy.SuspendLayout();
            this.tabSsl.SuspendLayout();
            this.panel1.SuspendLayout();
            this.pnlServerCertificate.SuspendLayout();
            this.pnlLocalyStoredCertificate.SuspendLayout();
            this.tabSsh.SuspendLayout();
            this.pnlServerKey.SuspendLayout();
            this.pnlLocalyStoredKey.SuspendLayout();
            this.SuspendLayout();
            // 
            // tabControlMain
            // 
            this.tabControlMain.Controls.Add(this.tabServer);
            this.tabControlMain.Controls.Add(this.tabProxy);
            this.tabControlMain.Controls.Add(this.tabSsl);
            this.tabControlMain.Controls.Add(this.tabSsh);
            this.tabControlMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tabControlMain.Location = new System.Drawing.Point(0, 0);
            this.tabControlMain.Name = "tabControlMain";
            this.tabControlMain.SelectedIndex = 0;
            this.tabControlMain.Size = new System.Drawing.Size(620, 357);
            this.tabControlMain.TabIndex = 1008;
            // 
            // tabServer
            // 
            this.tabServer.BackColor = System.Drawing.SystemColors.Control;
            this.tabServer.Controls.Add(this.grpCredentials);
            this.tabServer.Controls.Add(this.grpConnection);
            this.tabServer.Location = new System.Drawing.Point(4, 22);
            this.tabServer.Name = "tabServer";
            this.tabServer.Padding = new System.Windows.Forms.Padding(3);
            this.tabServer.Size = new System.Drawing.Size(612, 331);
            this.tabServer.TabIndex = 0;
            this.tabServer.Text = "Server";
            // 
            // grpCredentials
            // 
            this.grpCredentials.BackColor = System.Drawing.Color.Transparent;
            this.grpCredentials.Controls.Add(this.pnlClearCommandChannel);
            this.grpCredentials.Controls.Add(this.pnlPrivateKey);
            this.grpCredentials.Controls.Add(this.pnlClientCertificate);
            this.grpCredentials.Controls.Add(this.pnlDomain);
            this.grpCredentials.Controls.Add(this.pnlUsernamePassword);
            this.grpCredentials.Dock = System.Windows.Forms.DockStyle.Top;
            this.grpCredentials.Location = new System.Drawing.Point(3, 114);
            this.grpCredentials.Name = "grpCredentials";
            this.grpCredentials.Size = new System.Drawing.Size(606, 172);
            this.grpCredentials.TabIndex = 1;
            this.grpCredentials.TabStop = false;
            this.grpCredentials.Text = "Credentials";
            // 
            // pnlClearCommandChannel
            // 
            this.pnlClearCommandChannel.Controls.Add(this.cbClearCommandChannel);
            this.pnlClearCommandChannel.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlClearCommandChannel.Location = new System.Drawing.Point(3, 137);
            this.pnlClearCommandChannel.Name = "pnlClearCommandChannel";
            this.pnlClearCommandChannel.Size = new System.Drawing.Size(600, 23);
            this.pnlClearCommandChannel.TabIndex = 4;
            // 
            // cbClearCommandChannel
            // 
            this.cbClearCommandChannel.AutoSize = true;
            this.cbClearCommandChannel.Location = new System.Drawing.Point(99, 3);
            this.cbClearCommandChannel.Name = "cbClearCommandChannel";
            this.cbClearCommandChannel.Size = new System.Drawing.Size(140, 17);
            this.cbClearCommandChannel.TabIndex = 0;
            this.cbClearCommandChannel.Text = "Clear command channel";
            this.cbClearCommandChannel.UseVisualStyleBackColor = true;
            // 
            // pnlPrivateKey
            // 
            this.pnlPrivateKey.Controls.Add(this.lblPrivateKey);
            this.pnlPrivateKey.Controls.Add(this.btnClearPrivateKey);
            this.pnlPrivateKey.Controls.Add(this.tbPrivateKey);
            this.pnlPrivateKey.Controls.Add(this.btnImportPrivateKey);
            this.pnlPrivateKey.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlPrivateKey.Location = new System.Drawing.Point(3, 114);
            this.pnlPrivateKey.Name = "pnlPrivateKey";
            this.pnlPrivateKey.Size = new System.Drawing.Size(600, 23);
            this.pnlPrivateKey.TabIndex = 3;
            // 
            // lblPrivateKey
            // 
            this.lblPrivateKey.AutoSize = true;
            this.lblPrivateKey.Location = new System.Drawing.Point(3, 5);
            this.lblPrivateKey.Name = "lblPrivateKey";
            this.lblPrivateKey.Size = new System.Drawing.Size(63, 13);
            this.lblPrivateKey.TabIndex = 13;
            this.lblPrivateKey.Text = "Private key:";
            // 
            // btnClearPrivateKey
            // 
            this.btnClearPrivateKey.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnClearPrivateKey.Location = new System.Drawing.Point(557, 0);
            this.btnClearPrivateKey.Name = "btnClearPrivateKey";
            this.btnClearPrivateKey.Size = new System.Drawing.Size(40, 23);
            this.btnClearPrivateKey.TabIndex = 1;
            this.btnClearPrivateKey.Text = "Clear";
            this.btnClearPrivateKey.UseVisualStyleBackColor = true;
            this.btnClearPrivateKey.Click += new System.EventHandler(this.btnClearPrivateKey_Click);
            // 
            // tbPrivateKey
            // 
            this.tbPrivateKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbPrivateKey.Location = new System.Drawing.Point(99, 2);
            this.tbPrivateKey.Name = "tbPrivateKey";
            this.tbPrivateKey.ReadOnly = true;
            this.tbPrivateKey.Size = new System.Drawing.Size(339, 20);
            this.tbPrivateKey.TabIndex = 0;
            this.tbPrivateKey.TabStop = false;
            // 
            // btnImportPrivateKey
            // 
            this.btnImportPrivateKey.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnImportPrivateKey.Location = new System.Drawing.Point(444, 0);
            this.btnImportPrivateKey.Name = "btnImportPrivateKey";
            this.btnImportPrivateKey.Size = new System.Drawing.Size(55, 23);
            this.btnImportPrivateKey.TabIndex = 0;
            this.btnImportPrivateKey.Text = "Import...";
            this.btnImportPrivateKey.UseVisualStyleBackColor = true;
            this.btnImportPrivateKey.Click += new System.EventHandler(this.btnImportPrivateKey_Click);
            // 
            // pnlClientCertificate
            // 
            this.pnlClientCertificate.Controls.Add(this.label8);
            this.pnlClientCertificate.Controls.Add(this.btnClearClientCertificate);
            this.pnlClientCertificate.Controls.Add(this.tbClientCertificate);
            this.pnlClientCertificate.Controls.Add(this.btnViewClientCertificate);
            this.pnlClientCertificate.Controls.Add(this.btnImportClientCertificate);
            this.pnlClientCertificate.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlClientCertificate.Location = new System.Drawing.Point(3, 91);
            this.pnlClientCertificate.Name = "pnlClientCertificate";
            this.pnlClientCertificate.Size = new System.Drawing.Size(600, 23);
            this.pnlClientCertificate.TabIndex = 2;
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(3, 5);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(85, 13);
            this.label8.TabIndex = 13;
            this.label8.Text = "Client certificate:";
            // 
            // btnClearClientCertificate
            // 
            this.btnClearClientCertificate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnClearClientCertificate.Location = new System.Drawing.Point(557, 0);
            this.btnClearClientCertificate.Name = "btnClearClientCertificate";
            this.btnClearClientCertificate.Size = new System.Drawing.Size(40, 23);
            this.btnClearClientCertificate.TabIndex = 2;
            this.btnClearClientCertificate.Text = "Clear";
            this.btnClearClientCertificate.UseVisualStyleBackColor = true;
            this.btnClearClientCertificate.Click += new System.EventHandler(this.btnClearClientCertificate_Click);
            // 
            // tbClientCertificate
            // 
            this.tbClientCertificate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbClientCertificate.Location = new System.Drawing.Point(99, 2);
            this.tbClientCertificate.Name = "tbClientCertificate";
            this.tbClientCertificate.ReadOnly = true;
            this.tbClientCertificate.Size = new System.Drawing.Size(339, 20);
            this.tbClientCertificate.TabIndex = 0;
            this.tbClientCertificate.TabStop = false;
            // 
            // btnViewClientCertificate
            // 
            this.btnViewClientCertificate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnViewClientCertificate.Location = new System.Drawing.Point(505, 0);
            this.btnViewClientCertificate.Name = "btnViewClientCertificate";
            this.btnViewClientCertificate.Size = new System.Drawing.Size(48, 23);
            this.btnViewClientCertificate.TabIndex = 1;
            this.btnViewClientCertificate.Text = "View...";
            this.btnViewClientCertificate.UseVisualStyleBackColor = true;
            this.btnViewClientCertificate.Click += new System.EventHandler(this.btnViewClientCertificate_Click);
            // 
            // btnImportClientCertificate
            // 
            this.btnImportClientCertificate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnImportClientCertificate.Location = new System.Drawing.Point(444, 0);
            this.btnImportClientCertificate.Name = "btnImportClientCertificate";
            this.btnImportClientCertificate.Size = new System.Drawing.Size(55, 23);
            this.btnImportClientCertificate.TabIndex = 0;
            this.btnImportClientCertificate.Text = "Import...";
            this.btnImportClientCertificate.UseVisualStyleBackColor = true;
            this.btnImportClientCertificate.Click += new System.EventHandler(this.btnImportClientCertificate_Click);
            // 
            // pnlDomain
            // 
            this.pnlDomain.Controls.Add(this.tbServerDomain);
            this.pnlDomain.Controls.Add(this.lblDomain);
            this.pnlDomain.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlDomain.Location = new System.Drawing.Point(3, 68);
            this.pnlDomain.Name = "pnlDomain";
            this.pnlDomain.Size = new System.Drawing.Size(600, 23);
            this.pnlDomain.TabIndex = 1;
            // 
            // tbServerDomain
            // 
            this.tbServerDomain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerDomain.Location = new System.Drawing.Point(99, 2);
            this.tbServerDomain.Name = "tbServerDomain";
            this.tbServerDomain.Size = new System.Drawing.Size(339, 20);
            this.tbServerDomain.TabIndex = 0;
            // 
            // lblDomain
            // 
            this.lblDomain.AutoSize = true;
            this.lblDomain.Location = new System.Drawing.Point(3, 5);
            this.lblDomain.Name = "lblDomain";
            this.lblDomain.Size = new System.Drawing.Size(46, 13);
            this.lblDomain.TabIndex = 13;
            this.lblDomain.Text = "Domain:";
            // 
            // pnlUsernamePassword
            // 
            this.pnlUsernamePassword.Controls.Add(this.cbStorePassword);
            this.pnlUsernamePassword.Controls.Add(this.cbUseGssApi);
            this.pnlUsernamePassword.Controls.Add(this.tbServerUser);
            this.pnlUsernamePassword.Controls.Add(this.label4);
            this.pnlUsernamePassword.Controls.Add(this.label5);
            this.pnlUsernamePassword.Controls.Add(this.tbServerPassword);
            this.pnlUsernamePassword.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlUsernamePassword.Location = new System.Drawing.Point(3, 16);
            this.pnlUsernamePassword.Name = "pnlUsernamePassword";
            this.pnlUsernamePassword.Size = new System.Drawing.Size(600, 52);
            this.pnlUsernamePassword.TabIndex = 0;
            // 
            // cbStorePassword
            // 
            this.cbStorePassword.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cbStorePassword.AutoSize = true;
            this.cbStorePassword.Location = new System.Drawing.Point(444, 30);
            this.cbStorePassword.Name = "cbStorePassword";
            this.cbStorePassword.Size = new System.Drawing.Size(99, 17);
            this.cbStorePassword.TabIndex = 15;
            this.cbStorePassword.TabStop = false;
            this.cbStorePassword.Text = "Store password";
            this.cbStorePassword.UseVisualStyleBackColor = true;
            // 
            // cbUseGssApi
            // 
            this.cbUseGssApi.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cbUseGssApi.AutoSize = true;
            this.cbUseGssApi.Location = new System.Drawing.Point(444, 4);
            this.cbUseGssApi.Name = "cbUseGssApi";
            this.cbUseGssApi.Size = new System.Drawing.Size(87, 17);
            this.cbUseGssApi.TabIndex = 14;
            this.cbUseGssApi.TabStop = false;
            this.cbUseGssApi.Text = "Use GSSAPI";
            this.cbUseGssApi.UseVisualStyleBackColor = true;
            this.cbUseGssApi.CheckedChanged += new System.EventHandler(this.cbUseGssApi_CheckedChanged);
            // 
            // tbServerUser
            // 
            this.tbServerUser.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerUser.Location = new System.Drawing.Point(99, 2);
            this.tbServerUser.Name = "tbServerUser";
            this.tbServerUser.Size = new System.Drawing.Size(339, 20);
            this.tbServerUser.TabIndex = 0;
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(3, 5);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(61, 13);
            this.label4.TabIndex = 11;
            this.label4.Text = "User name:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(3, 31);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(56, 13);
            this.label5.TabIndex = 11;
            this.label5.Text = "Password:";
            // 
            // tbServerPassword
            // 
            this.tbServerPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerPassword.Location = new System.Drawing.Point(99, 28);
            this.tbServerPassword.Name = "tbServerPassword";
            this.tbServerPassword.PasswordChar = '*';
            this.tbServerPassword.Size = new System.Drawing.Size(339, 20);
            this.tbServerPassword.TabIndex = 1;
            // 
            // grpConnection
            // 
            this.grpConnection.Controls.Add(this.pnlHostnameProtocol);
            this.grpConnection.Dock = System.Windows.Forms.DockStyle.Top;
            this.grpConnection.Location = new System.Drawing.Point(3, 3);
            this.grpConnection.Name = "grpConnection";
            this.grpConnection.Size = new System.Drawing.Size(606, 111);
            this.grpConnection.TabIndex = 0;
            this.grpConnection.TabStop = false;
            this.grpConnection.Text = "Connection";
            // 
            // pnlHostnameProtocol
            // 
            this.pnlHostnameProtocol.Controls.Add(this.cbPassive);
            this.pnlHostnameProtocol.Controls.Add(this.tbServerPort);
            this.pnlHostnameProtocol.Controls.Add(this.label3);
            this.pnlHostnameProtocol.Controls.Add(this.label1);
            this.pnlHostnameProtocol.Controls.Add(this.cmbProtocol);
            this.pnlHostnameProtocol.Controls.Add(this.tbServerHost);
            this.pnlHostnameProtocol.Controls.Add(this.label2);
            this.pnlHostnameProtocol.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlHostnameProtocol.Location = new System.Drawing.Point(3, 16);
            this.pnlHostnameProtocol.Margin = new System.Windows.Forms.Padding(0);
            this.pnlHostnameProtocol.Name = "pnlHostnameProtocol";
            this.pnlHostnameProtocol.Size = new System.Drawing.Size(600, 55);
            this.pnlHostnameProtocol.TabIndex = 138;
            // 
            // cbPassive
            // 
            this.cbPassive.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cbPassive.AutoSize = true;
            this.cbPassive.Location = new System.Drawing.Point(444, 32);
            this.cbPassive.Name = "cbPassive";
            this.cbPassive.Size = new System.Drawing.Size(92, 17);
            this.cbPassive.TabIndex = 3;
            this.cbPassive.Text = "Passive mode";
            this.cbPassive.UseVisualStyleBackColor = true;
            // 
            // tbServerPort
            // 
            this.tbServerPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerPort.Location = new System.Drawing.Point(468, 3);
            this.tbServerPort.Name = "tbServerPort";
            this.tbServerPort.Size = new System.Drawing.Size(129, 20);
            this.tbServerPort.TabIndex = 1;
            this.tbServerPort.TextChanged += new System.EventHandler(this.tbServerHostOrPort_TextChanged);
            // 
            // label3
            // 
            this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(441, 6);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(29, 13);
            this.label3.TabIndex = 27;
            this.label3.Text = "Port:";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(3, 33);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(49, 13);
            this.label1.TabIndex = 26;
            this.label1.Text = "Protocol:";
            // 
            // cmbProtocol
            // 
            this.cmbProtocol.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbProtocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbProtocol.FormattingEnabled = true;
            this.cmbProtocol.Location = new System.Drawing.Point(99, 30);
            this.cmbProtocol.Name = "cmbProtocol";
            this.cmbProtocol.Size = new System.Drawing.Size(339, 21);
            this.cmbProtocol.TabIndex = 2;
            this.cmbProtocol.SelectedIndexChanged += new System.EventHandler(this.cmbProtocol_SelectedIndexChanged);
            // 
            // tbServerHost
            // 
            this.tbServerHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerHost.Location = new System.Drawing.Point(99, 3);
            this.tbServerHost.Name = "tbServerHost";
            this.tbServerHost.Size = new System.Drawing.Size(339, 20);
            this.tbServerHost.TabIndex = 0;
            this.tbServerHost.TextChanged += new System.EventHandler(this.tbServerHostOrPort_TextChanged);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(3, 6);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(61, 13);
            this.label2.TabIndex = 25;
            this.label2.Text = "Host name:";
            // 
            // tabProxy
            // 
            this.tabProxy.BackColor = System.Drawing.SystemColors.Control;
            this.tabProxy.Controls.Add(this.pnlProxy);
            this.tabProxy.Location = new System.Drawing.Point(4, 22);
            this.tabProxy.Name = "tabProxy";
            this.tabProxy.Padding = new System.Windows.Forms.Padding(3);
            this.tabProxy.Size = new System.Drawing.Size(612, 331);
            this.tabProxy.TabIndex = 1;
            this.tabProxy.Text = "Proxy";
            // 
            // pnlProxy
            // 
            this.pnlProxy.Controls.Add(this.label19);
            this.pnlProxy.Controls.Add(this.tbProxyUsername);
            this.pnlProxy.Controls.Add(this.label11);
            this.pnlProxy.Controls.Add(this.cmbProxyType);
            this.pnlProxy.Controls.Add(this.label13);
            this.pnlProxy.Controls.Add(this.label14);
            this.pnlProxy.Controls.Add(this.tbProxyPassword);
            this.pnlProxy.Controls.Add(this.tbProxyPort);
            this.pnlProxy.Controls.Add(this.label6);
            this.pnlProxy.Controls.Add(this.tbProxyHost);
            this.pnlProxy.Controls.Add(this.label12);
            this.pnlProxy.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlProxy.Location = new System.Drawing.Point(3, 3);
            this.pnlProxy.Margin = new System.Windows.Forms.Padding(0);
            this.pnlProxy.Name = "pnlProxy";
            this.pnlProxy.Size = new System.Drawing.Size(606, 116);
            this.pnlProxy.TabIndex = 139;
            // 
            // label19
            // 
            this.label19.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label19.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.label19.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
            this.label19.Location = new System.Drawing.Point(446, 60);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(157, 43);
            this.label19.TabIndex = 125;
            this.label19.Text = "Leave the \'User name\' and \'Password\' fields empty when not needed.";
            // 
            // tbProxyUsername
            // 
            this.tbProxyUsername.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbProxyUsername.Location = new System.Drawing.Point(99, 57);
            this.tbProxyUsername.Name = "tbProxyUsername";
            this.tbProxyUsername.Size = new System.Drawing.Size(339, 20);
            this.tbProxyUsername.TabIndex = 3;
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(3, 7);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(59, 13);
            this.label11.TabIndex = 26;
            this.label11.Text = "Proxy type:";
            // 
            // cmbProxyType
            // 
            this.cmbProxyType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.cmbProxyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbProxyType.FormattingEnabled = true;
            this.cmbProxyType.Location = new System.Drawing.Point(99, 4);
            this.cmbProxyType.Name = "cmbProxyType";
            this.cmbProxyType.Size = new System.Drawing.Size(339, 21);
            this.cmbProxyType.TabIndex = 0;
            this.cmbProxyType.SelectedIndexChanged += new System.EventHandler(this.cmbProxyType_SelectedIndexChanged);
            // 
            // label13
            // 
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(3, 60);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(61, 13);
            this.label13.TabIndex = 122;
            this.label13.Text = "User name:";
            // 
            // label14
            // 
            this.label14.AutoSize = true;
            this.label14.Location = new System.Drawing.Point(3, 86);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(56, 13);
            this.label14.TabIndex = 121;
            this.label14.Text = "Password:";
            // 
            // tbProxyPassword
            // 
            this.tbProxyPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbProxyPassword.Location = new System.Drawing.Point(99, 83);
            this.tbProxyPassword.Name = "tbProxyPassword";
            this.tbProxyPassword.PasswordChar = '*';
            this.tbProxyPassword.Size = new System.Drawing.Size(339, 20);
            this.tbProxyPassword.TabIndex = 4;
            // 
            // tbProxyPort
            // 
            this.tbProxyPort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.tbProxyPort.Location = new System.Drawing.Point(474, 31);
            this.tbProxyPort.Name = "tbProxyPort";
            this.tbProxyPort.Size = new System.Drawing.Size(129, 20);
            this.tbProxyPort.TabIndex = 2;
            // 
            // label6
            // 
            this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(444, 34);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(29, 13);
            this.label6.TabIndex = 27;
            this.label6.Text = "Port:";
            // 
            // tbProxyHost
            // 
            this.tbProxyHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbProxyHost.Location = new System.Drawing.Point(99, 31);
            this.tbProxyHost.Name = "tbProxyHost";
            this.tbProxyHost.Size = new System.Drawing.Size(339, 20);
            this.tbProxyHost.TabIndex = 1;
            // 
            // label12
            // 
            this.label12.AutoSize = true;
            this.label12.Location = new System.Drawing.Point(3, 34);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(88, 13);
            this.label12.TabIndex = 25;
            this.label12.Text = "Proxy host name:";
            // 
            // tabSsl
            // 
            this.tabSsl.Controls.Add(this.panel1);
            this.tabSsl.Controls.Add(this.pnlServerCertificate);
            this.tabSsl.Location = new System.Drawing.Point(4, 22);
            this.tabSsl.Name = "tabSsl";
            this.tabSsl.Padding = new System.Windows.Forms.Padding(3);
            this.tabSsl.Size = new System.Drawing.Size(612, 331);
            this.tabSsl.TabIndex = 2;
            this.tabSsl.Text = "TLS/SSL";
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.cmbSuites);
            this.panel1.Controls.Add(this.cbAllowTls13);
            this.panel1.Controls.Add(this.cbAllowTls12);
            this.panel1.Controls.Add(this.cbAllowTls11);
            this.panel1.Controls.Add(this.cbAllowTls10);
            this.panel1.Controls.Add(this.label23);
            this.panel1.Controls.Add(this.label22);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(3, 152);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(606, 67);
            this.panel1.TabIndex = 44;
            // 
            // cmbSuites
            // 
            this.cmbSuites.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbSuites.FormattingEnabled = true;
            this.cmbSuites.Items.AddRange(new object[] {
            "All ciphers",
            "Secure only"});
            this.cmbSuites.Location = new System.Drawing.Point(122, 32);
            this.cmbSuites.Name = "cmbSuites";
            this.cmbSuites.Size = new System.Drawing.Size(117, 21);
            this.cmbSuites.TabIndex = 6;
            // 
            // cbAllowTls13
            // 
            this.cbAllowTls13.AutoSize = true;
            this.cbAllowTls13.Checked = true;
            this.cbAllowTls13.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbAllowTls13.Location = new System.Drawing.Point(122, 9);
            this.cbAllowTls13.Name = "cbAllowTls13";
            this.cbAllowTls13.Size = new System.Drawing.Size(64, 17);
            this.cbAllowTls13.TabIndex = 2;
            this.cbAllowTls13.Text = "TLS 1.3";
            this.cbAllowTls13.UseVisualStyleBackColor = true;
            // 
            // cbAllowTls12
            // 
            this.cbAllowTls12.AutoSize = true;
            this.cbAllowTls12.Checked = true;
            this.cbAllowTls12.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbAllowTls12.Location = new System.Drawing.Point(192, 9);
            this.cbAllowTls12.Name = "cbAllowTls12";
            this.cbAllowTls12.Size = new System.Drawing.Size(64, 17);
            this.cbAllowTls12.TabIndex = 3;
            this.cbAllowTls12.Text = "TLS 1.2";
            this.cbAllowTls12.UseVisualStyleBackColor = true;
            // 
            // cbAllowTls11
            // 
            this.cbAllowTls11.AutoSize = true;
            this.cbAllowTls11.Location = new System.Drawing.Point(262, 9);
            this.cbAllowTls11.Name = "cbAllowTls11";
            this.cbAllowTls11.Size = new System.Drawing.Size(64, 17);
            this.cbAllowTls11.TabIndex = 4;
            this.cbAllowTls11.Text = "TLS 1.1";
            this.cbAllowTls11.UseVisualStyleBackColor = true;
            // 
            // cbAllowTls10
            // 
            this.cbAllowTls10.AutoSize = true;
            this.cbAllowTls10.Location = new System.Drawing.Point(332, 9);
            this.cbAllowTls10.Name = "cbAllowTls10";
            this.cbAllowTls10.Size = new System.Drawing.Size(64, 17);
            this.cbAllowTls10.TabIndex = 5;
            this.cbAllowTls10.Text = "TLS 1.0";
            this.cbAllowTls10.UseVisualStyleBackColor = true;
            // 
            // label23
            // 
            this.label23.AutoSize = true;
            this.label23.Location = new System.Drawing.Point(6, 35);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(77, 13);
            this.label23.TabIndex = 1;
            this.label23.Text = "Allowed suites:";
            // 
            // label22
            // 
            this.label22.AutoSize = true;
            this.label22.Location = new System.Drawing.Point(6, 10);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(88, 13);
            this.label22.TabIndex = 0;
            this.label22.Text = "Allowed protocol:";
            // 
            // pnlServerCertificate
            // 
            this.pnlServerCertificate.BackColor = System.Drawing.Color.Transparent;
            this.pnlServerCertificate.Controls.Add(this.pnlLocalyStoredCertificate);
            this.pnlServerCertificate.Controls.Add(this.rbServerCertificateAny);
            this.pnlServerCertificate.Controls.Add(this.rbServerCertificateStored);
            this.pnlServerCertificate.Controls.Add(this.rbServerCertificateWindows);
            this.pnlServerCertificate.Controls.Add(this.label7);
            this.pnlServerCertificate.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlServerCertificate.Location = new System.Drawing.Point(3, 3);
            this.pnlServerCertificate.Name = "pnlServerCertificate";
            this.pnlServerCertificate.Size = new System.Drawing.Size(606, 149);
            this.pnlServerCertificate.TabIndex = 43;
            // 
            // pnlLocalyStoredCertificate
            // 
            this.pnlLocalyStoredCertificate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.pnlLocalyStoredCertificate.Controls.Add(this.label9);
            this.pnlLocalyStoredCertificate.Controls.Add(this.tbServerCertificateThumbprint);
            this.pnlLocalyStoredCertificate.Controls.Add(this.label10);
            this.pnlLocalyStoredCertificate.Location = new System.Drawing.Point(140, 67);
            this.pnlLocalyStoredCertificate.Name = "pnlLocalyStoredCertificate";
            this.pnlLocalyStoredCertificate.Size = new System.Drawing.Size(463, 79);
            this.pnlLocalyStoredCertificate.TabIndex = 41;
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(3, 19);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(60, 13);
            this.label9.TabIndex = 46;
            this.label9.Text = "(SH1 hash)";
            // 
            // tbServerCertificateThumbprint
            // 
            this.tbServerCertificateThumbprint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerCertificateThumbprint.Location = new System.Drawing.Point(90, 3);
            this.tbServerCertificateThumbprint.Multiline = true;
            this.tbServerCertificateThumbprint.Name = "tbServerCertificateThumbprint";
            this.tbServerCertificateThumbprint.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.tbServerCertificateThumbprint.Size = new System.Drawing.Size(371, 73);
            this.tbServerCertificateThumbprint.TabIndex = 45;
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(3, 6);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(63, 13);
            this.label10.TabIndex = 42;
            this.label10.Text = "Thumbprint:";
            // 
            // rbServerCertificateAny
            // 
            this.rbServerCertificateAny.AutoSize = true;
            this.rbServerCertificateAny.Location = new System.Drawing.Point(122, 1);
            this.rbServerCertificateAny.Name = "rbServerCertificateAny";
            this.rbServerCertificateAny.Size = new System.Drawing.Size(128, 17);
            this.rbServerCertificateAny.TabIndex = 31;
            this.rbServerCertificateAny.Text = "Accept any certificate";
            this.rbServerCertificateAny.UseVisualStyleBackColor = true;
            // 
            // rbServerCertificateStored
            // 
            this.rbServerCertificateStored.AutoSize = true;
            this.rbServerCertificateStored.Location = new System.Drawing.Point(122, 47);
            this.rbServerCertificateStored.Name = "rbServerCertificateStored";
            this.rbServerCertificateStored.Size = new System.Drawing.Size(195, 17);
            this.rbServerCertificateStored.TabIndex = 33;
            this.rbServerCertificateStored.Text = "Trust localy stored server certificate:";
            this.rbServerCertificateStored.UseVisualStyleBackColor = true;
            this.rbServerCertificateStored.CheckedChanged += new System.EventHandler(this.rbServerCertificateStored_CheckedChanged);
            // 
            // rbServerCertificateWindows
            // 
            this.rbServerCertificateWindows.AutoSize = true;
            this.rbServerCertificateWindows.Checked = true;
            this.rbServerCertificateWindows.Location = new System.Drawing.Point(122, 24);
            this.rbServerCertificateWindows.Name = "rbServerCertificateWindows";
            this.rbServerCertificateWindows.Size = new System.Drawing.Size(209, 17);
            this.rbServerCertificateWindows.TabIndex = 32;
            this.rbServerCertificateWindows.TabStop = true;
            this.rbServerCertificateWindows.Text = "Use Windows certificates infrastructure";
            this.rbServerCertificateWindows.UseVisualStyleBackColor = true;
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(6, 3);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(90, 26);
            this.label7.TabIndex = 9;
            this.label7.Text = "Server certificate \r\nvalidation:";
            // 
            // tabSsh
            // 
            this.tabSsh.Controls.Add(this.pnlServerKey);
            this.tabSsh.Location = new System.Drawing.Point(4, 22);
            this.tabSsh.Name = "tabSsh";
            this.tabSsh.Padding = new System.Windows.Forms.Padding(3);
            this.tabSsh.Size = new System.Drawing.Size(612, 331);
            this.tabSsh.TabIndex = 3;
            this.tabSsh.Text = "SSH";
            // 
            // pnlServerKey
            // 
            this.pnlServerKey.BackColor = System.Drawing.Color.Transparent;
            this.pnlServerKey.Controls.Add(this.cmbSshSuites);
            this.pnlServerKey.Controls.Add(this.label24);
            this.pnlServerKey.Controls.Add(this.pnlLocalyStoredKey);
            this.pnlServerKey.Controls.Add(this.rbServerKeyAny);
            this.pnlServerKey.Controls.Add(this.rbServerKeyStored);
            this.pnlServerKey.Controls.Add(this.label17);
            this.pnlServerKey.Dock = System.Windows.Forms.DockStyle.Top;
            this.pnlServerKey.Location = new System.Drawing.Point(3, 3);
            this.pnlServerKey.Name = "pnlServerKey";
            this.pnlServerKey.Size = new System.Drawing.Size(606, 184);
            this.pnlServerKey.TabIndex = 44;
            // 
            // cmbSshSuites
            // 
            this.cmbSshSuites.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbSshSuites.FormattingEnabled = true;
            this.cmbSshSuites.Items.AddRange(new object[] {
            "All ciphers",
            "Secure only"});
            this.cmbSshSuites.Location = new System.Drawing.Point(140, 158);
            this.cmbSshSuites.Name = "cmbSshSuites";
            this.cmbSshSuites.Size = new System.Drawing.Size(117, 21);
            this.cmbSshSuites.TabIndex = 43;
            // 
            // label24
            // 
            this.label24.AutoSize = true;
            this.label24.Location = new System.Drawing.Point(6, 161);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(77, 13);
            this.label24.TabIndex = 42;
            this.label24.Text = "Allowed suites:";
            // 
            // pnlLocalyStoredKey
            // 
            this.pnlLocalyStoredKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.pnlLocalyStoredKey.Controls.Add(this.label21);
            this.pnlLocalyStoredKey.Controls.Add(this.label20);
            this.pnlLocalyStoredKey.Controls.Add(this.cmbServerKeyAlgorithm);
            this.pnlLocalyStoredKey.Controls.Add(this.label18);
            this.pnlLocalyStoredKey.Controls.Add(this.tbServerKeyFingerprint);
            this.pnlLocalyStoredKey.Controls.Add(this.cmbServerKeyHashAlgorithm);
            this.pnlLocalyStoredKey.Controls.Add(this.label15);
            this.pnlLocalyStoredKey.Controls.Add(this.label16);
            this.pnlLocalyStoredKey.Location = new System.Drawing.Point(140, 44);
            this.pnlLocalyStoredKey.Name = "pnlLocalyStoredKey";
            this.pnlLocalyStoredKey.Size = new System.Drawing.Size(463, 108);
            this.pnlLocalyStoredKey.TabIndex = 41;
            // 
            // label21
            // 
            this.label21.AutoSize = true;
            this.label21.Location = new System.Drawing.Point(4, 75);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(59, 13);
            this.label21.TabIndex = 53;
            this.label21.Text = "(fingerprint)";
            // 
            // label20
            // 
            this.label20.AutoSize = true;
            this.label20.Location = new System.Drawing.Point(217, 6);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(143, 13);
            this.label20.TabIndex = 52;
            this.label20.Text = "(preferred host key algorithm)";
            // 
            // cmbServerKeyAlgorithm
            // 
            this.cmbServerKeyAlgorithm.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbServerKeyAlgorithm.FormattingEnabled = true;
            this.cmbServerKeyAlgorithm.Location = new System.Drawing.Point(90, 3);
            this.cmbServerKeyAlgorithm.Name = "cmbServerKeyAlgorithm";
            this.cmbServerKeyAlgorithm.Size = new System.Drawing.Size(121, 21);
            this.cmbServerKeyAlgorithm.TabIndex = 41;
            // 
            // label18
            // 
            this.label18.AutoSize = true;
            this.label18.Location = new System.Drawing.Point(4, 6);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(73, 13);
            this.label18.TabIndex = 51;
            this.label18.Text = "Key algorithm:";
            // 
            // tbServerKeyFingerprint
            // 
            this.tbServerKeyFingerprint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.tbServerKeyFingerprint.Location = new System.Drawing.Point(89, 59);
            this.tbServerKeyFingerprint.Multiline = true;
            this.tbServerKeyFingerprint.Name = "tbServerKeyFingerprint";
            this.tbServerKeyFingerprint.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.tbServerKeyFingerprint.Size = new System.Drawing.Size(371, 46);
            this.tbServerKeyFingerprint.TabIndex = 47;
            // 
            // cmbServerKeyHashAlgorithm
            // 
            this.cmbServerKeyHashAlgorithm.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cmbServerKeyHashAlgorithm.FormattingEnabled = true;
            this.cmbServerKeyHashAlgorithm.Location = new System.Drawing.Point(90, 30);
            this.cmbServerKeyHashAlgorithm.Name = "cmbServerKeyHashAlgorithm";
            this.cmbServerKeyHashAlgorithm.Size = new System.Drawing.Size(121, 21);
            this.cmbServerKeyHashAlgorithm.TabIndex = 45;
            this.cmbServerKeyHashAlgorithm.SelectedValueChanged += new System.EventHandler(this.cmbServerKeyHashAlgorithm_SelectedValueChanged);
            // 
            // label15
            // 
            this.label15.AutoSize = true;
            this.label15.Location = new System.Drawing.Point(4, 62);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(64, 13);
            this.label15.TabIndex = 42;
            this.label15.Text = "Hash value:";
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.Location = new System.Drawing.Point(4, 33);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(80, 13);
            this.label16.TabIndex = 41;
            this.label16.Text = "Hash algorithm:";
            // 
            // rbServerKeyAny
            // 
            this.rbServerKeyAny.AutoSize = true;
            this.rbServerKeyAny.Location = new System.Drawing.Point(122, 1);
            this.rbServerKeyAny.Name = "rbServerKeyAny";
            this.rbServerKeyAny.Size = new System.Drawing.Size(99, 17);
            this.rbServerKeyAny.TabIndex = 31;
            this.rbServerKeyAny.Text = "Accept any key";
            this.rbServerKeyAny.UseVisualStyleBackColor = true;
            // 
            // rbServerKeyStored
            // 
            this.rbServerKeyStored.AutoSize = true;
            this.rbServerKeyStored.Location = new System.Drawing.Point(122, 24);
            this.rbServerKeyStored.Name = "rbServerKeyStored";
            this.rbServerKeyStored.Size = new System.Drawing.Size(166, 17);
            this.rbServerKeyStored.TabIndex = 33;
            this.rbServerKeyStored.Text = "Trust localy stored server key:";
            this.rbServerKeyStored.UseVisualStyleBackColor = true;
            this.rbServerKeyStored.CheckedChanged += new System.EventHandler(this.rbServerKeyStored_CheckedChanged);
            // 
            // label17
            // 
            this.label17.AutoSize = true;
            this.label17.Location = new System.Drawing.Point(6, 3);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(61, 26);
            this.label17.TabIndex = 9;
            this.label17.Text = "Server key \r\nvalidation:";
            // 
            // UcConnectionEditor
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.tabControlMain);
            this.MinimumSize = new System.Drawing.Size(620, 0);
            this.Name = "UcConnectionEditor";
            this.Size = new System.Drawing.Size(620, 357);
            this.tabControlMain.ResumeLayout(false);
            this.tabServer.ResumeLayout(false);
            this.grpCredentials.ResumeLayout(false);
            this.pnlClearCommandChannel.ResumeLayout(false);
            this.pnlClearCommandChannel.PerformLayout();
            this.pnlPrivateKey.ResumeLayout(false);
            this.pnlPrivateKey.PerformLayout();
            this.pnlClientCertificate.ResumeLayout(false);
            this.pnlClientCertificate.PerformLayout();
            this.pnlDomain.ResumeLayout(false);
            this.pnlDomain.PerformLayout();
            this.pnlUsernamePassword.ResumeLayout(false);
            this.pnlUsernamePassword.PerformLayout();
            this.grpConnection.ResumeLayout(false);
            this.pnlHostnameProtocol.ResumeLayout(false);
            this.pnlHostnameProtocol.PerformLayout();
            this.tabProxy.ResumeLayout(false);
            this.pnlProxy.ResumeLayout(false);
            this.pnlProxy.PerformLayout();
            this.tabSsl.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.pnlServerCertificate.ResumeLayout(false);
            this.pnlServerCertificate.PerformLayout();
            this.pnlLocalyStoredCertificate.ResumeLayout(false);
            this.pnlLocalyStoredCertificate.PerformLayout();
            this.tabSsh.ResumeLayout(false);
            this.pnlServerKey.ResumeLayout(false);
            this.pnlServerKey.PerformLayout();
            this.pnlLocalyStoredKey.ResumeLayout(false);
            this.pnlLocalyStoredKey.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Button btnClearClientCertificate;
        private System.Windows.Forms.TextBox tbClientCertificate;
        private System.Windows.Forms.Button btnImportClientCertificate;
        private System.Windows.Forms.CheckBox cbClearCommandChannel;
        private System.Windows.Forms.CheckBox cbPassive;
        private System.Windows.Forms.TextBox tbServerPort;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.ComboBox cmbProtocol;
        private System.Windows.Forms.TextBox tbServerHost;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Panel pnlServerCertificate;
        private System.Windows.Forms.RadioButton rbServerCertificateWindows;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label lblPrivateKey;
        private System.Windows.Forms.Button btnClearPrivateKey;
        private System.Windows.Forms.TextBox tbPrivateKey;
        private System.Windows.Forms.Button btnImportPrivateKey;
        private System.Windows.Forms.TextBox tbServerUser;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.TextBox tbServerPassword;
        protected System.Windows.Forms.Panel pnlClientCertificate;
        protected System.Windows.Forms.Panel pnlPrivateKey;
        protected System.Windows.Forms.GroupBox grpCredentials;
        protected System.Windows.Forms.GroupBox grpConnection;
        protected System.Windows.Forms.Panel pnlHostnameProtocol;
        protected System.Windows.Forms.Panel pnlUsernamePassword;
        protected System.Windows.Forms.Panel pnlClearCommandChannel;
        protected System.Windows.Forms.TabPage tabServer;
        protected System.Windows.Forms.TabPage tabProxy;
        protected System.Windows.Forms.TabPage tabSsl;
        protected System.Windows.Forms.TabPage tabSsh;
        private System.Windows.Forms.RadioButton rbServerCertificateAny;
        private System.Windows.Forms.Panel pnlLocalyStoredCertificate;
        private System.Windows.Forms.TextBox tbServerCertificateThumbprint;
        private System.Windows.Forms.Label label10;
        protected System.Windows.Forms.TabControl tabControlMain;
        protected System.Windows.Forms.RadioButton rbServerCertificateStored;
        private System.Windows.Forms.Panel pnlServerKey;
        private System.Windows.Forms.Panel pnlLocalyStoredKey;
        private System.Windows.Forms.TextBox tbServerKeyFingerprint;
        private System.Windows.Forms.ComboBox cmbServerKeyHashAlgorithm;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.RadioButton rbServerKeyAny;
        protected System.Windows.Forms.RadioButton rbServerKeyStored;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.ComboBox cmbServerKeyAlgorithm;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.Button btnViewClientCertificate;
        protected System.Windows.Forms.Panel pnlProxy;
        private System.Windows.Forms.TextBox tbProxyPort;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label11;
        private System.Windows.Forms.ComboBox cmbProxyType;
        private System.Windows.Forms.TextBox tbProxyHost;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.TextBox tbProxyUsername;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.TextBox tbProxyPassword;
        private System.Windows.Forms.Label label19;
        private System.Windows.Forms.CheckBox cbStorePassword;
        private System.Windows.Forms.CheckBox cbUseGssApi;
        private System.Windows.Forms.Label lblDomain;
        private System.Windows.Forms.TextBox tbServerDomain;
        protected System.Windows.Forms.Panel pnlDomain;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Label label21;
        private System.Windows.Forms.Label label20;
    }
}
