I am trying to login to the remote SFTP server from my .NET code using Renci.SshNet library using .ppk
format private key.
It is showing error.
I know it will work with .PEM format. But as the key for the application is generated by client, I can't change the format.
Is there a way to use .ppk private key to authenticate and upload file from my .NET C# code?
Any suitable library?
It has to be PEM format if you want to keep using SSH.NET. So either they generate the key in PEM format. Or at least they convert it to the PEM format. Or your software will have to convert it.
I'm not aware of any library that can do the conversion. All I can suggest is that you use bundle some command-line tool that can do it. For example my WinSCP can do that.
See Convert .pem key file to .ppk in Windows automatically/script/command line.
If want to change the library, you can use my WinSCP .NET assembly. It supports .ppk
keys. But it's just a wrapper around WinSCP itself. So it's about the same as using WinSCP for the conversion.