[git] GPGME - branch, ben/docs/2018-03, updated. gpgme-1.10.0-97-g961aea2

by Ben McGinnes cvs at cvs.gnupg.org
Thu Mar 15 05:52:01 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, ben/docs/2018-03 has been updated
       via  961aea212ef48914ecbfa169addf951b0854b0b4 (commit)
       via  7ac65b10837740caf68cdade791b8c5ce4eb1b03 (commit)
       via  9e3e4a835c64f5d06de821b1fd648af37827ff26 (commit)
      from  b02d9d0a7b96b186eb3063d94bde369339181461 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 961aea212ef48914ecbfa169addf951b0854b0b4
Author: Ben McGinnes <ben at adversary.org>
Date:   Thu Mar 15 15:51:01 2018 +1100

    doc: python bindings howto
    
    * Added key signing.

diff --git a/lang/python/docs/GPGMEpythonHOWTOen.org b/lang/python/docs/GPGMEpythonHOWTOen.org
index d22efbe..582a28f 100644
--- a/lang/python/docs/GPGMEpythonHOWTOen.org
+++ b/lang/python/docs/GPGMEpythonHOWTOen.org
@@ -1290,6 +1290,38 @@
    :CUSTOM_ID: key-sign
    :END:
 
+   Since key certification is more frequently referred to as key
+   signing, the method used to perform this function is =key_sign=.
+
+   The =key_sign= method takes four arguments: =key=, =uids=,
+   =expires_in= and =local=.  The default value of =uids= is =None=
+   and which results in all user IDs being selected.  The default
+   values of =expires_in= snd =local= is =False=; which result in the
+   signature never expiring and being able to be exported.
+
+   The =key= is the key being signed rather than the key doing the
+   signing.  To change the key doing the signing refer to the signing
+   key selection above for signing messages and files.
+
+   If the =uids= value is not =None= then it must either be a string
+   to match a single user ID or a list of strings to match multiple
+   user IDs.  In this case the matching of those strings must be
+   precise and it is case sensitive.
+
+   To sign Danger Mouse's key for just the initial user ID with a
+   signature which will last a little over a month, do this:
+
+   #+begin_src python
+     import gpg
+
+     c = gpg.Context()
+     uid = "Danger Mouse <dm at secret.example.net>"
+
+     dmfpr = "177B7C25DB99745EE2EE13ED026D2F19E99E63AA"
+     key = c.get_key(dmfpr, secret = True)
+     c.key_sign(key, uids = uid, expires_in = 2764800)
+   #+end_src
+
 
 * Miscellaneous work-arounds
   :PROPERTIES:

commit 7ac65b10837740caf68cdade791b8c5ce4eb1b03
Author: Ben McGinnes <ben at adversary.org>
Date:   Thu Mar 15 15:16:23 2018 +1100

    doc: python bindings howto
    
    * Added a new user ID for Danger Mouse.
    * Removed the empty entry for key preferences since that is handled
      through gpg.conf and/or editing the key directly.

diff --git a/lang/python/docs/GPGMEpythonHOWTOen.org b/lang/python/docs/GPGMEpythonHOWTOen.org
index 37318fc..d22efbe 100644
--- a/lang/python/docs/GPGMEpythonHOWTOen.org
+++ b/lang/python/docs/GPGMEpythonHOWTOen.org
@@ -1251,16 +1251,43 @@
    :CUSTOM_ID: keygen-uids
    :END:
 
+   By comparison to creating primary keys and subkeys, adding a new
+   user ID to an existing key is much simpler.  The method used to do
+   this is =key_add_uid= and the only arguments it takes are for the
+   =key= and the new =uid=.
 
-** Key preferences
-   :PROPERTIES:
-   :CUSTOM_ID: keygen-prefs
-   :END:
+   #+begin_src python
+     import gpg
+
+     c = gpg.Context()
+     c.home_dir = "/tmp/dmgpg"
+
+     dmfpr = "177B7C25DB99745EE2EE13ED026D2F19E99E63AA"
+     key = c.get_key(dmfpr, secret = True)
+     uid = "Danger Mouse <danger.mouse at secret.example.net>"
+
+     c.key_add_uid(key, uid)
+   #+end_src
+
+   Unsurprisingly the result of this is:
+
+   #+begin_src shell
+     bash-4.4$ gpg --homedir /tmp/dmgpg -K
+     /tmp/dmgpg/pubring.kbx
+     ----------------------
+     sec   rsa3072 2018-03-15 [SC] [expires: 2019-03-15]
+	   177B7C25DB99745EE2EE13ED026D2F19E99E63AA
+     uid           [ultimate] Danger Mouse <danger.mouse at secret.example.net>
+     uid           [ultimate] Danger Mouse <dm at secret.example.net>
+     ssb   rsa3072 2018-03-15 [E] [expires: 2018-09-13]
+
+     bash-4.4$
+   #+end_src
 
 
 ** Key certification
    :PROPERTIES:
-   :CUSTOM_ID: keygen-certify
+   :CUSTOM_ID: key-sign
    :END:
 
 

commit 9e3e4a835c64f5d06de821b1fd648af37827ff26
Author: Ben McGinnes <ben at adversary.org>
Date:   Thu Mar 15 14:59:36 2018 +1100

    doc: python bindings howto
    
    * Spell checking and fixing the few errors.

diff --git a/lang/python/docs/GPGMEpythonHOWTOen.org b/lang/python/docs/GPGMEpythonHOWTOen.org
index 0e61746..37318fc 100644
--- a/lang/python/docs/GPGMEpythonHOWTOen.org
+++ b/lang/python/docs/GPGMEpythonHOWTOen.org
@@ -35,8 +35,8 @@
    Much of it will work with Python 2, but much of it also deals with
    Python 3 byte literals, particularly when reading and writing data.
    Developers concentrating on Python 2.7, and possibly even 2.6, will
-   need to make the approprate modifications to support the older
-   string and unicode types as opposted to bytes.
+   need to make the appropriate modifications to support the older
+   string and unicode types as opposed to bytes.
 
    There are multiple reasons for concentrating on Python 3; some of
    which relate to the immediate integration of these bindings, some
@@ -61,7 +61,7 @@
    Unlike many modern APIs with which programmers will be more
    familiar with these days, the GPGME API is a C API.  The API is
    intended for use by C coders who would be able to access its
-   features by including the =gpgme.h= header file eith their own C
+   features by including the =gpgme.h= header file with their own C
    source code and then access its functions just as they would any
    other C headers.
 
@@ -208,7 +208,7 @@
    By default GPGME will attempt to install the bindings for the most
    recent or highest version number of Python 2 and Python 3 it
    detects in =$PATH=.  It specifically checks for the =python= and
-   =python3= executabled first and then checks for specific version
+   =python3= executables first and then checks for specific version
    numbers.
 
    For Python 2 it checks for these executables in this order:
@@ -275,7 +275,7 @@
    result of one operation has a direct bearing on the outcome of
    subsequent operations.  Not merely by generating an error either.
 
-   When dealing with this type of persistant state on the web, full of
+   When dealing with this type of persistent state on the web, full of
    both the RESTful and REST-like, it's most commonly referred to as a
    session.  In GPGME, however, it is called a context and every
    operation type has one.
@@ -351,7 +351,7 @@
     :END:
 
     Counting the number of keys in your public keybox (=pubring.kbx=),
-    the format which has superceded the old keyring format
+    the format which has superseded the old keyring format
     (=pubring.gpg= and =secring.gpg=), or the number of secret keys is
     a very simple task.
 
@@ -424,7 +424,7 @@
   :END:
 
   The most frequently called features of any cryptographic library
-  will be the most fundamental tasks for enxryption software.  In this
+  will be the most fundamental tasks for encryption software.  In this
   section we will look at how to programmatically encrypt data,
   decrypt it, sign it and verify signatures.
 
@@ -461,7 +461,7 @@
    the key was not found.
 
    The encryption operation is invoked within the Context with the
-   =c.op_encrypt= function, loading the recipien (=r=), the message
+   =c.op_encrypt= function, loading the recipients (=r=), the message
    (=plain=) and the =cipher=.  The =cipher.seek= uses =os.SEEK_SET=
    to set the data to the correct byte format for GPGME to use it.
 
@@ -798,7 +798,7 @@
 
    Though everything in this example is accurate, it is more likely
    that reading the input data from another file and writing the
-   result to a new file will be perfprmed more like the way it is done
+   result to a new file will be performed more like the way it is done
    in the next example.  Even if the output format is ASCII armoured.
 
    #+begin_src python
@@ -838,7 +838,7 @@
       signed = c.sign(text, mode=1)
 
       afile = open("/path/to/statement.txt.asc", "w")
-      for line in signed[0].splitlines()L
+      for line in signed[0].splitlines():
 	  afile.write("{0}\n".format(line.decode("utf-8")))
       afile.close()
     #+end_src

-----------------------------------------------------------------------

Summary of changes:
 lang/python/docs/GPGMEpythonHOWTOen.org | 89 +++++++++++++++++++++++++++------
 1 file changed, 74 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list