如果您不想使用API,因为您不想处理返回的数据,则可以从以下获取原始密钥:
curl https://github.com/<username>.gpg
输出可以直接用于导入。
$ curl https://github.com/web-flow.gpg | gpg --import
你可以尝试使用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.
You can get the keys via the command line using
curl https://api.github.com/users/<username>/gpg_keys
gh
2.2.0起,您还可以使用gh gpg-key list
:gh gpg-key list [flags]
curl https://api.github.com/users/<username>/gpg_keys
获取密钥。 - weiji14同样,github.com/<username>.gpg
也可以使用,至少在GHE内部可以,我还没有在公共github上验证过。