What can cause the Message "Invalid Key Format" if I do this:
Using oClient As New Sftp()
Try
oClient.Connect(Me.Server)
If Not String.IsNullOrEmpty(Me.KeyFile) Then
Me.m_privateKey = New SshPrivateKey(System.Text.Encoding.Default.GetBytes(Me.KeyFile), Me.Passphrase)
If String.IsNullOrEmpty(Me.Passwort) Then
oClient.Login(Me.Benutzer, Nothing, Me.m_privateKey)
Else
oClient.Login(Me.Benutzer, Me.Passwort, Me.m_privateKey)
End If
Else
oClient.Login(Me.Benutzer, Me.Passwort)
End If
Catch ex As Exception
oClient.Disconnect()
Fehler = ex.Message
Return False
End Try
End Using