Mailing List Archive

how to use WKD with python3?
Hi folks,

how do I get public keys over WKD with python3/gpgme?
I didn't find anything about this in the web. It seems like python3-gpg
doesn't support to use WKD.

Can someone point me to a good start point?

Kind Regards,
Ludwig
--
Intevation GmbH, Osnabr?ck
Firmensitz: Neuer Graben 17, 49074 Osnabr?ck
Registereintrag: Amtsgericht Osnabr?ck, HR B 18998
Gesch?ftsf?hrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: how to use WKD with python3? [ In reply to ]
Hi,

I'll try to answer this even though I don't completely know how to do it in
python, but I know how it's done in C / C++.

On Wednesday 3 June 2020 12:52:46 CEST Ludwig Reiter wrote:
> how do I get public keys over WKD with python3/gpgme?

you can do a keylist with KEYLIST_MODE_LOCATE for a single mbox. If python
does not have that (it was added later this mode is KEYLIST_MODE_EXTERNAL |
KEYLIST_MODE_LOCAL)

So I think it would be:

ctx.keylist(some_uid, mode=(gpg.constants.keylist.mode.LOCAL |
gpg.constants.keylist.mode.EXTERNAL))

or:
ctx.keylist(some_uid, mode=gpg.constants.keylist.mode.LOCATE)

> I didn't find anything about this in the web. It seems like python3-gpg
> doesn't support to use WKD.

You can force that only WKD is used in the keylist if you set the auto-key-
locate context flag (gpgme_set_ctx_flag) to "clear,nodefault,wkd".

> Can someone point me to a good start point?

Good starting points are usually our "run-foo" test tools under gpgme/tests. I
usually use them as a starting point and example.
We maintain these tools because we usually use them when developing new
features. ;-)

Best regards,
Andre

--
GnuPG.com - a brand of g10 Code, the GnuPG experts.

g10 Code GmbH, Erkrath/Germany, AG Wuppertal HRB14459
GF Werner Koch, USt-Id DE215605608, www.g10code.com.

GnuPG e.V., Rochusstr. 44, D-40479 D?sseldorf. VR 11482 D?sseldorf
Vorstand: W.Koch, B.Reiter, A.Heinecke Mail: board@gnupg.org
Finanzamt D-Altstadt, St-Nr: 103/5923/1779. Tel: +49-211-28010702