Skip to content

Commit f22d1c7

Browse files
committed
update and prefer explicit expiration dates
1 parent 4f1dc62 commit f22d1c7

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

README.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,16 @@ When Subkeys expire, they may still be used to decrypt with GnuPG and authentica
367367

368368
Subkeys must be renewed or rotated using the Certify key - see [Updating keys](#updating-keys).
369369

370-
Set the expiration date to two years:
370+
Set the Subkeys expiration to a specific date:
371371

372372
```console
373-
export EXPIRATION=2y
373+
export EXPIRATION=2027-05-01
374374
```
375375

376-
Or set the expiration date to a specific date to schedule maintenance:
376+
The expiration date may also be relative, for example set to two years:
377377

378378
```console
379-
export EXPIRATION=2026-05-01
379+
export EXPIRATION=2y
380380
```
381381

382382
## Passphrase
@@ -444,16 +444,14 @@ An alternative would be to have distinct keys but you would then require multipl
444444
- if you have different email addresses for professional versus personal use cases, having distinct keys allow you to disassociate the identities
445445
- if you are also using the YubiKey as a U2F or FIDO2 device, having multiple YubiKeys is generally recommended as a backup measure
446446

447-
## Steps
448-
449-
Define an array containing additional user IDs. As this is bash syntax, each array element should be surrounded by quotes and each element should be separated by a space:
447+
Define an array containing additional user IDs. Each array element must be wrapped in quotes and each element must be space-delimited:
450448

451449
```console
452450
declare -a additional_uids
453451
additional_uids=("Super Cool YubiKey 2025" "uid 1 <[email protected]>")
454452
```
455453

456-
Add the additional user IDs to the key:
454+
Add the additional user IDs to the Certify key:
457455

458456
```console
459457
for uid in "${additional_uids[@]}" ; do \
@@ -476,7 +474,7 @@ EOF
476474

477475
# Create Subkeys
478476

479-
Use the following command to generate Signature, Encryption and Authentication Subkeys using the previously configured key type, passphrase and expiration:
477+
Generate Signature, Encryption and Authentication Subkeys using the previously configured key type, passphrase and expiration:
480478

481479
```console
482480
for SUBKEY in sign encrypt auth ; do \
@@ -496,12 +494,12 @@ gpg -K
496494
The output will display **[C]ertify, [S]ignature, [E]ncryption and [A]uthentication** keys:
497495

498496
```console
499-
sec rsa4096/0xF0F2CFEB04341FB5 2024-01-01 [C]
497+
sec rsa4096/0xF0F2CFEB04341FB5 2025-01-01 [C]
500498
Key fingerprint = 4E2C 1FA3 372C BA96 A06A C34A F0F2 CFEB 0434 1FB5
501499
uid [ultimate] YubiKey User <yubikey@example>
502-
ssb rsa4096/0xB3CD10E502E19637 2024-01-01 [S] [expires: 2026-05-01]
503-
ssb rsa4096/0x30CBE8C4B085B9F7 2024-01-01 [E] [expires: 2026-05-01]
504-
ssb rsa4096/0xAD9E24E1B8CB9600 2024-01-01 [A] [expires: 2026-05-01]
500+
ssb rsa4096/0xB3CD10E502E19637 2025-01-01 [S] [expires: 2027-05-01]
501+
ssb rsa4096/0x30CBE8C4B085B9F7 2025-01-01 [E] [expires: 2027-05-01]
502+
ssb rsa4096/0xAD9E24E1B8CB9600 2025-01-01 [A] [expires: 2027-05-01]
505503
```
506504

507505
# Backup keys
@@ -925,12 +923,12 @@ EOF
925923
Verify Subkeys have been moved to YubiKey with `gpg -K` and look for `ssb>`, for example:
926924

927925
```console
928-
sec rsa4096/0xF0F2CFEB04341FB5 2024-01-01 [C]
926+
sec rsa4096/0xF0F2CFEB04341FB5 2025-01-01 [C]
929927
Key fingerprint = 4E2C 1FA3 372C BA96 A06A C34A F0F2 CFEB 0434 1FB5
930928
uid [ultimate] YubiKey User <yubikey@example>
931-
ssb> rsa4096/0xB3CD10E502E19637 2024-01-01 [S] [expires: 2026-05-01]
932-
ssb> rsa4096/0x30CBE8C4B085B9F7 2024-01-01 [E] [expires: 2026-05-01]
933-
ssb> rsa4096/0xAD9E24E1B8CB9600 2024-01-01 [A] [expires: 2026-05-01]
929+
ssb> rsa4096/0xB3CD10E502E19637 2025-01-01 [S] [expires: 2027-05-01]
930+
ssb> rsa4096/0x30CBE8C4B085B9F7 2025-01-01 [E] [expires: 2027-05-01]
931+
ssb> rsa4096/0xAD9E24E1B8CB9600 2025-01-01 [A] [expires: 2027-05-01]
934932
```
935933

936934
The `>` after a tag indicates the key is stored on a smart card.
@@ -1093,18 +1091,18 @@ PIN retry counter : 3 3 3
10931091
Signature counter : 0
10941092
KDF setting ......: on
10951093
Signature key ....: CF5A 305B 808B 7A0F 230D A064 B3CD 10E5 02E1 9637
1096-
created ....: 2024-01-01 12:00:00
1094+
created ....: 2025-01-01 12:00:00
10971095
Encryption key....: A5FA A005 5BED 4DC9 889D 38BC 30CB E8C4 B085 B9F7
1098-
created ....: 2024-01-01 12:00:00
1096+
created ....: 2025-01-01 12:00:00
10991097
Authentication key: 570E 1355 6D01 4C04 8B6D E2A3 AD9E 24E1 B8CB 9600
1100-
created ....: 2024-01-01 12:00:00
1101-
General key info..: sub rsa4096/0xB3CD10E502E19637 2024-01-01 YubiKey User <yubikey@example>
1102-
sec# rsa4096/0xF0F2CFEB04341FB5 created: 2024-01-01 expires: never
1103-
ssb> rsa4096/0xB3CD10E502E19637 created: 2024-01-01 expires: 2026-05-01
1098+
created ....: 2025-01-01 12:00:00
1099+
General key info..: sub rsa4096/0xB3CD10E502E19637 2025-01-01 YubiKey User <yubikey@example>
1100+
sec# rsa4096/0xF0F2CFEB04341FB5 created: 2025-01-01 expires: never
1101+
ssb> rsa4096/0xB3CD10E502E19637 created: 2025-01-01 expires: 2027-05-01
11041102
card-no: 0006 05553211
1105-
ssb> rsa4096/0x30CBE8C4B085B9F7 created: 2024-01-01 expires: 2026-05-01
1103+
ssb> rsa4096/0x30CBE8C4B085B9F7 created: 2025-01-01 expires: 2027-05-01
11061104
card-no: 0006 05553211
1107-
ssb> rsa4096/0xAD9E24E1B8CB9600 created: 2024-01-01 expires: 2026-05-01
1105+
ssb> rsa4096/0xAD9E24E1B8CB9600 created: 2025-01-01 expires: 2027-05-01
11081106
card-no: 0006 05553211
11091107
```
11101108

@@ -1185,7 +1183,7 @@ gpg --verify signed.txt
11851183
The output will be similar to:
11861184

11871185
```console
1188-
gpg: Signature made Mon 01 Jan 2024 12:00:00 PM UTC
1186+
gpg: Signature made Mon 01 Jan 2025 12:00:00 PM UTC
11891187
gpg: using RSA key CF5A305B808B7A0F230DA064B3CD10E502E19637
11901188
gpg: Good signature from "YubiKey User <yubikey@example>" [ultimate]
11911189
Primary key fingerprint: 4E2C 1FA3 372C BA96 A06A C34A F0F2 CFEB 0434 1FB5
@@ -1931,9 +1929,7 @@ export CERTIFY_PASS=ABCD-0123-IJKL-4567-QRST-UVWX
19311929
Determine the updated expiration, for example:
19321930
19331931
```console
1934-
export EXPIRATION=2026-09-01
1935-
1936-
export EXPIRATION=2y
1932+
export EXPIRATION=2027-09-01
19371933
```
19381934
19391935
Renew the Subkeys:

0 commit comments

Comments
 (0)