uniden wrote:
I have a Yubikey 4 and followed the following tutorial on a windows machine with gpg4win installed
https://developers.yubico.com/PGP/Importing_keys.html. I’m able to encrypt and decrypt files without a problem on windows however on my laptop (Linux mint 18) im only able to encrypt files since I exported and copied my public key from my windows machine. Im sure im missing something very simple here but any help would be greatly appreciated.
On source:
Code:
gpg2 --export-secret-keys 0xDEADBEEFDEADBEEF > privkey.gpg
On destination:
Code:
gpg2 --import /path/to/privkey.gpg
Even though the keys themselves are stored on the token, they're still stubbed out in the keyring, otherwise the system wouldn't know it had any secret keys, let alone where to look for them. This means that you still need to export the secret keys and import them on the destination system, so that the destination is aware of their existence and where to find them if they're needed.
UPDATE: A better way to handle this follows.
Code:
$ gpg2 --card-edit
[information from your card here]
gpg/card> fetch
[retrieving <keyid> from keyserver, import messages]
gpg/card> q
$ gpg --card-statue
The keys stored on the token should now be stubbed on your local copy of the key and available for use. This method requires that you have the url set on the card (via gpg --card-edit), otherwise the fetch command won't know where to get the public key from.
If you haven't set the url (or it doesn't work; I'm currently troubleshooting a bug where it says it's retrieving the key, but doesn't actually import it, and there's no error output), you can import the pubkey by whatever means are convenient, then do gpg --card-status to update it with the correct stubs.