Is there a simple endpoint for retrieving a users gpg public key?
For SSH keys, github.com/<username>.keys
, is there something similar for gpg keys?
Related: What is the public URL for the Github public keys
If you do not want to use the API, because you do not want to process the data returned, you can get a raw key from:
curl https://github.com/<username>.gpg
The output can be used directly for import.
$ curl https://github.com/web-flow.gpg | gpg --import
You can try using the GitHub API for GPG Keys:
List GPG keys for a user
GET /users/:username/gpg_keys
Lists the GPG keys for a user. This information is accessible by anyone.
weiji14 proposes in the comments:
You can get the keys via the command line using
curl https://api.github.com/users/<username>/gpg_keys
Since Oct. 2021 and GitHub CLI gh
2.2.0, you also have gh gpg-key list
:
gh gpg-key list [flags]
Also github.com/<username>.gpg
works, at least within GHE it does, I haven't verified on public github
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With