-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create a class instance of PrivateKeyFile #728
Comments
PrivateKey != HostKey. |
Thanks for the prompt reply. What is the proper solution would be until that merge's done? |
You can create a key with the methods listed here: https://github.com/sshnet/SSH.NET#public-key-authentication. ECDSA Keys are currently just supported in OpenSSL-Format. ssh-keygen generates them in OpenSSH-Format by default. Or you use ED25519 via: |
@darinkes Thanks! |
With ecdsa keys I got the following error:
That was in PEM format, and (without specifying
Only |
That sounds like Mono, not .NET Correct? ed25519 is done in SSH.NET, ECDsa requires .NET or netstandard functionality. See the Readme, Mono is not supported. Also cause most of the Crypto we need just throws NotImplementedExceptions. |
I'm using Edit: I used C# Interactive from Rider, where I'm not 100% sure it uses that version as I also have SDK version |
Weird. Cant see why official .NET should raise this exception. Just seen this error with Mono so far. Using SSH.NET myself on various linux systems, all work fine ECDsa and .NET. |
The issue should be fixed by #614
The issue should be fixed by #1461
On Mac OS X and Linux, JetBrains Rider defaults to Mono’s csharp. 1 Footnotes |
I'm using version 2020.0.0-beta1.
Created the key pair with the command: ssh-keygen -t ecdsa -b 521
During the object creation
PrivateKeyFile keyFile = new PrivateKeyFile("c:..\id_ecdsa_private.key","passphrase")
I'm getting the error:
openssh key type: ecdsa-sha2-nistp521 is not supported
at Renci.SshNet.PrivateKeyFile.ParseOpenSshV1Key(Byte[] keyFileData, String passPhrase)
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName)
at Onboarding.Services.SFTPService.d__7.MoveNext() in C:\Projects...\SFTPService.cs:line 65
The documentation says SSH.NET supports the following host key algorithms:
...
ecdsa-sha2-nistp521
...
Can anyone tell me please what is wrong?
Thanks!
The text was updated successfully, but these errors were encountered: