[Pyme-help] Retrieve key from keyserver

Werner Koch wk at gnupg.org
Wed Jul 21 14:46:16 CEST 2010

> Am Mittwoch, 21. Juli 2010 09:18:22 schrieb Jerome Charaoui:
>> I'd like to know if it's possible to retrieve a PGP key from a keyserver
>> with PyMe.
>> According to the GPGME documentation, this should be possible by
>> combining mode.LOCAL with mode.EXTERN. However when I try this I
>> consistently get a EOF error.

What this kludge dioes is to use the --locate-keys option of gpg:

        Locate the keys given as arguments.  This command basically uses
        the same algorithm as used when locating keys for encryption  or
        signing  and  may  thus be used to see what keys gpg2 might use.
        In particular external methods as defined  by  --auto-key-locate
        may be used to locate a key.  Only public keys are listed.

-auto-key-locate `parameters'
     GnuPG can automatically locate and retrieve keys as needed using
     this option. This happens when encrypting to an email address (in
     the "user at example.com" form), and there are no user at example.com
     keys on the local keyring. This option takes any number of the
     following arguments, in the order they are to be tried:

          locate a key using DNS CERT, as specified in 2538bis
          (currently in draft): http://www.josefsson.org/rfc2538bis/

          locate a key using DNS PKA.

          locate a key using the PGP Universal method of checking

          locate a key using whatever keyserver is defined using the
          -keyserver option.

    (keyserver URL)
          In addition, a keyserver URL as used in the -keyserver option
          may be used here to query that particular keyserver.

Thus you need to define an auto-key-locate in gpg.conf.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gnupg-devel mailing list