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

asked 03 Mar '11, 10:43

Stephan%201's gravatar image

Stephan 1
16
accept rate: 0%

This message is thrown when Rebex SFTP can't parse a Base64-encoded key file. Would it be possible to send one of these keys to us for analysis? If you can't, try opening the key file with notepad and let us know what lines are at the beginning and the end - that might be sufficient to be able to tell what is going on.

(03 Mar '11, 17:45) Lukas Pokorny ♦♦

This message is thrown when Rebex SFTP can't parse a Base64-encoded key file. Would it be possible to send one of these keys to us for analysis? If you can't, try opening the key file with notepad and let us know what lines are at the beginning and the end - that might be sufficient to be able to tell what is going on.

Alternatively, if you are able to use this key in third-party application, please download PuTTY "puttygen" utility. Try loading or importing the key into it and then save it in PuTTY or OpenSSH format. Once saved, you should be able to use the key in Rebex SFTP.

link

answered 25 Mar '11, 08:59

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5

Asked: 03 Mar '11, 10:43

Seen: 373 times

Last updated: 25 Mar '11, 08:59