Macos – gpg: signing failed: No pinentry

gnupgmacos

Im trying to setup my gnupg configuration on MAC OS 11.2.1

So far I have setup my SSH, I have generated my GPG key and added it into GPG agent.

Now, if I run this command:

 echo "test" | gpg --clearsign

I am getting this result:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: No pinentry
gpg: [stdin]: clear-sign failed: No pinentry

The problem is, that the pinetry is installed:

pinentry-curses (pinentry) 1.1.1
Copyright (C) 2016 g10 Code GmbH
License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

In my gpg-agent.conf file, I have this line:

pinentry-program /usr/local/bin/pinentry-mac

In my gpg.conf I have this line:

no-tty

gpg version:

gpg (GnuPG) 2.2.27
libgcrypt 1.9.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/usr/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

I have tried to kill gpg agent and reinstall gnupg several times, reinstal pinentry. Nothing helped.

Best Answer

The command

brew install pinentry

Aparrently installed the pinentry into different path, than the gpg-agent.conf file has. If someone runs into this problem, just do

which pinentry-mac

And the path it gives you, put into gpg-agent.conf file.

Related Question