Closed samuela closed 4 months ago
You can use the @RustCrypto ssh-key
crate, which has a first-class integration with ed25519-dalek
.
Specifically you might be interested in the ssh_key::PublicKey
type. You can convert from ed25519_dalek::VerifyingKey
using this From
impl.
See also ssh_key::authorized_keys
.
Awesome sauce, thanks @tarcieri !
I'm attempting to more-or-less replicate the functionality of ssh-keygen with ed25519-dalek. I have poked around quite a bit but have not yet succeeding in generating a serialization of a public key that matches the format standard in
~/.ssh/authorized_keys
:AAAAC3NzaC1lZDI1NTE5AAAA<xxxxxxxxxxxxx>
.Peeking at https://gist.github.com/thwarted/1024558 it looks like some DER serialization is necessary, but I have not yet found success generating a key that matches the expected format.
How does one accomplish this?