paulmillr / micro-key-producer

Produces secure keys and passwords. Supports SSH, PGP, BLS, OTP and many other formats
MIT License
43 stars 12 forks source link

convert pgp ed25519 key to ssh ed25519 key format? #1

Closed jcolson closed 2 years ago

jcolson commented 2 years ago

is there a way that one could convert pgp ed25519 key to ssh ed25519 key format with this library? is there any interoperability between the ssh and pgp exports?

paulmillr commented 2 years ago

You can use pgp.decodeSecretKey to convert private key to bigints, and then use those bigints in ssh keygen.

jcolson commented 2 years ago

One follow on question to this issue. Is there a way to create a PGP key by loading an ed25519 subkey from a file created by gpg's --export-secret-subkeys ? That can then, subsequently have decodeSecretKey called on it?

Thanks for your help!

paulmillr commented 2 years ago

Pgp keys depend on user's name/email/generation date. Ssh keys don't depend on this information. So, not really. You can generate both keys from one entropy piece though.

jcolson commented 2 years ago

The last question had nothing to do with SSH; I was just wondering if your PGP library had the ability to represent (load from a file) a GPG key/subkey that had been exported from a GPG keyring via the gpg --export-secret-subkeys ?

paulmillr commented 2 years ago

No such feature, also it was not a design goal.

jcolson commented 2 years ago

no worries, was just wondering.