Problem signing git commits with smartcard key

Jacob Adams tookmund at
Thu May 31 19:21:31 CEST 2018

On 05/31/2018 10:12 AM, kookie at wrote:
> Hey there,
> I have a yubikey 4 that contains my GPG key. I can use the `gpg2` tool to sign messages without problems. But when I try to do the same with git, it fails. The command that git runs internally is equivalent to this:
> echo "This is a stream from git..." | gpg2 --status-fd=2 -bsau 555F2E4B6F87F91A4110669E90734A9E619C8A6C
> Which outputs the following error:
> [GNUPG:] KEY_CONSIDERED 555F2E4B6F87F91A4110669E90734A9E619C8A6C 0
> gpg: signing failed: Invalid ID
> [GNUPG:] FAILURE sign 100663414
> gpg: signing failed: Invalid ID

I think this is simply because you have the wrong key id in your command
(Thus "Invalid ID").
Assuming that the key on is correct, your
key id should be 9F18A093CF65F938E4C8EFA429E057516FE1BBF3, not

Hope this helps,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Gnupg-users mailing list