From f0063afa71bc7e71f19d174acc2fde26f0c11850 Mon Sep 17 00:00:00 2001 From: Ben McGinnes Date: Tue, 15 May 2018 13:13:16 +1000 Subject: docs: python bindings HOWTO - DITA XML version * Due to the org-babel bug which breaks Python source code examples beyond the most simple snippets, ported the HOWTO to a source format which I *know* for sure won't break it. * Details of the org-mode bug is in https://dev.gnupg.org/T3977 * DITA project uses DITA-OT 2.x (2.4 or 2.5, IIRC) with support for DITA 1.3. * source files were written with oXygenXML Editor 20.0, hence the oXygenXML project file in the directory; however only the .ditamap and .dita files are required to generate any output with the DITA-OT. Signed-off-by: Ben McGinnes --- .../docs/dita/howto/part05/certification.dita | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lang/python/docs/dita/howto/part05/certification.dita (limited to 'lang/python/docs/dita/howto/part05/certification.dita') diff --git a/lang/python/docs/dita/howto/part05/certification.dita b/lang/python/docs/dita/howto/part05/certification.dita new file mode 100644 index 00000000..072c774e --- /dev/null +++ b/lang/python/docs/dita/howto/part05/certification.dita @@ -0,0 +1,36 @@ + + + + + Key Certification + +

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 value of both expires_in and + local is False; which results 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:

+

+ import gpg + +c = gpg.Context() +uid = "Danger Mouse <dm@secret.example.net>" + +dmfpr = "177B7C25DB99745EE2EE13ED026D2F19E99E63AA" +key = c.get_key(dmfpr, secret=True) +c.key_sign(key, uidsuid, expires_in=2764800) + +

+ +
+
-- cgit v1.2.3