gpgme_op_delete() does not work with gpg 2.x

brent s. bts at
Sat Dec 29 17:01:19 CET 2018

On 12/29/18 9:01 AM, Jeroen Ooms wrote:
> A user of the R bindings has reported (and I have confirmed) that
> deleting secret keys in gpgme does not work with gnupg2. We call (on
> an existing key):
>   gpgme_op_delete(ctx, key, 1)
> This returns success if the key exists, and when we are running with
> GnuPG 1.4 the key is deleted. However when running gpg2 it returns
> success but the key is still there.
> Downstream issue:
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel at

I'm not sure how much this will help you, but deleting a private key
works in the Python bindings if I use the abstracted method but not the
direct gpgme method (see attached POC).

Haven't taken a look at the R bindings; is there a similar
context-specific method there?

brent saner
GPG info:
-------------- next part --------------
A non-text attachment was scrubbed...
Type: text/x-python
Size: 1873 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Gnupg-devel mailing list