//  
//   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 Rebex.Net;
using Rebex.Security.Certificates;

namespace Rebex.Samples
{
    public class ConnectionData
    {
        /// <summary>
        /// Gets or sets server host address.
        /// </summary>
        public string ServerHost { get { return _serverHost; } set { _serverHost = value; } }
        private string _serverHost;

        /// <summary>
        /// Gets or sets server port.
        /// </summary>
        public int ServerPort { get { return _serverPort; } set { _serverPort = value; } }
        private int _serverPort;

        /// <summary>
        /// Gets or sets used file transfer mode.
        /// </summary>
        public FileTransferMode FileTransferMode { get { return _fileTransferMode; } set { _fileTransferMode = value; } }
        private FileTransferMode _fileTransferMode;

        /// <summary>
        /// Gets or sets passive mode.
        /// </summary>
        public bool PassiveMode { get { return _passiveMode; } set { _passiveMode = value; } }
        private bool _passiveMode;

        /// <summary>
        /// Gets or sets server login name.
        /// </summary>
        public string ServerUser { get { return _serverUser; } set { _serverUser = value; } }
        private string _serverUser;

        /// <summary>
        /// Gets or sets server login password.
        /// </summary>
        public string ServerPassword { get { return _serverPassword; } set { _serverPassword = value; } }
        private string _serverPassword;

        /// <summary>
        /// Gets or sets info, whether the connection password can be persisted to file.
        /// </summary>
        public bool StorePassword { get { return _storePassword; } set { _storePassword = value; } }
        private bool _storePassword;

        /// <summary>
        /// Gets or sets Gss Api mode.
        /// </summary>
        public bool UseGssApi { get { return _useGssApi; } set { _useGssApi = value; } }
        private bool _useGssApi;

        /// <summary>
        /// Gets or sets server domain name.
        /// </summary>
        public string ServerDomain { get { return _serverDomain; } set { _serverDomain = value; } }
        private string _serverDomain;

        /// <summary>
        /// Gets or sets private key used for SSH authentication.
        /// </summary>
        public SshPrivateKey PrivateKey { get { return _privateKey; } set { _privateKey = value; } }
        private SshPrivateKey _privateKey;

        /// <summary>
        /// Gets or sets private key filename used to load a private key for SSH authentication.
        /// </summary>
        public string PrivateKeyFilename { get { return _privateKeyFilename; } set { _privateKeyFilename = value; } }
        private string _privateKeyFilename;

        /// <summary>
        /// Gets or sets client certificate used for SSL authentication.
        /// </summary>
        public CertificateChain ClientCertificate { get { return _clientCertificate; } set { _clientCertificate = value; } }
        private CertificateChain _clientCertificate;

        /// <summary>
        /// Gets or sets private key filename used to load a private key for SSH authentication.
        /// </summary>
        public string ClientCertificateFilename { get { return _clientCertificateFilename; } set { _clientCertificateFilename = value; } }
        private string _clientCertificateFilename;

        /// <summary>
        /// Gets or sets Clear Command Channel mode.
        /// </summary>
        public bool ClearCommandChannel { get { return _clearCommandChannel; } set { _clearCommandChannel = value; } }
        private bool _clearCommandChannel;

        /// <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>
        public FileTransferProxyType ProxyType { get { return _proxyType; } set { _proxyType = value; } }
        private FileTransferProxyType _proxyType;

        /// <summary>
        /// Gets or sets proxy host address.
        /// </summary>
        public string ProxyHost { get { return _proxyHost; } set { _proxyHost = value; } }
        private string _proxyHost;

        /// <summary>
        /// Gets or sets proxy port.
        /// </summary>
        public int ProxyPort { get { return _proxyPort; } set { _proxyPort = value; } }
        private int _proxyPort;

        /// <summary>
        /// Gets or sets proxy login name.
        /// </summary>
        public string ProxyUser { get { return _proxyUser; } set { _proxyUser = value; } }
        private string _proxyUser;

        /// <summary>
        /// Gets or sets proxy login password.
        /// </summary>
        public string ProxyPassword { get { return _proxyPassword; } set { _proxyPassword = value; } }
        private string _proxyPassword;

        /// <summary>
        /// Gets or sets hash value used for validating SSL server certificate 
        /// </summary>
        public CertificateVerifyingMode ServerCertificateVerifyingMode { get { return _serverCertificateVerifyingMode; } set { _serverCertificateVerifyingMode = value; } }
        private CertificateVerifyingMode _serverCertificateVerifyingMode;

        /// <summary>
        /// Gets or sets hash value used for validating SSL server certificate 
        /// (when <see cref="ServerCertificateVerifyingMode"/> is <c>LocalyStoredThumbprint</c>).
        /// </summary>
        public string ServerCertificateThumbprint { get { return _serverCertificateThumbprint; } set { _serverCertificateThumbprint = value; } }
        private string _serverCertificateThumbprint;

        /// <summary>
        /// Gets or sets fingerprint used for validating SSH server key
        /// </summary>
        public KeyVerifyingMode ServerKeyVerifyingMode { get { return _serverKeyVerifyingMode; } set { _serverKeyVerifyingMode = value; } }
        private KeyVerifyingMode _serverKeyVerifyingMode;

        /// <summary>
        /// Gets or sets algorithm for server key used for verifying <see cref="ServerKeyFingerprint"/>
        /// (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
        /// </summary>
        public SshHostKeyAlgorithm ServerKeyAlgorithm { get { return _serverKeyAlgorithm; } set { _serverKeyAlgorithm = value; } }
        private SshHostKeyAlgorithm _serverKeyAlgorithm;

        /// <summary>
        /// Gets or sets hash algorithm used for <see cref="ServerKeyFingerprint"/>
        /// (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
        /// </summary>
        public SignatureHashAlgorithm ServerKeyHashAlgorithm { get { return _serverKeyHashAlgorithm; } set { _serverKeyHashAlgorithm = value; } }
        private SignatureHashAlgorithm _serverKeyHashAlgorithm;

        /// <summary>
        /// Gets or sets fingerprint used for validating SSH server key
        /// (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
        /// </summary>
        public string ServerKeyFingerprint { get { return _serverKeyFingerprint; } set { _serverKeyFingerprint = value; } }
        private string _serverKeyFingerprint;

        /// <summary>
        /// Gets or sets TLS/SSL protocol version.
        /// </summary>
        public TlsVersion TlsProtocol { get { return _tlsProtocol; } set { _tlsProtocol = value; } }
        private TlsVersion _tlsProtocol;		

        /// <summary>
        /// Gets or sets allowed secure suites.
        /// </summary>
        public TlsCipherSuite AllowedSuite { get { return _allowedSuite; } set { _allowedSuite = value; } }
        private TlsCipherSuite _allowedSuite;

        /// <summary>
        /// Gets or sets allowed secure suites in SSH tab.
        /// </summary>
        public bool AllowWeakSuites { get { return _allowWeakSuites; } set { _allowWeakSuites = value; } }
        private bool _allowWeakSuites;
    }
}
