Skip to content
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

NIOSSHPrivateKey from file/bytes #94

Open
WilliamABradley opened this issue Sep 25, 2021 · 2 comments
Open

NIOSSHPrivateKey from file/bytes #94

WilliamABradley opened this issue Sep 25, 2021 · 2 comments

Comments

@WilliamABradley
Copy link

I don't know if I am missing something, is there a way to parse a private key file or private key data with a passphrase into a NIOSSHPrivateKey without knowing the type of private key you want to open?

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 27, 2021

Yes, this is currently correct. The main reason we haven't added this support at the moment is that CryptoKit does not provide the algorithms required for us to support protected private keys (that is, private keys protected by passphrases). This is the overwhelmingly most common format for private keys on disk.

I think the most useful addition to work around this would be to add support for the ssh agent protocol, and use that as a potential backing for NIOSSHPrivateKey. This is admittedly a lot of work, but it circumvents the need for us to manage the protection of the key at all, and encourages good SSH key hygiene.

@WilliamABradley
Copy link
Author

Not if you plan on using this on IOS 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants