'  
'   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.
' 

Imports Rebex.Net
Imports Rebex.Security.Certificates

Public Class ConnectionData
    ''' <summary>
    ''' Gets or sets server host address.
    ''' </summary>
    Public Property ServerHost() As String
        Get
            Return _serverHost
        End Get
        Set
            _serverHost = value
        End Set
    End Property
    Private _serverHost As String

    ''' <summary>
    ''' Gets or sets server port.
    ''' </summary>
    Public Property ServerPort() As Integer
        Get
            Return _serverPort
        End Get
        Set
            _serverPort = value
        End Set
    End Property
    Private _serverPort As Integer

    ''' <summary>
    ''' Gets or sets used file transfer mode.
    ''' </summary>
    Public Property FileTransferMode() As FileTransferMode
        Get
            Return _fileTransferMode
        End Get
        Set
            _fileTransferMode = value
        End Set
    End Property
    Private _fileTransferMode As FileTransferMode

    ''' <summary>
    ''' Gets or sets passive mode.
    ''' </summary>
    Public Property PassiveMode() As Boolean
        Get
            Return _passiveMode
        End Get
        Set
            _passiveMode = value
        End Set
    End Property
    Private _passiveMode As Boolean

    ''' <summary>
    ''' Gets or sets server login name.
    ''' </summary>
    Public Property ServerUser() As String
        Get
            Return _serverUser
        End Get
        Set
            _serverUser = value
        End Set
    End Property
    Private _serverUser As String

    ''' <summary>
    ''' Gets or sets server login password.
    ''' </summary>
    Public Property ServerPassword() As String
        Get
            Return _serverPassword
        End Get
        Set
            _serverPassword = value
        End Set
    End Property
    Private _serverPassword As String

    ''' <summary>
    ''' Gets or sets info, whether the connection password can be persisted to file.
    ''' </summary>
    Public Property StorePassword() As Boolean
        Get
            Return _storePassword
        End Get
        Set
            _storePassword = value
        End Set
    End Property
    Private _storePassword As Boolean

    ''' <summary>
    ''' Gets or sets Gss Api mode.
    ''' </summary>
    Public Property UseGssApi() As Boolean
        Get
            Return _useGssApi
        End Get
        Set
            _useGssApi = value
        End Set
    End Property
    Private _useGssApi As Boolean

    ''' <summary>
    ''' Gets or sets server domain name.
    ''' </summary>
    Public Property ServerDomain() As String
        Get
            Return _serverDomain
        End Get
        Set
            _serverDomain = value
        End Set
    End Property
    Private _serverDomain As String

    ''' <summary>
    ''' Gets or sets private key used for SSH authentization.
    ''' </summary>
    Public Property PrivateKey() As SshPrivateKey
        Get
            Return _privateKey
        End Get
        Set
            _privateKey = value
        End Set
    End Property
    Private _privateKey As SshPrivateKey

    ''' <summary>
    ''' Gets or sets private key filename used to load a private key for SSH authentization.
    ''' </summary>
    Public Property PrivateKeyFilename() As String
        Get
            Return _privateKeyFilename
        End Get
        Set
            _privateKeyFilename = value
        End Set
    End Property
    Private _privateKeyFilename As String

    ''' <summary>
    ''' Gets or sets client certificate used for SSL authentization.
    ''' </summary>
    Public Property ClientCertificate() As CertificateChain
        Get
            Return _clientCertificate
        End Get
        Set
            _clientCertificate = value
        End Set
    End Property
    Private _clientCertificate As CertificateChain

    ''' <summary>
    ''' Gets or sets private key filename used to load a private key for SSH authentization.
    ''' </summary>
    Public Property ClientCertificateFilename() As String
        Get
            Return _clientCertificateFilename
        End Get
        Set
            _clientCertificateFilename = value
        End Set
    End Property
    Private _clientCertificateFilename As String

    ''' <summary>
    ''' Gets or sets Clear Command Channel mode.
    ''' </summary>
    Public Property ClearCommandChannel() As Boolean
        Get
            Return _clearCommandChannel
        End Get
        Set
            _clearCommandChannel = value
        End Set
    End Property
    Private _clearCommandChannel As Boolean

    ''' <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 Property ProxyType() As FileTransferProxyType
        Get
            Return _proxyType
        End Get
        Set
            _proxyType = value
        End Set
    End Property
    Private _proxyType As FileTransferProxyType

    ''' <summary>
    ''' Gets or sets proxy host address.
    ''' </summary>
    Public Property ProxyHost() As String
        Get
            Return _proxyHost
        End Get
        Set
            _proxyHost = value
        End Set
    End Property
    Private _proxyHost As String

    ''' <summary>
    ''' Gets or sets proxy port.
    ''' </summary>
    Public Property ProxyPort() As Integer
        Get
            Return _proxyPort
        End Get
        Set
            _proxyPort = value
        End Set
    End Property
    Private _proxyPort As Integer

    ''' <summary>
    ''' Gets or sets proxy login name.
    ''' </summary>
    Public Property ProxyUser() As String
        Get
            Return _proxyUser
        End Get
        Set
            _proxyUser = value
        End Set
    End Property
    Private _proxyUser As String

    ''' <summary>
    ''' Gets or sets proxy login password.
    ''' </summary>
    Public Property ProxyPassword() As String
        Get
            Return _proxyPassword
        End Get
        Set
            _proxyPassword = value
        End Set
    End Property
    Private _proxyPassword As String

    ''' <summary>
    ''' Gets or sets hash value used for validating SSL server certificate 
    ''' </summary>
    Public Property ServerCertificateVerifyingMode() As CertificateVerifyingMode
        Get
            Return _serverCertificateVerifyingMode
        End Get
        Set
            _serverCertificateVerifyingMode = value
        End Set
    End Property
    Private _serverCertificateVerifyingMode As CertificateVerifyingMode

    ''' <summary>
    ''' Gets or sets hash value used for validating SSL server certificate 
    ''' (when <see cref="ServerCertificateVerifyingMode"/> is <c>LocalyStoredThumbprint</c>).
    ''' </summary>
    Public Property ServerCertificateThumbprint() As String
        Get
            Return _serverCertificateThumbprint
        End Get
        Set
            _serverCertificateThumbprint = value
        End Set
    End Property
    Private _serverCertificateThumbprint As String

    ''' <summary>
    ''' Gets or sets fingerprint used for validating SSH server key
    ''' </summary>
    Public Property ServerKeyVerifyingMode() As KeyVerifyingMode
        Get
            Return _serverKeyVerifyingMode
        End Get
        Set
            _serverKeyVerifyingMode = value
        End Set
    End Property
    Private _serverKeyVerifyingMode As KeyVerifyingMode

    ''' <summary>
    ''' Gets or sets algorighm for server key used for verifyin <see cref="ServerKeyFingerprint"/>
    ''' (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
    ''' </summary>
    Public Property ServerKeyAlgorithm() As SshHostKeyAlgorithm
        Get
            Return _serverKeyAlgorithm
        End Get
        Set
            _serverKeyAlgorithm = value
        End Set
    End Property
    Private _serverKeyAlgorithm As SshHostKeyAlgorithm

    ''' <summary>
    ''' Gets or sets hash algorithm used for <see cref="ServerKeyFingerprint"/>
    ''' (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
    ''' </summary>
    Public Property ServerKeyHashAlgorithm() As SignatureHashAlgorithm
        Get
            Return _serverKeyHashAlgorithm
        End Get
        Set
            _serverKeyHashAlgorithm = value
        End Set
    End Property
    Private _serverKeyHashAlgorithm As SignatureHashAlgorithm

    ''' <summary>
    ''' Gets or sets fingerprint used for validating SSH server key
    ''' (when <see cref="ServerKeyVerifyingMode"/> is <c>LocalyStoredFingerprint</c>).
    ''' </summary>
    Public Property ServerKeyFingerprint() As String
        Get
            Return _serverKeyFingerprint
        End Get
        Set
            _serverKeyFingerprint = value
        End Set
    End Property
    Private _serverKeyFingerprint As String

    ''' <summary>
    ''' Gets or sets TLS/SSL protocol version.
    ''' </summary>
    Public Property TlsProtocol As TlsVersion
        Get
            Return _tlsProtocol
        End Get
        Set(value As TlsVersion)
            _tlsProtocol = value
        End Set
    End Property
    Private _tlsProtocol As TlsVersion

    ''' <summary>
    ''' Gets or sets allowed secure suites.   
    ''' </summary>
    Public Property AllowedSuite As TlsCipherSuite
        Get
            Return _allowedSuite
        End Get
        Set(value As TlsCipherSuite)
            _allowedSuite = value
        End Set
    End Property
    Private _allowedSuite As TlsCipherSuite

    ''' <summary>
    ''' Gets Or sets allowed secure suites in SSH tab.
    ''' </summary>
    Public Property AllowWeakSuites As Boolean
        Get
            Return _allowWeakSuites
        End Get
        Set(value As Boolean)
            _allowWeakSuites = value
        End Set
    End Property
    Private _allowWeakSuites As Boolean

End Class
