Page MenuHome GnuPG

gpg2 --use-agent gives "gpg: decryption failed: No secret key"
Closed, InvalidPublic

Description

gpg2 --use-agent --decrypt encrypted.asc
...
gpg: decryption failed: No secret key
FAIL

--use-agent --decrypt encrypted.asc
..
You need a passphrase to unlock the secret key for
...SUCCESS

This for example makes enigmail fail, and to make things worse: enigmail refuses
to work with gpg1

Using:
gpg (GnuPG) 2.1.11
libgcrypt 1.6.5
on Ubuntu 16.04.1 LTS

Event Timeline

gpg2 --use-agent --decrypt encrypted.asc
...
gpg: decryption failed: No secret key
FAIL

--use-agent --decrypt encrypted.asc
..
You need a passphrase to unlock the secret key for
...SUCCESS

This for example makes enigmail fail, and to make things worse: enigmail refuses
to work with gpg1

Using:
gpg (GnuPG) 2.1.11
libgcrypt 1.6.5
on Ubuntu 16.04.1 LTS

I have multiple keys in .gnupg, this might be triggering the problem.

--use-agent is a dummy option in GnUPG 2.1 - it has no effect.

marcus added a subscriber: marcus.

We can't reproduce this with recent versions and would need more information.

This comment was removed by jtd.