-
Start creating a new key:
gpg2 --expert --full-generate-key
-
Choose "RSA (set your own capabilities)"
-
Disable all but "Certify."
-
Choose 3072 bits.
-
Back up the revocation certificate from
~/.gnupg/openpgp-revocs.d/
. -
Consider this key ID to be
$CERTKEY
. -
Export the keypair to a backup drive:
gpg2 --export-secret-keys $CERTKEY > my-private-key.asc
-
Remove the secret key from the local machine:
gpg2 --delete-secret-key $CERTKEY
-
YubiKey Only: Set the mode:
sudo ykpersonalize -m6
-
YubiKey Only: Reset the GPG module:
ykman openpgp reset
-
Set the PIN and admin PIN:
gpg2 --change-pin # Change both the PIN (default is 123456) # and the Admin PIN (default is 12345678). # I use pwgen for the admin PIN.
-
YubiKey 4+ Only: Configure the key lengths:
gpg2 --card-edit gpg/card> admin gpg/card> key-attr # Choose RSA 3072 for each key type.
-
Add the new keys as subkeys on the card:
gpg2 --edit-key $CERTKEY gpg> addcardkey # Repeat for signing, encryption, and authentication.
@TODO