SFTP Decrypt Public Key using PPK file and password

Advertisement

Remi Tavernier
Joined:
Posts:
6
Location:
France

SFTP Decrypt Public Key using PPK file and password

Hi,

I'm currently programming in vb.net a software that needs to connect to an SFTP server.

I have a .ppk file with my public en private key in it (encoded). I also know my user name and password to connect to the server.

If I connect using Winscp application directly using the ppk file and the passwords I know, I can connect fine.
From there I can generate the code to connect directly using the assembly.

I manage to connect using the assembly, there is no problem about that.

My only problem is that the ".SshHostKeyFingerprint" variable from the sessionoptions that I use is hardwritten.

I would like to be able to generate the ".SshHostKeyFingerprint" directly using my ".SshPrivateKeyPath" and the password linked to it. Thus I need to decrypt the public key in the ppk file using the password I suppose.

Can anyone help me on that?

Cordialy,

Tavernier Rémi

Reply with quote

Advertisement

Remi Tavernier
Joined:
Posts:
6
Location:
France

The first time you connect using WinSCP, it ask you if you want to accept the public key host? If you had it to the cache, it will not ask you again.

I just want it to work the same way like the linked exemple show.

Is it bad ? Should I let the user always click on something to accept the connection ?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Remi Tavernier wrote:

The first time you connect using WinSCP, it ask you if you want to accept the public key host? If you had it to the cache, it will not ask you again.

I just want it to work the same way like the linked exemple show.

Is it bad ? Should I let the user always click on something to accept the connection ?
That's fine. You just need to get the user involved on every new or changed hostkey.

Reply with quote

Advertisement

You can post new topics in this forum