Initialize a keyring by issuing a command that expects it
Example
gpg -K
Smart Card
Get it working
To set up a smart card, first make sure it appears in lsusb.
Then make sure it also shows in gpg --card-status.
This command should output some information about the present smart card. If the output looks like the desert scene out of an old western movie, it’s probably not being recognized correctly.
To use the smart card, we need to make sure pcsc which manages the smart card, as well as ccid, which is a generic CCID driver, are available, configured, enabled and started.
Register
The final thing to do now, is to register the smart card and the key to gpg.
The easiest way for me, since I have set the URL of the public key attribute on my YubiKey, is to
gpg --card-edit
fetch the public key
quit out of the prompt
gpg --edit-key email, replacing email with your actual email
trust the key with ultimate (5) trust and confirming (y) it