HW42 wrote on gnupg-users
(https://lists.gnupg.org/pipermail/gnupg-users/2015-July/054074.html):
I try to delete a public and it's secret key via gpgme. The problem is that it always pops a pinentry confirmation dialog. Since I want do the action unattended this is a problem. By looking at the gpg-agent code it seems that there is currently no way to do this. But maybe I missed something. There are two possibly workarounds I have think of 1) use a fake pinentry which always says yes. 2) delete the key in private-keys-v1.d but those are obviously crude hacks.