[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Configuring epg



Hi,

At Sun, 26 Apr 2015 14:19:03 +0900,
Kazuhiro Ito wrote:
> > > > > If you mean you have multiple primary keys, try
> > > > > (setq mime-edit-pgp-signers '("AACB3243630052D9"))
> > > > > or set mime-edit-pgp-verbose to t.
> > > > When I set this, I get the following error:
> > > >
> > > >   Debugger entered--Lisp error: (wrong-type-argument epg-new-signature-p nil)

I just figured out the problem: I'm using a smartcard (specifically, a
YubiKey Neo).  If the smartcard is not inserted, I get the error.  It
would be better if I instead got a prompt to insert the smartcard with
the specified key.

> > > 2. Can EasyPG sign with the key?  Please try the below code.
> > > 
> > > (let ((debug-on-error t)
> > >       (signer "AACB3243630052D9")
> > >       (context (epg-make-context)))
> > >   (epg-context-set-signers
> > >    context (list (car (epg-list-keys context signer))))
> > >   (epg-sign-string context signer 'cleartext))
> > 
> > This returns nil.
> 
> Without any error?
> 
> What is the result of the below code?
> 
> (let* ((signer "AACB3243630052D9")
>        (context (epg-make-context))
>        (key (car (epg-list-keys context signer))))
>   (and key
>        (epg-sub-key-id (car (epg-key-sub-key-list key)))))

This returns "AACB3243630052D9" whether my smartcard is inserted or
not.
> 
> If it returns valid key-id string, try the below code and show me the
> content of " *epg-debug*" buffer (beware buffer's name starts with
> SPACE).
> 
> (let ((epg-debug t)
>       (signer "AACB3243630052D9")
>       (context (epg-make-context)))
>   (epg-context-set-signers
>    context (list (car (epg-list-keys context signer))))
>   (epg-sign-string context signer 'cleartext))

If my smartcard is not inserted, I get this:

  GPG_AGENT_INFO=/tmp/gpg-hhtGEk/S.gpg-agent:1359:1
  /usr/bin/gpg --no-tty --status-fd 1 --yes --use-agent --command-fd 0 --output /tmp/epg-output1808nwN --clearsign -u AACB3243630052D9
  [GNUPG:] BEGIN_SIGNING
  [GNUPG:] CARDCTRL 4
  gpg: selecting openpgp failed: ec=6.108
  gpg: signing failed: general error
  gpg: [stdin]: clearsign failed: general error

If my smartcard is inserted, I get this:

  GPG_AGENT_INFO=/tmp/gpg-hhtGEk/S.gpg-agent:1359:1
  /usr/bin/gpg --no-tty --status-fd 1 --yes --use-agent --command-fd 0 --output /tmp/epg-output1808BFa --clearsign -u AACB3243630052D9
  [GNUPG:] BEGIN_SIGNING
  [GNUPG:] CARDCTRL 3 
  [GNUPG:] SIG_CREATED C 1 10 01 1430120892 C03FA6411B03AE12576461187223B56678E02528

Thanks a lot for your help!

Neal