-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add support for ed25519 private keys #212
Conversation
Adds support for using ed25519 private key in user authentication. As .NET does not support ED25519 in the BCL it uses BouncyCastle.Cryptography as a dependency for the key signing tasks.
src/Tmds.Ssh/Ed25519PrivateKey.cs
Outdated
|
||
// Contains the private and public key as one block of bytes from the | ||
// serialized OpenSSH key data. | ||
private readonly byte[] _keyData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used a single byte[]
as that's how it is encoded in the raw OpenSSH key and the BouncyCastle API accepts an offset for the private and public key. Happy to just split that out in the parser and store it as 2 separate arrays if you prefer that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please split into separate arrays for the private and public key.
src/Tmds.Ssh/Ed25519PrivateKey.cs
Outdated
|
||
sealed class Ed25519PrivateKey : PrivateKey | ||
{ | ||
private const int _privateKeySize = 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for a const
, the convention is PrivateKeySize
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I'll remember that for next time. Now that the array is already split in the parser it's no longer needed.
Thanks for implementing this @jborean93! |
Adds support for using ed25519 private key in user authentication. As .NET does not support ED25519 in the BCL it uses
BouncyCastle.Cryptography as a dependency for the key signing tasks.
Fixes #204