diff options
| author | Ben McGinnes <[email protected]> | 2018-09-22 19:37:40 +0000 | 
|---|---|---|
| committer | Ben McGinnes <[email protected]> | 2018-09-22 19:37:40 +0000 | 
| commit | 3622576105ae1924d9b40ce0d09bf9a7accc0ed1 (patch) | |
| tree | e10d9d568232fc2ead115781df36246797d2a26a /lang/python/docs/gpgme-python-howto.org | |
| parent | python: Fix a couple of syntax errors. (diff) | |
| download | gpgme-3622576105ae1924d9b40ce0d09bf9a7accc0ed1.tar.gz gpgme-3622576105ae1924d9b40ce0d09bf9a7accc0ed1.zip  | |
docs: python bindings howto
* Confirmed that updates to the tests have significant'y improved that
  output.
* Updated some of the additional notes for the section on hkp4py.
** This is in anticipation adding at least import examples using that
   module as well.  It may also include adding examples of exporting a
   key and uploading it to the keyservers.
Tested-by: Ben McGinnes <[email protected]>
Signed-off-by: Ben McGinnes <[email protected]>
Diffstat (limited to 'lang/python/docs/gpgme-python-howto.org')
| -rw-r--r-- | lang/python/docs/gpgme-python-howto.org | 20 | 
1 files changed, 19 insertions, 1 deletions
diff --git a/lang/python/docs/gpgme-python-howto.org b/lang/python/docs/gpgme-python-howto.org index 53ca3a58..4373e0fa 100644 --- a/lang/python/docs/gpgme-python-howto.org +++ b/lang/python/docs/gpgme-python-howto.org @@ -2169,7 +2169,7 @@ support for Python 2.7 as well and is available via PyPI.  Since it rewrites the =hkp= protocol prefix as =http= and =hkps= as  =https=, the module is able to be used even with servers which do not -support the full scope of keyserver functions.  It will work quite +support the full scope of keyserver functions.  It also works quite  readily when incorporated into a [[#cython][Cython]] generated and compiled version  of any code. @@ -2184,6 +2184,24 @@ The hkp4py module returns key data via requests as string literals  the retrurned key data must be encoded to UTF-8 when importing that  key material using a =gpg.Context().key_import()= method. +For this reason an alternative method has been added to the =search= +function of =hkp4py.KeyServer()= which returns the key in the correct +format as expected by =key_import=.  When importing using this module, +it is now possible to import with this: + +#+BEGIN_SRC python -i +for key in keys: +    if key.revoked is False: +        gpg.Context().key_import(key.key_blob) +    else: +        pass +#+END_SRC + +Without that recent addition it would have been necessary to encode +the contents of each =hkp4py.KeyServer().search()[i].key= in +=hkp4py.KeyServer().search()= before trying to import it. + +  * Copyright and Licensing    :PROPERTIES:  | 
