http://vww6ybaluuo4gfuuf6zvlt23hvg2pcfayco5iiwhv3plo6o7bewivoid.onion/zh/security/message-security/openpgp/gpg-best-practices
Extracting the primary key is tricky, but this should get you going: # extract the primary key
gpg -a --export-secret-key
[email protected] > secret_key
# extract the subkeys, which we will reimport later
gpg -a --export-secret-subkeys
[email protected] > secret_subkeys.gpg
# *delete* the secret keys from the keyring, so only subkeys are left
$ gpg --delete-secret-keys
[email protected] Delete this key from the keyring? (
y/N)
y
This is a secret key! - really...