Commit Graph

581 Commits

Author SHA1 Message Date
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
Werner Koch
c7bb12da52
Merge branch 'json-tool' 2018-03-23 11:31:20 +01: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
76055dd5c7 Merge branch 'ben/docs/2018-03' of ssh+git://playfair.gnupg.org/git/gpgme into ben/docs/2018-03 2018-03-22 06:33:16 +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
Werner Koch
44f9e80ea9
Merge branch 'master' into json-tool 2018-03-20 11:13:14 +01: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