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

Encode public/private key in OpenSSH format #42

Closed
ggrandes opened this issue Apr 28, 2017 · 1 comment
Closed

Encode public/private key in OpenSSH format #42

ggrandes opened this issue Apr 28, 2017 · 1 comment
Labels

Comments

@ggrandes
Copy link

How encode EdDSAPublicKey / EdDSAPrivateKey for later usage in OpenSSH?

Acording to draft-bjh21-ssh-ed25519-00 & draft-josefsson-eddsa-ed25519-03. I am trying to extract the values for encoding... but i don't known where to get these.

@str4d str4d added the question label May 6, 2017
@str4d
Copy link
Owner

str4d commented May 6, 2017

Both of those drafts are long-expired. You should use https://tools.ietf.org/html/draft-ietf-curdle-ssh-ed25519-00 instead, which is also expired but references the key encoding draft that became RFC 8032. Specifically:

4.  Public Key Format

   The "ssh-ed25519" key format has the following encoding:

      string    "ssh-ed25519"
      string    key

   Here 'key' is the 32-octet public key described by
   [I-D.irtf-cfrg-eddsa], Section 5.1.5.

Thus the public key should be in this encoding. You can get that from this library using EdDSAPublicKey.toByteArray() or EdDSAPrivateKey.toByteArray() (both should return the same value).

I don't see any specification for private keys in OpenSSH, so I can't really help there, although you can get the encoding of the private key which would be used (if anywhere) via EdDSAPrivateKey.getSeed().

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

No branches or pull requests

2 participants