Skip to content

Commit ddb4d39

Browse files
authored
Improved GPG key management experience (github#29113)
1 parent 063da9d commit ddb4d39

15 files changed

+93
-84
lines changed
Loading

content/authentication/managing-commit-signature-verification/about-commit-signature-verification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ To sign commits using GPG and have those commits verified on {% data variables.p
7070

7171
1. [Check for existing GPG keys](/articles/checking-for-existing-gpg-keys)
7272
2. [Generate a new GPG key](/articles/generating-a-new-gpg-key)
73-
3. [Add a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)
73+
3. [Add a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)
7474
4. [Tell Git about your signing key](/articles/telling-git-about-your-signing-key)
7575
5. [Sign commits](/articles/signing-commits)
7676
6. [Sign tags](/articles/signing-tags)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Adding a GPG key to your GitHub account
3+
intro: 'To configure your account on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %} to use your new (or existing) GPG key, you''ll also need the key to your account.'
4+
redirect_from:
5+
- /articles/adding-a-gpg-key-to-your-github-account
6+
- /github/authenticating-to-github/adding-a-new-gpg-key-to-your-github-account
7+
- /github/authenticating-to-github/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account
8+
- /articles/updating-an-expired-gpg-key
9+
- /authentication/troubleshooting-commit-signature-verification/updating-an-expired-gpg-key
10+
- /github/authenticating-to-github/updating-an-expired-gpg-key
11+
- /github/authenticating-to-github/troubleshooting-commit-signature-verification/updating-an-expired-gpg-key
12+
- /authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account
13+
versions:
14+
fpt: '*'
15+
ghes: '*'
16+
ghae: '*'
17+
ghec: '*'
18+
topics:
19+
- Identity
20+
- Access management
21+
shortTitle: Add a GPG key
22+
---
23+
24+
## About addition of GPG keys to your account
25+
26+
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 "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)" and "[Generating a new GPG key](/articles/generating-a-new-gpg-key)."
27+
28+
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.
29+
30+
{% ifversion upload-expired-or-revoked-gpg-key %}
31+
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.
32+
33+
![A verified commit whose key expired](/assets/images/help/settings/gpg-verified-with-expired-key.png)
34+
{% endif %}
35+
36+
{% data reusables.gpg.supported-gpg-key-algorithms %}
37+
38+
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.
39+
40+
## Adding a GPG key
41+
42+
{% data reusables.user-settings.access_settings %}
43+
{% data reusables.user-settings.ssh %}
44+
3. Click **New GPG key**.
45+
![GPG Key button](/assets/images/help/settings/gpg-add-gpg-key.png)
46+
4. In the "Key" field, paste the GPG key you copied when you [generated your GPG key](/articles/generating-a-new-gpg-key).
47+
![The key field](/assets/images/help/settings/gpg-key-paste.png)
48+
5. Click **Add GPG key**.
49+
![The Add key button](/assets/images/help/settings/gpg-add-key.png)
50+
6. To confirm the action, enter your {% data variables.product.product_name %} password.
51+
52+
{% ifversion upload-expired-or-revoked-gpg-key %}
53+
{% else %}
54+
## Updating an expired GPG key
55+
56+
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.
57+
58+
If your key is expired, you must [update its expiration](https://www.gnupg.org/gph/en/manual.html#AEN329), 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.
59+
60+
If your key is revoked, use the primary key or another key that is not revoked to sign your commits.
61+
62+
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.
63+
{% endif %}
64+
65+
## Further reading
66+
67+
- "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)"
68+
- "[Generating a new GPG key](/articles/generating-a-new-gpg-key)"
69+
- "[Telling Git about your signing key](/articles/telling-git-about-your-signing-key)"
70+
- "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)"
71+
- "[Signing commits and tags using GPG keys](/articles/signing-commits-and-tags-using-gpg)"
72+
- "[About commit signature verification](/articles/about-commit-signature-verification)"

content/authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account.md

-46
This file was deleted.

content/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ If you're using a GPG key that matches your committer identity and your verified
5050
$ gpg --armor --export <em>3AA5C34371567BD2</em>
5151
# Prints the GPG key, in ASCII armor format
5252
```
53-
11. Upload the GPG key by [adding it to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account).
53+
11. Upload the GPG key by [adding it to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account).
5454

5555
## Further reading
5656

5757
- "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)"
5858
- "[Generating a new GPG key](/articles/generating-a-new-gpg-key)"
5959
- "[Using a verified email address in your GPG key](/articles/using-a-verified-email-address-in-your-gpg-key)"
60-
- "[Adding a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)"
60+
- "[Adding a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)"
6161
- "[Signing commits](/articles/signing-commits)"
6262
- "[Signing tags](/articles/signing-tags)"

content/authentication/managing-commit-signature-verification/checking-for-existing-gpg-keys.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ shortTitle: Existing GPG keys
3232
$ gpg --armor --export <em>3AA5C34371567BD2</em>
3333
# Prints the GPG key ID, in ASCII armor format
3434
```
35-
You can then [add your GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account).
35+
You can then [add your GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account).
3636

3737
## Further reading
3838

3939
* "[Generating a new GPG key](/articles/generating-a-new-gpg-key)"
40-
* "[Adding a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)"
40+
* "[Adding a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)"
4141
* "[Telling Git about your signing key](/articles/telling-git-about-your-signing-key)"
4242
* "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)"
4343
* "[Signing commits](/articles/signing-commits)"

content/authentication/managing-commit-signature-verification/generating-a-new-gpg-key.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ topics:
3737
```
3838
4. At the prompt, specify the kind of key you want, or press `Enter` to accept the default.
3939
5. At the prompt, specify the key size you want, or press `Enter` to accept the default. Your key must be at least `4096` bits.
40-
6. Enter the length of time the key should be valid. Press `Enter` to specify the default selection, indicating that the key doesn't expire.
40+
6. Enter the length of time the key should be valid. Press `Enter` to specify the default selection, indicating that the key doesn't expire. Unless you require an expiration date, we recommend accepting this default.
4141
7. Verify that your selections are correct.
4242
8. Enter your user ID information.
4343

@@ -56,12 +56,12 @@ topics:
5656
# Prints the GPG key ID, in ASCII armor format
5757
```
5858
11. Copy your GPG key, beginning with `-----BEGIN PGP PUBLIC KEY BLOCK-----` and ending with `-----END PGP PUBLIC KEY BLOCK-----`.
59-
12. [Add the GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account).
59+
12. [Add the GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account).
6060
6161
## Further reading
6262
6363
* "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)"
64-
* "[Adding a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)"
64+
* "[Adding a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)"
6565
* "[Telling Git about your signing key](/articles/telling-git-about-your-signing-key)"
6666
* "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)"
6767
* "[Signing commits](/articles/signing-commits)"

content/authentication/managing-commit-signature-verification/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ children:
1919
- /displaying-verification-statuses-for-all-of-your-commits
2020
- /checking-for-existing-gpg-keys
2121
- /generating-a-new-gpg-key
22-
- /adding-a-new-gpg-key-to-your-github-account
22+
- /adding-a-gpg-key-to-your-github-account
2323
- /telling-git-about-your-signing-key
2424
- /associating-an-email-with-your-gpg-key
2525
- /signing-commits

content/authentication/managing-commit-signature-verification/signing-commits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ If you have multiple keys or are attempting to sign commits or tags with a key t
5454

5555
* "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)"
5656
* "[Generating a new GPG key](/articles/generating-a-new-gpg-key)"
57-
* "[Adding a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)"
57+
* "[Adding a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)"
5858
* "[Telling Git about your signing key](/articles/telling-git-about-your-signing-key)"
5959
* "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)"
6060
* "[Signing tags](/articles/signing-tags)"

content/authentication/managing-commit-signature-verification/signing-tags.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ topics:
3333
- "[Viewing your repository's tags](/articles/viewing-your-repositorys-tags)"
3434
- "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)"
3535
- "[Generating a new GPG key](/articles/generating-a-new-gpg-key)"
36-
- "[Adding a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)"
36+
- "[Adding a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)"
3737
- "[Telling Git about your signing key](/articles/telling-git-about-your-signing-key)"
3838
- "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)"
3939
- "[Signing commits](/articles/signing-commits)"

content/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ If you have multiple GPG keys, you need to tell Git which one to use.
108108
- "[Checking for existing GPG keys](/articles/checking-for-existing-gpg-keys)"
109109
- "[Generating a new GPG key](/articles/generating-a-new-gpg-key)"
110110
- "[Using a verified email address in your GPG key](/articles/using-a-verified-email-address-in-your-gpg-key)"
111-
- "[Adding a new GPG key to your GitHub account](/articles/adding-a-new-gpg-key-to-your-github-account)"
111+
- "[Adding a GPG key to your GitHub account](/articles/adding-a-gpg-key-to-your-github-account)"
112112
- "[Associating an email with your GPG key](/articles/associating-an-email-with-your-gpg-key)"
113113
- "[Signing commits](/articles/signing-commits)"
114114
- "[Signing tags](/articles/signing-tags)"

content/authentication/troubleshooting-commit-signature-verification/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ topics:
1515
- Access management
1616
children:
1717
- /checking-your-commit-and-tag-signature-verification-status
18-
- /updating-an-expired-gpg-key
1918
- /using-a-verified-email-address-in-your-gpg-key
2019
shortTitle: Troubleshoot verification
2120
---

content/authentication/troubleshooting-commit-signature-verification/updating-an-expired-gpg-key.md

-24
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Issue: 7123
2+
# Description: Allow adding expired and revoked GPG keys for verifying commit and tag signatures
3+
# Usage: {% ifversion upload-expired-or-revoked-gpg-key %} ... {% endif %}
4+
versions:
5+
fpt: '*'
6+
ghec: '*'
7+
ghes: '>=3.6'
8+
ghae: 'issue-7123'

data/reusables/enterprise_site_admin_settings/add-key-to-web-flow-user.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
```
66
1. Copy your PGP key, beginning with `-----BEGIN PGP PUBLIC KEY BLOCK-----` and ending with `-----END PGP PUBLIC KEY BLOCK-----`.
77
1. Sign into {% data variables.product.prodname_ghe_server %} as the `web-flow` user.
8-
1. Add the public PGP key to the user's profile. For more information, see "[Adding a new GPG key to your {% data variables.product.prodname_dotcom %} account](/authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account)."
8+
1. Add the public PGP key to the user's profile. For more information, see "[Adding a GPG key to your {% data variables.product.prodname_dotcom %} account](/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account)."
99

1010
{% note %}
1111

0 commit comments

Comments
 (0)