[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-keys
        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'
-no-auto-key-locate
     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:

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

    pka
          locate a key using DNS PKA.


    ldap
          locate a key using the PGP Universal method of checking
          "ldap://keys.(thedomain)".

    keyserver
          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.



Shalom-Salam,

   Werner



-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list