Hi :)

Andreas Heinlein <aheinl...@gmx.com> writes:

> I am currently taking first steps using GPGME with the Python interface.
> I am facing two questions:
>
> 1.) I'm looking for a way to get the recipients of encrypted data which
> I can not/do not want to decrypt. I.e. a message for which I do not have
> the private key. Enigmail tells me "This message was encrypted for ..."
> in such cases, and the gpg command line does the same. Is this possible
> with GPGME? Calling 'decrypt' just raises a GPGMEError in this case and
> does not return a result.

This is indeed a shortcoming of the Python bindings.  I will address this.

> 2.) Is there a way to safely distinguish "User clicked cancel when asked
> for the passphrase" from other errors? I think an application should
> abort silently in this case, but I'm getting another GPGMEError without
> any clue to the reason.

Maybe.  GPGMEError is a very general error, this is a bit of pyme
legacy.  You can inspect the error code using .getcode().  For a quick
check, try to str() the error.


Justus

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to