Subject: Re: bug#7797: 24.0.50; [EasyPG/Gnus] always pick up the first key from `gpg --list-key $SENDER`

From: Daiki Ueno <[email-masked]>
Date: Fri, 07 Jan 2011 18:34:59 +0900

Daiki Ueno <[email-masked]> writes:

> Luca Capello <[email-masked]> writes:
>
>> gpg: skipped "8D3867D89DDB992B": unusable secret key
>> gpg: signing failed: unusable secret key
>
> You may want to try the patch I posted last month:
> http://lists.gnu.org/archive/html/emacs-devel/2010-12/msg00624.html
>
> Although this patch is a workaround, I'm going to push it for the time
> being.

OK, I fixed this in a better way (r102771).

My test case is:

$ mv .gnupg .gnupg.bak
$ gpg --gen-key # create a key [email-masked]
$ gpg --gen-key # create a key [email-masked]
$ gpg --gen-key # create a key [email-masked]
$ gpg --edit-key [email-masked] # revoke [email-masked]
$ gpg --delete-secret-key [email-masked]

(mml2015-epg-find-usable-secret-key
  (epg-make-context 'OpenPGP) "[email-masked]" 'sign)
=> nil
(mml2015-epg-find-usable-secret-key
  (epg-make-context 'OpenPGP) "[email-masked]" 'sign)
=> nil
(mml2015-epg-find-usable-secret-key
  (epg-make-context 'OpenPGP) "[email-masked]" 'sign)
=> (epg-key . ...)

Regards,
-- 
Daiki Ueno