From 72ac4f222becfe87ab472dd413b39c1608de39c6 Mon Sep 17 00:00:00 2001 From: Marvin Pinto Date: Wed, 13 Dec 2017 16:32:14 -0500 Subject: [PATCH] Add an example of mass re-keying --- ...-guide-to-setting-up--managing-gpg-keys-on-a-yubikey-4.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/til/2017-10-05-a-guide-to-setting-up--managing-gpg-keys-on-a-yubikey-4.md b/content/til/2017-10-05-a-guide-to-setting-up--managing-gpg-keys-on-a-yubikey-4.md index 035ed4c..e3dcd0e 100644 --- a/content/til/2017-10-05-a-guide-to-setting-up--managing-gpg-keys-on-a-yubikey-4.md +++ b/content/til/2017-10-05-a-guide-to-setting-up--managing-gpg-keys-on-a-yubikey-4.md @@ -634,7 +634,10 @@ Select `2 - unblock PIN` and follow the instructions. websites like GitHub and Keybase as they don't appear to update automatically via public PGP key servers. -1. Re-key any encrypted files with the new subkey. +1. Re-key any encrypted files with the new subkey. Example: + ``` bash + $ for f in $(find . -name '*.gpg'); do gpg2 --batch --decrypt $f | gpg2 --encrypt -r MASTER_KEY_ID --armor --output tempfile.gpg && mv tempfile.gpg $f; done + ``` 1. Verify your work.