gpgme/lang/python/docs/dita/howto/part04/signing-key-selection.dita
Ben McGinnes f0063afa71 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 <ben@adversary.org>
2018-05-15 13:13:16 +10:00

29 lines
1.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
<topic id="topic_dpb_fqz_5db">
<title>Signing Key Selection</title>
<body>
<p>By default GPGME and the Python bindings will use the default key configured for the user
invoking the GPGME API. If there is no default key specified and there is more than one
secret key available it may be necessary to specify the key or keys with which to sign
messages and files.</p>
<p>
<codeblock id="sigkey-1" outputclass="language-python">import gpg
logrus = input("Enter the email address or string to match signing keys to: ")
hancock = gpg.Context().keylist(pattern=logrus, secret=True)
sig_src = list(hancock)
</codeblock>
</p>
<p>The signing examples in the following sections include the explicitly designated
<codeph>signers</codeph> parameter in two of the five examples; once where the resulting
signature would be ASCII armoured and once where it would not be armoured.</p>
<p>While it would be possible to enter a key ID or fingerprint here to match a specific key,
it is not possible to enter two fingerprints and match two keys since the patten expects a
string, bytes or None and not a list. A string with two fingerprints won't match any single
key.</p>
</body>
</topic>
</dita>