检查现有 GPG 密钥
在生成 GPG 密钥之前,您可以检查是否有任何现有的 GPG 密钥。
支持的 GPG 密钥算法
GitHub Enterprise 支持多种 GPG 密钥算法。如果您尝试添加由不支持的算法生成的密钥,可能会遇到错误。
- RSA
- ElGamal
- DSA
- ECDH
- ECDSA
- EdDSA
注:GPG 并未默认安装在 OS X 或 Windows 上。 要安装 GPG 命令行工具,请参阅 GnuPG 的下载页面。
-
Open TerminalTerminalGit Bashthe terminal.
-
Use the
gpg --list-secret-keys --keyid-format LONG
command to list GPG keys for which you have both a public and private key. A private key is required for signing commits or tags.
$ gpg --list-secret-keys --keyid-format LONG
Note: Some GPG installations on Linux may require you to use gpg2 --list-keys --keyid-format LONG
to view a list of your existing keys instead. In this case you will also need to configure Git to use gpg2
by running git config --global gpg.program gpg2
.