In open-source projects where I need to store credentials for security reasons, I use a tool called blackbox. It uses GPG keys for encryption and key management.
When I now set up a new server and need access to those keys, I need to export them. In order to do that, we first need to find the key we want to use. We can do that by using the following command:
Once you locate your key, export one of it with those commands:
gpg --export-secret-key -a "<key holder name>" > secret.asc gpg --export-secret-key -a <8 char key id> > secret.asc
Once you moved the
secret.asc file to another machine, you can import it again:
gpg --import secret.asc
And now you are ready to use your private key on the other machine.