You may need to reimport/export your keys and import them:
run this in a file, make sure you run chmod +x file
first.
#!/bin/bash
your_id_here="$@"
#your_id_here is your ID.:
#Export keys and ownertrust:
exportkey() {
gpg --export --armor $your_id_here > $your_id_here.pub.asc
gpg --export-secret-keys --armor $your_id_here > $your_id_here.priv.asc
gpg --export-secret-subkeys --armor $your_id_here > $your_id_here.sub_priv.asc
gpg --export-ownertrust > $your_id_here.ownertrust.txt
}
exportkey
Run as ./file id
on the commandline, or modify this as you will.
To make it easier to move around, run this in a folder and then tar it.
To import them:
#!/bin/bash
your_id_here="$@"
importkey() {
gpg --import $your_id_here.pub.asc
gpg --import $your_id_here.priv.asc
gpg --import $your_id_here.sub_priv.asc
gpg --import-ownertrust $your_id_here.ownertrust.txt
}
importkey
Same thing as above ./file2 id
.
Of course, do untar them first before running this.
PS:
It will obviously prompt you for your password, which you usually have when it come to gpg.
Just bear in mind it might ask you for your password more than once (think 2 times) because of the two priv
key, the rest won't ask for it i believe (unless of course you have the cache
setting set in the gpg-agent.conf, in which case it will ask either once or none).
Lastly, this only work as a per-id cases. So you'd have to list the ids of your keys yourself by using gpg -k
then copy pasting the id that you'd want to backup...