Commit Graph

481 Commits

Author SHA1 Message Date
Ben McGinnes
f7e5ae7f16 docs: python bindings - protonmail examples
* lang/python/docs/GPGMEpythonHOWTOen.org: Updated links to the
  ProtonMail keyserver import scripts and added a warning regarding
  being unable to update third party keys.
* lang/python/examples/howto/pmkey-import-alt.py: added usage.
* lang/python/examples/howto/pmkey-import.py: added usage.
2018-08-29 20:30:57 +10:00
Ben McGinnes
02d0b97bfe docs: python bindings HOWTO
* Finished CFFI vs SWIG bit in known issues.
* tidied up some of the structure.
* Fixed some minor errors and links.
2018-08-29 04:14:24 +10:00
Ben McGinnes
a8a983c5bc docs: python bindings
* Added section on why no CFFI.
2018-08-29 03:42:46 +10:00
Ben McGinnes
c2831e2377 docs: python howto
* Added another key import example using ProtonMail's new keyserver.
2018-08-28 18:45:37 +10:00
Ben McGinnes
1c261b9fa3 docs: python bindings
* Added details on installation troubleshooting.
2018-08-28 06:42:27 +10:00
Ben McGinnes
75bc5e6356 Python bindings examples
* import-key.py: fixed a minor typo.
* pmkey-import.py: locates and imports keys from the ProtonMail keyserver.
* pmkey-import-alt.py: the same as the previous except with setting an
  alternative $GNUPGHOME directory.
2018-08-19 14:32:30 +10:00
Ben McGinnes
03b899dbe1 Python bindings setup file
* Moved the build import back up where it belongs.
* Included comments indicating how to build and install for multiple
  Python versions beyond the first 2 on the same system.
2018-08-19 00:21:47 +10:00
Ben McGinnes
5facba45c8 Python bindings tests: Near PEP8 compliance
* PEP8 compliance for the vast majoeity of the tests.
2018-08-18 20:29:14 +10:00
Ben McGinnes
b5fbe90676 Python bindings examples: PEP8 conpliance
* Appears to be complete compliance.
2018-08-18 18:46:47 +10:00
Ben McGinnes
fc55caccfc Python bindings setup: Near PEP8 compliance
* lang/python/version.py.in: Fixed most things, but there's still an
  issue near the build portion with the existing Python bugs referenced.
* lang/python/setup.py.in: Now PEP8 compliant.
2018-08-18 18:19:16 +10:00
Ben McGinnes
8a6a73b9c4 Python bindings constants: PEP8 compliance (almost)
* PEP8 compliance for all constants except the globals in
  src/constants/__init__.py depending on whether the import sequence
  affects the globals themselves.
2018-08-18 15:36:23 +10:00
Ben McGinnes
7962cde13c Python bindings src: PEP8 compliance
* import namespace clearance for src/*.py.
* Fixed a handful of is/is not None checks as well.
2018-08-18 15:05:34 +10:00
Ben McGinnes
279cac0ffb Symmetric example
* lang/python/examples/howto/symcrypt-file.py: *sigh*; passphrase was
  right the first time, just the error check that wasn't.
* I really should stop second guessing myself one of these days ...

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-08-14 02:55:56 +10:00
Ben McGinnes
a256d84882 Symmetric encryption example
* lang/python/examples/howto/symcrypt-file.py: Fixed the error code
  and the passphrase key word arg.
2018-08-14 02:48:38 +10:00
Ben McGinnes
ed5ef8293c Symmetric encryption example.
* lang/python/examples/howto/symcrypt-file.py: A variation on standard
  key based encryption.
2018-08-14 02:22:36 +10:00
Ben McGinnes
94bf13e78e PEP8 compliance and other code fixes
* Ran all the .py files in src/ and below through Yapf.
* Included some manual edits of core.py, this time successfully making
  two notorious sections a bit more pythonic than scheming.
* Left the module imports as is.
* This will be committed if it passes the most essential test:
  compiling, installing and running it.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-08-10 11:25:01 +10:00
Ben McGinnes
b6d2a66b41 Link fixes
* lang/python/README: Fixed links in both versions of the README.
2018-08-10 03:42:15 +10:00
Andre Heinecke
d09d19fa9f
Make GNUPGHOME for tests overridable
* lang/python/tests/Makefile.am,
lang/qt/tests/Makefile.am,
tests/Makefile.am,
tests/gpg/Makefile.am,
tests/gpgsm/Makefile.am,
tests/opassuan/Makefile.am (GNUPGHOME): Make variable explict.

--
If the build directory has too long path, gpgme could fail.
This is similar to

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847206

In order to fix that, this patch extracts the GNUPGHOME variable
to be presented directly in the Makefile and thus overridable by
command line option.

A build system can then create a symlink to the GNUPGHOME directory
in /tmp and use that symlink as the GNUPGHOME directory
thus making the path very short.

GnuPG-Bug-Id: T4091

Patch provided by vlmarek
2018-08-06 09:30:47 +02:00
Ben McGinnes
4d1642b11e docs: python bindings howto
* Fixed and tested the changes necessary for org-mode to correctly
  parse pythonic (Python 3) indentation.
* Updated the source blocks to recommended upper case for BEGIN_SRC
  and END_SRC.
* Tested and confirmed XHTML output matches correct examples.
* Tested against pseudo-control output via exporting from org-mode to
  org-mode and then exporting that to XHTML.  Remaining differences
  appear to be discarding the custom tags used to provide X[HT]ML id
  elements to each section which does not appear to offer any benefit.
* Exporting directly to XHTML or other HTML output should no longer
  cause problems, but if there are any then the first step should be
  exporting from org-to-org and then exporting that to XHTML.

Tested-by: Ben McGinnes <ben@adversary.org>
Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-07-23 01:35:12 +10:00
Ben McGinnes
d7c5366d58 doc: python bindings howto
* Another retrofitting of the HOWTO Python example code, this time
  following adjustments to python-mode configuration and having
  trawled through the org-mode mailing lists for clues.
2018-07-23 01:35:12 +10:00
Ben McGinnes
b47e1bb98a doc: python bindings howto
* Added org-mode byline.
2018-07-23 01:35:12 +10:00
Ben McGinnes
1bb3f8409d python bindings: example scripts
* Fixed incorrect mention of output prompt referencing secret keys
  when the scripts are only for exporting public keys in whole or
  minimised forms.
2018-07-13 20:36:27 +10:00
Ben McGinnes
0e760e396f example scripts: python work-arounds
* fixed three typos which were guaranteed to break said script.
2018-07-10 13:40:18 +10:00
Ben McGinnes
1eceacaff4 docs: python bindings howto
* Complete typographic overhaul.
* Removed all section level indentation since it does not affect
  output formatting, but might affect source code examples.
* In text-mode stripped out all tabs which had crept in and replaced
  them with four spaces.
* Updated all code examples (again) to conform with Python-mode.
* Bumped version number in preparation for next release of GPG 2.2.9
  and corresponding GPGME release.
2018-07-09 21:30:20 +10:00
Ben McGinnes
cacca62d06 python bindings: howto examples
* Made sure all example scripts meet PEP8 compliance.
* Required fixing approx. a dozen of them in minor ways.
2018-07-08 03:40:35 +10:00
Ben McGinnes
5bca499750 python bindings: scheming serpents
* Apparently I am wrong and Scheme is the new Python after all.
* Non-import related PEP8 compliance must wait for another day, though
  the other PEP8 fixes remain.
2018-07-02 05:05:09 +10:00
Ben McGinnes
789ea1b019 python bindings: gpg.core
* Changed id/else statements to a more pythonic form from scheme
  masquerading as python - sorry Justus, it had to go ;).
* With the added bonus of enabling PEP8 compliance in those sections.
* Fixed remaining PEP8 compliance issues with the exception of the
  imports at the beginning of the file (changing those will break the
  entire module, so we'll cope with it as it is).
2018-07-02 03:55:19 +10:00
Ben McGinnes
43a2b57545 python bindings: python 3.7
* Bindings confirmed to work with the newly released 3.7.0.
* Updated M4 file to reflect this change and correct the Python binary
  search order (3.7 is not yet given priority, but will still be found
  first via the more generic python3 executable).
* Updated setup.py.in, bindings documentation and README to reflect this.
2018-06-29 14:26:30 +10:00
Ben McGinnes
48174b2bcc whitespace police:
* There's always one or, in this case, two.
2018-06-28 18:51:47 +10:00
Ben McGinnes
6aec7d6e4a docs: python bindings howto
* Updated official doc (the org-mode file) with the instructions on
  importing and exporting both public and secret keys.
2018-06-28 18:51:47 +10:00
Ben McGinnes
a7ccdc51ef python bindings examples
* Added a secret key export variant which saves output as both GPG
  binary and ASCII armoured, plus saves in $GNUPGHOME and uses
  multiple methods of determining what that location is.
2018-06-28 18:51:47 +10:00
Ben McGinnes
7fc7e80e54 python bindings examples
* Added a key import variant which accesses the SKS keyservers in a
  RESTful fashion and then imports or attempts to import the response.
2018-06-28 18:51:47 +10:00
Ben McGinnes
0d163a7d12 python bindings examples: three export scripts
* Example of default exporting keys.
* Example of exporting minimised keys.
* Example of exporting secret keys to a file with correct permissions.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-06-28 18:51:47 +10:00
Ben McGinnes
4251cae34d python bindings: import example
* Added an example script for importing a key from a file (either
  ASCII armoured or not).
2018-06-28 18:51:47 +10:00
Ben McGinnes
a5b91b21f5 python bindings: export secret keys
* The holy grail: a function to export secret keys.
* GPGME will still invoke pinentry and gpg-agent as usual to authorise
  the export.
* Mostly similar to the two previous export functions for public keys
  except that it will return None if the result had a length of zero
  bytes.  Meaning that the difference between the specified pattern
  (if any) not matching available keys and an incorrect passphrase is
  not able to be determined from this function (or the underlying one
  for that matter).

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-06-28 18:51:47 +10:00
Ben McGinnes
7faef33d13 python bindings: export public keys
* Updated key_export and key_export_minimal to return None where a
  pattern matched no keys in a manner simnilar to the possible result
  of key_export_secret.
2018-06-28 18:51:47 +10:00
Ben McGinnes
89c548efdf python bindings: export public keys
* Added functions for exporting public keys to gpg.core in both
  complete form and in minimised form.
* Rather than letting people need to worry about the export modes we
  are simply separating the functions as people would be more familiar
  with from the command line usage anyway.
* Functions added for Context are: ctx.key_export_minimal and
  ctx.key_export as the default or full export.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-06-28 18:48:05 +10:00
Ben McGinnes
19c5267f86 python bindings: core import statements
* Fixed the bit I broke while fixing the PEP8 compliance issues.
2018-06-17 22:42:43 +10:00
Ben McGinnes
a5b24ae46c python bindings: core — PEP8 compliance
* Fixed most of the PEP8 errors in core.py
* Those remaining may need more than little edits and are a bit
  strange (too clearly the result of a programmer who has spent far
  too much time dealing with Lisp so that for Python it looks
  ... strange).
2018-06-17 15:58:44 +10:00
Ben McGinnes
5a80e75500 python bindings: core - key import
* Wrapped the key import function in the try/exception statements
  needed to catch at least the most likely unsuccessful import attempt
  errors.
* Mostly draws on the file error and no data import statuses for
  errors, with a couple of exceptions.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-06-17 14:35:20 +10:00
Ben McGinnes
0e762608ef python bindings: core key import
* The foundation of a pythonic key import function authored by Jacob
  Adams.
* A unit testing script for the same function originally authored by
  Tobias Mueller
* Added DCO reference for Jacob Adams to the GPGME AUTHORS file.
* Additional details regarding this patch are available here:
  https://dev.gnupg.org/T4001

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-06-17 09:28:30 +10:00
Ben McGinnes
92cd060f5e script: groups.py
* Added check for if it is run on a Windows system so that the correct
  binary filename is invoked.
2018-06-11 01:03:58 +10:00
Ben McGinnes
a3a08584d6 examples: python howto
* Uses the groups module to prepare a list of recipients and encrypt
  to those.
* The main version (encrypt-to-group.py) tries to check for invalid
  recipients, but still falls back to always trust for the second
  encryption attempt.
* The gullible version doesn't try pruning the recipient list at all,
  it just tries to encrypt and if it fails, switches straight to
  always trust.
* The trustno1 version doesn't use the always trust model at all and
  only attempts pruning the list of invalid recipients.
2018-06-07 15:06:20 +10:00
Ben McGinnes
897423422b docs: python bindings howto
* Another attempt at fixing the org-mode version.
* A proof reader ascertained there were tabs in it instead of whitespace.
* Stripped the lot out and replaced with standard 4 spaces, fixed
  every incorrect example ... and it still breaks upon save and/or export.
* Added the reference to the mutt-groups.py script to demonstrate the
  groups.py module/code.
2018-06-03 00:46:46 +10:00
Ben McGinnes
321005c12f examples: mutt crypt-hooks generator
* Added a script which demonstrates how the groups module works.
* Script generates Mutt/Neomutt crypt-hooks for every group entry in
  gpg.conf, including those entries for multiple keys (Mutt handles
  that differently).
2018-05-25 07:12:52 +10:00
Ben McGinnes
48e946a96d docs: python bindings howto
* Fixed the groups.py script so it really does what is described (the
  old code had the same result for groups, group_lines and
  group_lists).
* Updated the corresponding example in the doc to match.
2018-05-25 05:50:11 +10:00
Ben McGinnes
9038d30017 doc: python bindings howto
* Fixed org-mode python source indenting.
** Note: nested indented blocks do not indent correctly when exported
   to [X]HTML.
2018-05-25 05:50:11 +10:00
Ben McGinnes
3a9e6a8e08 docs and examples: python howto
* Updated the decryption example code in the HOWTO and the
  corresponding decrypt-file.py script to gracefully handle a
  decryption failure.  This error will always be triggered when GPGME
  is used to try to decrypt an old, MDC-less encrypted message or
  file.
2018-05-23 14:43:06 +10:00
Ben McGinnes
46da79e3de python: key expiration datetime stamp tests
* Changed the expiration date for the generated test key to NYE this
  century, rather than the NYE this millennium as originally suggested
  in job #3815.
* This covers the lifetimes of current users (except, maybe, some very
  healthy millennials) as well as the 32-bit clock end date in 2038;
  without falling foul of OpenPGP's 2106 expiration.
2018-05-05 12:27:17 +10:00
Werner Koch
67b4dafb6d
doc: Update copyright years and change two URLs.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-04-18 19:30:50 +02:00
Tobias Mueller
bbfa7c4233
python: Fix crash by leaving struct members intact
* lang/python/setup.py.in: Copy gpgme.h instead of parsing it.
--
The python bindings tried to parse deprecated functions
out of gpgme.h. This fails for the current gpgme.h in
that it removes an entire field in the key sig struct (_obsolete_class).
Hence, the fields were off by an int and the bindings accessed struct
members via the wrong offset. That caused python program to crash.
At least on 32bit platforms, the crash can be easily triggered by
accessing key.uids[0].signatures. On 64bit platforms the compiler
probably aligns the struct so that the missing 4 bytes are not noticed.

With this change, the python bindings will expose all functions
that gpgme exposes, including the deprecated ones.

Credits go to Justus Winter for debugging and identying the issue.

Signed-off-by: Tobias Mueller <muelli@cryptobitch.de>
GnuPG-bug-id: 3892
2018-04-17 10:20:12 +02:00
Ben McGinnes
fed024eff1 Merge branch 'master' of ssh+git://playfair.gnupg.org/git/gpgme
* Also fixed a small grammatical error highlighted by a merge conflict
  (in the python bindings howto).
2018-03-30 10:38:31 +11:00
Ben McGinnes
3b91f6af37 example: revoke UID
* Script to revoke a UID on an existing key.
2018-03-29 10:21:52 +11:00
Ben McGinnes
d65864989c docs: python bindings howto
* Added section on revoking UIDs.
2018-03-29 10:16:07 +11:00
Ben McGinnes
56bbfd39ac example: key signing
* Added script for signing or certifying keys.
2018-03-29 09:49:08 +11:00
Ben McGinnes
5a553f5a31 doc: python bindings howto
* Fixed a typo.
2018-03-29 09:22:17 +11:00
Ben McGinnes
2f507b0459 docs python bindings howto
* PEP8 compliance: a collection of minor edits across multiple example
  code snippets.
2018-03-29 07:22:37 +11:00
Ben McGinnes
5cd4193418 example: add user ID
* Added script to add a UID to an existing key.
2018-03-29 06:36:14 +11:00
Ben McGinnes
a2eedef630 doc: python bindings howto
* Fixed some minor PEP8 compliance issues in the key creation examples.
2018-03-27 12:42:06 +11:00
Ben McGinnes
f9159b1d75 example: key creation
* Script to generate a new key with encryption subkey taking input
  from interactive prompts.
* Will also take a passphrase via pinentry and uses passphrase caching
  of five minutes when used in conjunction with the temp homedir
  script.
2018-03-27 12:29:08 +11:00
Ben McGinnes
1b5da37a47 script: temp homedir config
* added passphrase caching of 5 minutes.
2018-03-27 12:16:29 +11:00
Ben McGinnes
5b32efbaf3 doc: python bindings howto
* Testing the addition of a HTML header set in org-mode in order to
  had RSS update links for files.
* This should work with any [X]HTML export from current versions of
  Org-Mode, but if it also works on website generated pages then it'll
  tick off one of the wishlist itmes.
2018-03-25 22:25:52 +11:00
Ben McGinnes
40a9dea5d5 script: temp homedir
* Fixed whitespace.
2018-03-25 11:54:05 +11:00
Ben McGinnes
3b724aae42 doc: python bindings howto
* Added a reference to new script which will setup a temporary homedir
  for a user.
2018-03-25 11:35:11 +11:00
Ben McGinnes
dde1aae312 script: temporary homedir creation
* Script to create a temporary gnupg homedir in the user's directory
  for testing or scripting purposes.
* Creates a hidden directory on POSIX systems with the correct
  permissions (700).
* Creates a gpg.conf in that directory containing the same
  configuration options as used in the "Danger Mouse" example in the
  HOWTO with the correct permissions (600).
2018-03-25 11:26:26 +11:00
Ben McGinnes
22247f658c doc: python bindings howto
* Fixed the plaintext, result and verify_result references in the
  decryption section.
2018-03-25 10:01:14 +11:00
Ben McGinnes
e6180f2b36 doc: python bindings howto
* Fixed a minor spelling error and a minor grammatical error.
2018-03-24 06:41:36 +11:00
Ben McGinnes
65ed4ac825 doc: python bindings howto
* Fixed table.
2018-03-22 10:06:53 +11:00
Ben McGinnes
5722148bac doc and examples: python bindings HOWTO
* Added GPGME Python bindings HOWTO in Australian/British English.
** en-US "translation" still to be done.
* Added several example scripts comprised of the "Basic Functions"
  section of the HOWTO (plus the work-around at the end).
** As these scripts are very basic examples they are released under
   both the GPLv2+ and the LGPLv2.1+ (just like GPGME itself).

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-03-22 06:37:02 +11:00
Ben McGinnes
05e5993305 examples: multi-key selection operations
* Temporarily removing multi-key selection based examples.
* There are a few issues with getting the key selections to play
  nicely with gpg.Context().keylist object types.
* Will troubleshoot them separately and restore them when that's
  worked out, but I don't want these more complicated examples to
  delay merging the HOWTO with master.
2018-03-22 06:19:36 +11:00
Ben McGinnes
61a988036b example: group encryption
* Troubleshooting.
2018-03-22 06:18:13 +11:00
Ben McGinnes
7ddff71908 examples: encryption
* Fixed two incorrect Context() objects.
2018-03-22 06:05:10 +11:00
Ben McGinnes
c6a0395f0a example: key selection
* Removed extraneous blank line.
2018-03-22 05:55:53 +11:00
Ben McGinnes
0a0d57fd41 example: key selection
* Similar to group-key-selection.py, but does not use an existing
  group from gpg.conf; instead takes multiple key IDs, fingerprints or
  patterns on the command line and adds them to a keylist object.
2018-03-22 05:52:55 +11:00
Ben McGinnes
0ccc57c951 example: sign and encrypt to group
* Begins to string together some of the simpler examples to do more
  useful things.
* Signs and encrypts a file while encrypting to every key in a group
  specified in the gpg.conf file.
2018-03-22 05:40:02 +11:00
Ben McGinnes
8b401bfc76 example: group key selection
* Example of preparing a keylist object using an existing group line
  from the gpg.conf file.
2018-03-22 05:20:51 +11:00
Ben McGinnes
6c6af9a7b0 example groups work around
* Updated usage so it only references importing the final list of
  lists produced.  Trying to use some of the mid-points can have
  unpredictable results (this is part of the problem with work
  arounds).
2018-03-22 05:07:56 +11:00
Ben McGinnes
a4e3f82765 example: groups
* Added a docstring.
2018-03-22 04:04:05 +11:00
Ben McGinnes
ad6cb4f9b8 example: verify signatures
* Added example for verifying detached signatures against the files
  they're the signatures for.
2018-03-22 03:58:58 +11:00
Ben McGinnes
ae2767eb27 example: verify signed file
* Added example to verify normal and clearsigned files.
2018-03-22 01:50:08 +11:00
Ben McGinnes
e57388a69f doc: python bindings howto
* Fixed minor error in one of the verification examples.
2018-03-22 01:48:41 +11:00
Ben McGinnes
ac6a552c37 example: detach sign file
* Added example to make detached signatures of a file with key selection.
2018-03-22 01:30:32 +11:00
Ben McGinnes
af6cbba18b example: encrypt-sign-file.py
* Adjusted the doc string.
2018-03-22 01:26:43 +11:00
Ben McGinnes
6fa2a34428 examples: doc strings
* Fixed minor errors in two doc strings.
2018-03-22 01:24:52 +11:00
Ben McGinnes
1fdd1f306d example: clear signing
* Added example to clear sign a file with signing key selection.
2018-03-22 01:18:37 +11:00
Ben McGinnes
1d2746433c doc: python bindings howto
* deconstructed and fixed all three signing methods.
2018-03-22 01:12:36 +11:00
Ben McGinnes
0390ede186 example: sign file
* Similar to encrypt file except for signing a file in normal mode.
* Noticed additional changes to be made to the howto to match this,
  but they will have to wait due to a power outage (currently running
  on battery and a mobile connection, but that won't last).
2018-03-21 12:28:03 +11:00
Ben McGinnes
52e262991f doc: python bindings howto
* Fixed typos in examples.
2018-03-20 14:57:26 +11:00
Ben McGinnes
96d0395bcc example: keycount
* Fixed missing parenthesis.
2018-03-20 14:55:05 +11:00
Ben McGinnes
51258975d7 example: decrypt file
* Decrypts a file taking file names as command line parameters.
2018-03-20 14:32:53 +11:00
Ben McGinnes
29e918171f example: groups work-around
* Added groups selection work around code.
* Intended for use as a module to be imported by other scripts,
  usually with "from groups import group_lists" or "from groups import
  group_lines" or similar.
2018-03-20 14:19:16 +11:00
Ben McGinnes
7221bb6764 example: encrypt file
* Nested encryption in try/except statement in case recipient key is
  untrusted or invalid.
2018-03-20 09:53:27 +11:00
Ben McGinnes
f3fe47e8fd example: sign and encrypt file
* Example to sign and encrypt a file.
* Similar to encrypt-file.py except all keys are considered trusted
  and signs with the default key.
* Also encrypts to the default key.
2018-03-20 09:47:39 +11:00
Ben McGinnes
f0790f224d example: encrypt file
* Fixed typo in second encryption call.
2018-03-20 09:39:48 +11:00
Ben McGinnes
7ab42e79ad example: encrypt file
* Example to encrypt a file to a single key.
* Takes key ID and/or fpr as a CLI parameter.
* Takes path and filename as a CLI parameter.
* Encrypts to specified key only, no signing and writes the output in
  both ASCII armoured and GPG binary formats with output filenames
  based on input filename.
2018-03-20 09:25:34 +11:00
Ben McGinnes
cfbdcb7fb3 example: python bindings key count
* Added script wo count the number of keys in both the public and
  secret key stores.
2018-03-20 08:55:01 +11:00
Ben McGinnes
b30ebf8972 doc: python bindings examples
* Explicitly stated that all this code is released under the GPLv2+
  and the LGPLv2.1+.
2018-03-20 08:39:49 +11:00
Ben McGinnes
8f7672ad1b doc: python bindings example README
* Added the same license as used with the HOWTO.
* Since these examples are so basic, they'll be dual licensed the same
  as GPGME itself (otherwise it would slip too dangerously against the
  need for permissive licensing of crypto libraries).
2018-03-20 08:31:53 +11:00
Ben McGinnes
6950a63e63 docs: python bindings examples
* Added reference to location where all the examples included in the
  HOWTO will be available as executable scripts.
* Included a short README file in that location.
2018-03-20 08:26:57 +11:00
Ben McGinnes
3e0f68fdff example: python bindings encryption
* Since we don't want to encourage accessing the low level functions
  (e.g. op_encrypt), but since this example can still be useful to
  understand, renaming it and will add new encryption examples to
  match the instructions in the HOWTO.
2018-03-20 08:07:22 +11:00
Ben McGinnes
d5f6dec048 doc: python bindings howto
* Slight python-gnupg clarification.  See also this thread:
  https://lists.gnupg.org/pipermail/gnupg-devel/2018-March/033528.html
2018-03-19 15:03:00 +11:00
Ben McGinnes
0fb8a5d45c doc: python bindings howto
* Adjusted the python-gnupg so the comments regarding insecure
  invocation of commands via subprocess (shell=True) were a major
  historical issue and not a a current issue.
* Not including Vinay Sajip's requested change to say it is now secure
  since no audit of the current code base has been performed and my
  last major inspection of that code was around the time I first
  ported PyME to Python 3 in 2015.
2018-03-19 13:09:46 +11:00
Ben McGinnes
bf67cf433f doc: python bindings todo list
* Checked off several points of howto coverage as completed.
* Reorganised to move S/MIME coverage to its own separate group of tasks.
* Noted only revocation remains for howto completion.
2018-03-19 12:46:41 +11:00
Ben McGinnes
1779d7b9d6 doc: python bindings howto
* deconstructing multi-recipient encryption.
2018-03-19 10:39:53 +11:00
Ben McGinnes
64c5886132 doc: python bindings howto
* Replaced the single encryption methods with one main way (i.e. cut
  the low level stuff involving SEEK_SET instructions).
2018-03-19 10:00:44 +11:00
Ben McGinnes
4811ff7b6c doc: python bindings howto
* moved single encrytion examples up to the first ones, pending merge
  and major cut.
* This is basically just to make future checks of revisions a little easier.
2018-03-19 08:49:17 +11:00
Ben McGinnes
82c5af225f doc: python bindings howto
* Stripped decryption example to the bare bones as suggested by Justus.
2018-03-19 08:43:36 +11:00
Ben McGinnes
b549f69d05 doc: python bindings howto
* Made the changes suggested by Jakub Wilk on gnupg-devel.
* Still need to make the far more comprehensive changes suggested by Justus.
2018-03-17 03:46:02 +11:00
Ben McGinnes
431897a4c4 doc: python bindings howto
* Added clarification on why it's not on PyPI.
2018-03-16 03:52:58 +11:00
Ben McGinnes
22e2445bee doc: python bindings howto
* fixed custom_id for decryption so the XHTML validates.
2018-03-16 01:48:56 +11:00
Ben McGinnes
94a95ac123 doc: python bindings howto
* Promoted final encryption example so that it will appear as heading
  6.1.3 when exported to HTML or PDF.
2018-03-16 01:34:22 +11:00
Ben McGinnes
3d0c7a2202 doc: python bindings howto
* Fixed a minor typographic error.
* Bumped version number in preparation for merge with master.
* While there are probably a few more things worthy of being added
  (mainly how to revoke things), this document is essentially ready
  for publication now.

Signed-off-by: Ben McGinnes <ben@adversary.org>
2018-03-15 16:13:34 +11:00
Ben McGinnes
961aea212e doc: python bindings howto
* Added key signing.
2018-03-15 15:51:01 +11:00
Ben McGinnes
7ac65b1083 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.
2018-03-15 15:16:23 +11:00
Ben McGinnes
9e3e4a835c doc: python bindings howto
* Spell checking and fixing the few errors.
2018-03-15 14:59:36 +11:00
Ben McGinnes
b02d9d0a7b doc: python bindings howto
* Added an encryption subkey to Danger Mouse's primary key.
2018-03-15 14:43:44 +11:00
Ben McGinnes
5432e5f9d1 doc: python bindings howto
* generated a new primary key for Danger Mouse in an alternative homedir.
2018-03-15 14:01:30 +11:00
Ben McGinnes
5d1dd2abe5 doc: python bindings howto
* Added sections for key generation and key editing.
2018-03-15 12:27:45 +11:00
Ben McGinnes
1d05e6aa4e doc: python bindings howto
* Added c.get_key instructions and examples.
2018-03-15 12:14:29 +11:00
Ben McGinnes
b35aaef7a3 doc: python bindings howto
* Added text for verifying signatures.
2018-03-15 11:18:02 +11:00
Ben McGinnes
6bc12a0eeb doc: python bindings howto
* Added 4 signature verification methods and partial text for them.
2018-03-15 07:20:31 +11:00
Ben McGinnes
e5c85fba25 doc: python bindings howto
* Added description for detached signatures.
2018-03-15 04:07:57 +11:00
Ben McGinnes
ada059b071 doc: python bindings howto
* Fixed multiple sample code examples of writing output to a file.
* Added the description of detached signatures.
2018-03-15 03:51:51 +11:00
Ben McGinnes
ef27f3781a doc: python bindings todo
* minor phrasing fix.
2018-03-14 20:40:50 +11:00
Ben McGinnes
423fdcd465 doc: python bindings howto
* Added recommended method of single encryption with description.
2018-03-14 20:36:30 +11:00
Ben McGinnes
a71205dc3b doc: python binding howto
* Clarified which English dialects this is written in.
* Translating to American can happen *after* it's done.
** The Yank version would probably want to change some of the examples
   anyway.
* Began the description for normal/default signing.
2018-03-14 02:40:41 +11:00
Ben McGinnes
a10dcb4f13 doc: python bindings howto
* Added a section on key selection.
* Included recommendation for using fingerprint when selecting one
  specific key.
* Also included the most ironically amusing example of multiple key
  selection in a GPG guide.  Hey, it's public data ... (heh).
2018-03-14 02:21:44 +11:00
Ben McGinnes
952b6042f7 doc: python bindings howto
* Added explanation of the ascendance of Python 3 over Python 2 in the
  guide to the intro.
* Expanded key selection description so people know what not to
  include regarding key IDs with this key selection method.
2018-03-14 01:41:21 +11:00
Ben McGinnes
c92da2c7eb doc: python bindings howto
* Added key selection for specifying signing key or keys.
2018-03-13 19:20:44 +11:00
Ben McGinnes
e489ddd08a doc: python bindings howto
* During the course of working out the updated signature methods,
  determined that key selection (including counting) will beed to be
  presented before the basic functions.
* Moved "working with keys" up.
2018-03-13 18:32:30 +11:00
Ben McGinnes
f29bda8d71 doc: python bindings howto
* Signatures have changed as a result of the recent update from Justus.
* Sample code updated.
* Text to follow later.
2018-03-13 15:03:11 +11:00
Ben McGinnes
c27a7a3f99 doc: python bindings howto
* Added text description for the decryption example.
2018-03-13 11:50:38 +11:00
Ben McGinnes
f81adeba99 doc: python bindings howto
* Added a miscellaneous work-arounds section at the end.
* Included code in said miscellaneous section for accessing the groups
  specified in a gpg.conf file.
* It's a bit ugly since it does require subprocess (but not call,
  Popen or shell access and only accesses one command).
2018-03-13 08:26:22 +11:00
Ben McGinnes
36dfbdffea doc: python bindings howto
* Fixed a spelling error in the key counting text.
2018-03-13 07:49:42 +11:00
Ben McGinnes
484e9a6229 doc: python bindings howto
* updated multi-encryption final example to be complete.
* second example shows most likely method of reading plaintext.
* updated example filenames to stick with running gag
  (i.e. secret_plans.txt).
2018-03-13 07:42:04 +11:00
Ben McGinnes
a8f48b6f57 doc: python bindings howto
* error corrections.
* multiple typesetting fixes only required due to certain archaic
  eccentricities of LaTeX.
* a couple of minor python PEP8 compliance corrections.
2018-03-13 06:09:53 +11:00
Ben McGinnes
83b1336cee doc: python bindings howto
* Fixed an error in the encryption try/except statement.
2018-03-13 05:42:50 +11:00
Ben McGinnes
0e1300ce77 doc: python bindings howto
* Added a more complicated encryption example with a few variations on
  the encryption method to account for untrusted recipient keys,
  signing or not signing, including or excluding default keys and so
  on.
2018-03-13 04:55:44 +11:00
Ben McGinnes
7ebc5a3570 doc: python bindings howto
* Switched from links to some external docs to using footnotes where
  necessary.
* Ideally the howto should be as stand alone as possible.
* Also it makes it difficult to convert to another format for
  proof-reading if there are links that the conversion can't find.
2018-03-13 00:33:11 +11:00
Ben McGinnes
172baaf4d3 doc: python bindings HOWTO
* Added instructions and code to count the number of public and secret
  keys available since it was quick and easy.
2018-03-09 20:45:14 +11:00
Ben McGinnes
f2c1e8d8d5 doc: python TODO list
* Slightly tweaked one heading to make it clear it wasn't a duplicate.
2018-03-09 20:44:02 +11:00
Ben McGinnes
0168646394 doc: python bindings howto
* Wrote the text description explaining each step in the most basic
  encryption operation.
* Will need to include additional examples for encrypting to multiple
  recipients using Context().encrypt instead of Context().op_encrypt.
2018-03-09 16:49:05 +11:00
Ben McGinnes
93252df9dc doc: python bindings TODO list
* Updated to reflect the most recent work on the HOWTO for the Python
  bindings.
2018-03-09 15:27:40 +11:00
Ben McGinnes
ab81c2d868 doc: python bindings howto
* Added example for verifying both detached and "in-line" signatures.
2018-03-09 15:22:24 +11:00
Ben McGinnes
fa4927146b docs: python bindings howto update.
* Added all four signing code examples that are most likely to be
  used: armoured, clearsigned, detached armoured and detached binary.
* May remove some examples and just discuss the differences, but it
  depends on the way the text is filled out.
2018-03-09 07:53:57 +11:00
Ben McGinnes
c767a4a359 doc: python bindings howto update
* Added example of decryption.
* included some quick notes for myself regarding aspects to explain
  when I flesh out the explanatory text.
2018-03-09 05:25:49 +11:00
Ben McGinnes
75463d5895 doc: Basic operation of the python bindings
* Added sample code for encrypting some text to a single key.
* Basically I'm just lifting existing production code and changing the
  key IDs from mine to "0x12345678DEADBEEF" for these first few
  examples.
* I'll fill in the text description after.
* Note: due to my regional location, I might split some tasks into
  more commits in order to be sure no work gets lost in case of
  emergency (or to put it another way: I know Telstra too well to
  trust them).
2018-03-09 04:42:41 +11:00
Ben McGinnes
a98f2c556f doc-howto: fundamental aspects of GPGME vs Python
* Added a section for those pythonistas who are too used to web
  programming.  Stressed that it's not simply not RESTful, it's not
  even REST-like.
* Letting me move on to drawing a very loose parallel between a
  session and a context.  The differences should become obvious in the
  subsequent sections.
2018-03-08 15:23:05 +11:00
Ben McGinnes
e8adab68f8 doc: Added multiple TODOs for inclusion in the HOWTO
* Some instructions to include are fairly obvious; as with encryption,
  decryption and signature verification.
* Some are a little less obvious.
* This includes the requests received to specifically include subkey
  management (adding and revoking subkeys on a primary key that's
  being retained.
* Added the UID equivalents to the list, as well as key selection
  matters (and may or may not include something for handling group
  lines since that involves wrapping a CLI binary).
* Key control documentation and examples requested by Mike Ingle of
  confidantmail.org.
2018-03-08 14:13:00 +11:00
Ben McGinnes
47d401d159 GPL compatible license for documentation
* Added the same, slightly modified GPL based license that is used in
  other parts of GnuPG.
2018-03-07 21:27:54 +11:00