tag:gpgtools.tenderapp.com,2011-11-04:/discussions/problems/110589-gpg-error-when-using-gpg-agent-with-yubikey-gpg-applet-on-big-sur-from-mailGPGTools: Discussion 2021-10-20T19:55:23Ztag:gpgtools.tenderapp.com,2011-11-04:Comment/491378502021-04-12T14:42:39Z2021-04-12T14:42:42ZGPG error when using gpg-agent with Yubikey GPG applet on Big Sur from Mail<div><p><strong>Which of our tools is giving you problems?</strong></p>
<p>GPG Mail plugin 5.0 build 1569 when using gpg-agent with Yubikey gpg applet</p>
<p><strong>Attach a screenshot of the version info for all installed components (how to: <a href="https://gpgtools.tenderapp.com/kb/faq/where-can-i-find-version-info-of-the-installed-tools">https://gpgtools.tenderapp.com/kb/faq/where-can-i-find-version-info...</a>):</strong></p>
<p>Done.</p>
<p><strong>Describe your problem. Add as much detail as possible.</strong></p>
<p>My GPG encryption and signing keys are on my yubikey. I used gpg2 from GPGTools to create these keys on the yubikey.<br>
The problem is that GPG signing and decrypting from OSX Mail does not work unless I "wake" it first by doing something with the card (i.e. my Yubikey) from gpg2. A simple <code>gpg2 --card-status</code> is enough to make it work: I get prompted for PIN when necessary and the mail is signed or decrypted. If I do not do that I get a <code>gpg: signing failed: Invalid ID</code> error (see screenshot).<br>
I also use the authentication key in the gpg applet with the OSX openssh. This does work without having to "wake" the card first. I'm not using the PIV applet.</p>
<p>gpg-agent.conf:<br></p>
<pre>
<code>pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
default-cache-ttl 600
max-cache-ttl 7200<br><br>
<br>enable-ssh-support
write-env-file
use-standard-socket</code>
</pre>
<p><strong>What did you expect instead</strong></p>
<p>I expect that signing and decrypting works as long as the yubikey is connected, prompting for PIN when necessary.</p>
<p><strong>Describe steps leading to the problem.</strong></p>
<p>The problem is triggered when the card (Yubikey) has been inactive: after sleep or after inserting the token.</p>
<p><strong>Are you using any other Mail.app plugins?</strong></p>
<p>No</p></div>pieter.vandermeulentag:gpgtools.tenderapp.com,2011-11-04:Comment/491378502021-04-16T10:03:46Z2021-04-16T10:03:47ZGPG error when using gpg-agent with Yubikey GPG applet on Big Sur from Mail<div><p>I see now that this issue has been reported before: <a href="https://gpgtools.tenderapp.com/discussions/feedback/16266-signing-with-a-yubikey-fails-until-i-run-gpg-card-status">https://gpgtools.tenderapp.com/discussions/feedback/16266-signing-w...</a></p>
<p>I updated to the latest nightly (3004n) and that seems to have fixed it.</p></div>pieter.vandermeulen