aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-03-25script: temp homedirhowto-update-01Ben McGinnes1-1/+1
* Fixed whitespace.
2018-03-25script: temporary homedir creationBen McGinnes1-0/+119
* 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-21examples: multi-key selection operationsben/docs/2018-03Ben McGinnes3-190/+0
* 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-21example: group encryptionBen McGinnes1-1/+1
* Troubleshooting.
2018-03-21examples: encryptionBen McGinnes2-2/+2
* Fixed two incorrect Context() objects.
2018-03-21example: key selectionBen McGinnes1-1/+0
* Removed extraneous blank line.
2018-03-21example: key selectionBen McGinnes1-0/+52
* 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-21example: sign and encrypt to groupBen McGinnes1-0/+83
* 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-21example: group key selectionBen McGinnes1-0/+56
* Example of preparing a keylist object using an existing group line from the gpg.conf file.
2018-03-21example groups work aroundBen McGinnes1-1/+1
* 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-21example: groupsBen McGinnes1-0/+6
* Added a docstring.
2018-03-21example: verify signaturesBen McGinnes1-0/+64
* Added example for verifying detached signatures against the files they're the signatures for.
2018-03-21example: verify signed fileBen McGinnes1-0/+61
* Added example to verify normal and clearsigned files.
2018-03-21example: detach sign fileBen McGinnes1-0/+64
* Added example to make detached signatures of a file with key selection.
2018-03-21example: encrypt-sign-file.pyBen McGinnes1-2/+2
* Adjusted the doc string.
2018-03-21examples: doc stringsBen McGinnes2-2/+4
* Fixed minor errors in two doc strings.
2018-03-21example: clear signingBen McGinnes1-0/+56
* Added example to clear sign a file with signing key selection.
2018-03-21example: sign fileBen McGinnes1-0/+63
* 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-20example: keycountBen McGinnes1-1/+1
* Fixed missing parenthesis.
2018-03-20example: decrypt fileBen McGinnes1-0/+44
* Decrypts a file taking file names as command line parameters.
2018-03-20example: groups work-aroundBen McGinnes1-0/+44
* 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-19example: encrypt fileBen McGinnes1-8/+14
* Nested encryption in try/except statement in case recipient key is untrusted or invalid.
2018-03-19example: sign and encrypt fileBen McGinnes1-0/+70
* 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-19example: encrypt fileBen McGinnes1-1/+1
* Fixed typo in second encryption call.
2018-03-19example: encrypt fileBen McGinnes1-0/+64
* 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-19example: python bindings key countBen McGinnes1-0/+42
* Added script wo count the number of keys in both the public and secret key stores.
2018-03-19doc: python bindings examplesBen McGinnes1-0/+6
* Explicitly stated that all this code is released under the GPLv2+ and the LGPLv2.1+.
2018-03-19doc: python bindings example READMEBen McGinnes1-0/+28
* 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-19docs: python bindings examplesBen McGinnes1-0/+24
* 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-19example: python bindings encryptionBen McGinnes1-0/+0
* 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.
2017-12-08Spelling fixes for comments and docAndre Heinecke1-1/+1
-- Patch provided by ka7 in dev.gnupg.org Differential D423
2016-10-31python: Use vanity modules for constants in tests and examples.Justus Winter2-2/+2
* lang/python/gpg/constants/sig/notation.py: New file. * lang/python/gpg/constants/sig/__init__.py: Import new module. * lang/python/examples/assuan.py: Use more specific module for constants, e.g. 'protocol.ASSUAN' instead of 'PROTOCOL_ASSUAN'. * lang/python/examples/testCMSgetkey.py: Likewise. * lang/python/tests/initial.py: Likewise. * lang/python/tests/t-callbacks.py: Likewise. * lang/python/tests/t-decrypt-verify.py: Likewise. * lang/python/tests/t-decrypt.py: Likewise. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-large.py: Likewise. * lang/python/tests/t-encrypt-sign.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-export.py: Likewise. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-idiomatic.py: Likewise. * lang/python/tests/t-import.py: Likewise. * lang/python/tests/t-keylist.py: Likewise. * lang/python/tests/t-protocol-assuan.py: Likewise. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-sign.py: Likewise. * lang/python/tests/t-signers.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. * lang/python/tests/t-verify.py: Likewise. * lang/python/tests/t-wait.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-10-31python: Import the topmost module in tests and examples.Justus Winter1-8/+7
* examples/verifydetails.py: Only import the topmost module 'gpg' and update the code accordingly. * tests/support.py: Likewise. * tests/t-callbacks.py: Likewise. * tests/t-data.py: Likewise. * tests/t-decrypt-verify.py: Likewise. * tests/t-decrypt.py: Likewise. * tests/t-edit.py: Likewise. * tests/t-encrypt-large.py: Likewise. * tests/t-encrypt-sign.py: Likewise. * tests/t-encrypt-sym.py: Likewise. * tests/t-encrypt.py: Likewise. * tests/t-export.py: Likewise. * tests/t-file-name.py: Likewise. * tests/t-import.py: Likewise. * tests/t-keylist.py: Likewise. * tests/t-sig-notation.py: Likewise. * tests/t-sign.py: Likewise. * tests/t-signers.py: Likewise. * tests/t-trustlist.py: Likewise. * tests/t-verify.py: Likewise. * tests/t-wait.py: Likewise. * tests/t-wrapper.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-10-31python: Rename Python module from PyME to gpg.Daniel Kahn Gillmor12-37/+37
This follows weeks of discussion on the gnupg-devel mailing list. Hopefully it will make it easier for people using Python to use GnuPG in the future. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-10-13python: Return public keys by default.Justus Winter2-2/+2
* lang/python/pyme/core.py (Core.get_key): Return public keys by default, improve docstring. * lang/python/examples/testCMSgetkey.py: Update example. * lang/python/examples/verifydetails.py: Likewise. GnuPG-bug-id: 2751 Signed-off-by: Justus Winter <[email protected]>
2016-10-13python: Fix example.Justus Winter1-2/+2
* lang/python/examples/inter-edit.py: Fix example. Fixes-commit: a458e7fe Signed-off-by: Justus Winter <[email protected]>
2016-09-16python: Adapt to 'gpgme_op_interact'.Justus Winter1-11/+4
* lang/python/examples/inter-edit.py: Update example. * lang/python/gpgme.i (gpgme_edit_cb_t): Turn into 'gpgme_interact_cb_t'. * lang/python/helpers.c (_pyme_edit_cb): Turn into '_pyme_interact_cb_t'. * lang/python/private.h (_pyme_edit_cb): Likewise. * lang/python/pyme/constants/__init__.py: Replace numeric status codes with the keywords. * lang/python/pyme/constants/status.py: Likewise. * lang/python/pyme/core.py (Context.interact): New method. (Context.op_edit): Deprecate, update docstring, implement using Context.interact. * lang/python/tests/t-edit.py: Test both interfaces. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Trim imports.Justus Winter4-4/+0
* lang/python/examples/encrypt-to-all.py: Drop unused import of 'os'. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Import from __future__ to align behavior of Python 2.7.Justus Winter12-0/+36
-- Signed-off-by: Justus Winter <[email protected]>
2016-09-14python: Use more generic shebang.Justus Winter12-12/+12
-- Signed-off-by: Justus Winter <[email protected]>
2016-08-05python: Clean up and modernize examples.Justus Winter14-500/+360
* lang/python/examples/Examples.rst: Delete file. * lang/python/examples/t-edit.py: Likewise. This is actually a test case and has been moved to 'tests'. * lang/python/examples/assuan.py: New file. * lang/python/examples/decryption-filter.py: Likewise. * lang/python/examples/delkey.py: Modernize. * lang/python/examples/encrypt-to-all.py: Likewise. * lang/python/examples/exportimport.py: Likewise. * lang/python/examples/genkey.py: Likewise. * lang/python/examples/inter-edit.py: Likewise. * lang/python/examples/sign.py: Likewise. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/testCMSgetkey.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-06-06python: Drop obsolete VCS keywords.Justus Winter10-10/+0
-- Signed-off-by: Justus Winter <[email protected]>
2016-05-17python: Clean up examples.Justus Winter9-41/+42
* lang/python/examples/delkey.py: Clean up example. * lang/python/examples/encrypt-to-all.py: Likewise. * lang/python/examples/genkey.py: Likewise. * lang/python/examples/inter-edit.py: Likewise. * lang/python/examples/sign.py: Likewise. * lang/python/examples/signverify.py: Likewise. * lang/python/examples/simple.py: Likewise. * lang/python/examples/t-edit.py: Likewise. * lang/python/examples/verifydetails.py: Likewise. * lang/python/pyme/__init__.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-05-12python: Make test case more robust.Justus Winter1-0/+4
* lang/python/examples/t-edit.py: Check if key is found. Signed-off-by: Justus Winter <[email protected]>
2016-05-12python: Fix type translation.Justus Winter1-3/+3
* lang/python/gpgme.i: Adjust to Python3's string type being 'Unicode', not 'bytes'. Fix type checking. * lang/python/core.py (Data.write): Add docstring mentioning the expected type of parameter 'buffer'. (Data.read): Adjust read loop. Also, use a saner chunk size, and join all chunks at the end instead of adding them. * lang/python/examples/simple.py: Adjust example. Signed-off-by: Justus Winter <[email protected]>
2016-05-11python: Fix simple example.Justus Winter1-1/+2
* lang/python/examples/simple.py: Flush stdout, encode name as UTF-8 before passing it to GPGME. Signed-off-by: Justus Winter <[email protected]>
2016-05-10python: PEP8 fixes.Justus Winter4-33/+38
Cherry picked from 0267c151. Signed-off-by: Justus Winter <[email protected]>
2016-05-10python: Delete trailing whitespace.Justus Winter5-8/+4
-- Signed-off-by: Justus Winter <[email protected]>
2016-05-10python: Rename bindings.Justus Winter12-0/+655
-- Signed-off-by: Justus Winter <[email protected]>