No problem! Here are the steps I used:
- Generate a key, copy down its key ID (or just copy down your key ID)
- Insert Yubikey
- Open terminal and use: gpg --expert --edit-key your key id here
- Use: toggle (enter)
- Then: keytocard (enter)
-> You may get prompted for an "Admin PIN" here (which for some reason it seems to want you to enter twice sometimes). Unless you've changed it, the PIN is 12345678.
- Choose (1) (enter)
- Type: key 1 (enter)
- Then: keytocard (enter)
- Choose (2) (enter)
I actually worked this out because I wanted to use an existing key, and the Yubikey docs didn't really show how to do that.
A few other notes/tips:
1.The operating system you're using matters. If you're using it on an older Mac OS you may run into situations where the correct configuration commands (like the above) just don't work. If you can use a newer machine/OS to configure the key, however, it works fine on older operating systems (in my experience).
2.In order to encrypt/decrypt on a machine using the key on your Yubikey, that machine's copy of GPGTools must have your public key in its address book. The first time you want to encrypt/decrypt, plug in your Yubikey and in Terminal enter:
gpg --card-status (enter)
That command basically tells that computer's copy of GPGTools to look for the private key on your card.
The disconcerting thing is that if you run the command:
gpg --list-secret-keys
after you've removed your Yubikey, it will still list your secret key as available (even though it won't actually encrypt/decrypt anything without the key inserted). This also means that there will be some evidence of your key having been used to encrypt/decrypt on that computer (this might be possible to delete, I'm not sure). So you still probably wouldn't want to start encrypting/decrypting on just any old computer.
3.Once you've got your secret key on the Yubikey, you will be prompted for the User PIN rather than your passphrase (at least after the first time - or that's been my experience so far) when you plug it into a machine. The default for this is 123456. This means, of course, that you definitely want to change the User PIN and Admin PIN from the defaults, and keep close track of the Yubikey itself.
Hope this was helpful. And if you have any other questions, let me know. I'm still working through this myself, so happy to hear about issues that others are having.