title | intro | redirect_from | versions | topics | shortTitle | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Adding a GPG key to your GitHub account |
To configure your account on {% data variables.location.product_location %} to use your new (or existing) GPG key, you'll also need to add the key to your account. |
|
|
|
Add a GPG key |
To sign commits associated with your account on {% data variables.product.product_name %}, you can add a public GPG key to your personal account. Before you add a key, you should check for existing keys. If you don't find any existing keys, you can generate and copy a new key. For more information, see "AUTOTITLE" and "AUTOTITLE."
You can add multiple public keys to your account on {% data variables.product.product_name %}. Commits signed by any of the corresponding private keys will show as verified. If you remove a public key, any commits signed by the corresponding private key will no longer show as verified.
{% ifversion upload-expired-or-revoked-gpg-key %} To verify as many of your commits as possible, you can add expired and revoked keys. If the key meets all other verification requirements, commits that were previously signed by any of the corresponding private keys will show as verified and indicate that their signing key is expired or revoked.
{% data reusables.gpg.supported-gpg-key-algorithms %}
When verifying a signature, {% data variables.product.product_name %} extracts the signature and attempts to parse its key ID. The key ID is then matched with keys added to {% data variables.product.product_name %}. Until a matching GPG key is added to {% data variables.product.product_name %}, it cannot verify your signatures.
{% data reusables.user-settings.access_settings %} {% data reusables.user-settings.ssh %}
- Next to the "GPG keys" header, click New GPG key.
- In the "Title" field, type a name for your GPG key.
- In the "Key" field, paste the GPG key you copied when you generated your GPG key.
- Click Add GPG key.
- If prompted, authenticate to your {% data variables.product.prodname_dotcom %} account to confirm the action.
{% ifversion upload-expired-or-revoked-gpg-key %} {% else %}
When verifying a signature, {% data variables.product.product_name %} checks that the key is not revoked or expired. If your signing key is revoked or expired, {% data variables.product.product_name %} cannot verify your signatures.
If your key is expired, you must update its expiration, export the new key, delete the expired key in your account on {% data variables.product.product_name %}, and add the new key to your account as described above. Your previous commits and tags will show as verified, as long as the key meets all other verification requirements.
If your key is revoked, use the primary key or another key that is not revoked to sign your commits.
If your key is invalid and you don't use another valid key in your key set, but instead generate a new GPG key with a new set of credentials, then your commits made with the revoked or expired key will continue to show as unverified. Also, your new credentials will not be able to re-sign or verify your old commits and tags. {% endif %}