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

age-keygen: Add option to compute pubkey from privkey #146

Closed
wants to merge 1 commit into from

Conversation

dsprenkels
Copy link
Contributor

@dsprenkels dsprenkels commented Oct 1, 2020

This PR adds an option to age-keygen to compute an Curve25519 public key from the respective private key.

It currently implements this:

Usage of ./age-keygen:
  -o FILE
        output to FILE (default stdout)
  -pubkey
        Read the private key from standard input print the corresponding public key.

This is different from what I proposed in issue #122, in the way that it only reads from standard input. --pubkey does not take an (optional) file argument.

The reason is that in order to implement this, we need to overhaul the command line flag parsing, including the usage string. It feels like that is a bit too involved for such a small change.

In the future, we can update age-keygen such that it also accepts -p (as an alias to --pubkey) and that the option can take an optional file argument, from which the private key should be read.


Fixes #122

@dsprenkels dsprenkels changed the title age-keygen: Add opt to compute pubkey from privkey age-keygen: Add option to compute pubkey from privkey Oct 1, 2020
FiloSottile added a commit that referenced this pull request Mar 10, 2021
Copied -y from ssh-keygen. Copied the INPUT as only optional argument
from cmd/age.

Fixes #122
Closes #146
@FiloSottile
Copy link
Owner

Thank you for the PR! I went with something a little different, stealing pieces of ssh-keygen and cmd/age, but I liked the idea of using standard input by default!

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

Successfully merging this pull request may close these issues.

UX: no way to get public key from private key
2 participants