Commit Graph

241 Commits

Author SHA1 Message Date
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
Ben McGinnes
8a76deb11e HOWTO update
* removed one bit of whitespace.
* Marked up references to gpgme.h.
* Fixed one spelling error.
* Removed py2.6 from python search order since even if it is
  supported, it shouldn't be encouraged.
2018-03-07 20:12:26 +11:00
Ben McGinnes
5215d58ae2 GPGME Python bindings HOWTO
* Started work on the GPGME Python bindings HOWTO.
* 1,050 words to begin with at approx. 7.5KB.
* Got as far as installation.
* Includes instruction not to use PyPI for this.
2018-03-07 20:05:21 +11:00
Ben McGinnes
8f2c0f4534 TODO - HOWTO
* Added suv-entry for the new HOWTO being started and, since it has
  been started, checked it off.
2018-03-07 19:13:37 +11:00
Ben McGinnes
d4778bb23d TODO
* Slightly expanded the list.
2018-03-07 17:56:54 +11:00
Ben McGinnes
c58f61e922 WS removal
* Whitespace removal.
2018-02-26 14:09:38 +11:00
Ben McGinnes
6f2e2e0f15 LaTeX headers
* Set LaTeX headers to enable ligatures and a 12pt font by default.
* Paper size left for regional defaults.
* Using XeLaTeX for easier font control.
* Using default LaTeX font of Latin Main, but that's easy enough to change.
2018-02-26 13:51:23 +11:00
Ben McGinnes
272a8e778a Renaming ad infinitum ...
* Dropped the .txt from the end of the file ...
2018-02-20 03:13:42 +11:00
Ben McGinnes
c82b17c6ce Text conversion
* Exported from Org Mode to UTF-8 text.
* Removed my name from just under the title.
2018-02-20 03:11:50 +11:00
Ben McGinnes
ea481d4bb9 Title fix
* Fixed title.
2018-02-20 03:11:02 +11:00
Ben McGinnes
1ae3ead2cd Conflict with Phabricator files
* The developers of Phabricator, the web front-end on dev.gnupg.org
  have not implemented renderers for Markdown, Org-Mode or any other
  common markdown like language.
* They also refuse to do so.
* Instead they re-invented the wheel and implemented their own version
  of Markdown-like thing which is incompatible with everything else.
  It is called Remarkup.
* The developers of Phabricator and Remarkup have refused to provide
  conversion tools to move files to/from any format to/from Remarkup.
* They expect everyone to learn their new favourite pet project.
* Remarkup may or may not display Org Mode files, but if so then it is
  likely to only want to do so as plain text.
* There is an unaffiliated and unofficial project to convert Github
  Markdown to Remarkup via Pandoc.  This might be adapted for our use,
  but requires testing.
* Until then exporting from Org Mode to UTF-8 text is likely the least
  worst plan.
* Which means renaming this file to README.org first.
2018-02-20 02:51:02 +11:00
Ben McGinnes
fe4f3edd70 Schizophrenic file types
* Removed Markdown style heading underlining.
* Removed in-line file type declaration (which is not correctly parsed
  by the web interface on dev.gnupg.org).
2018-02-20 02:45:44 +11:00
Ben McGinnes
fb16eaa685 History path
* Fixed a typo in a filepath reference.
* Moved conjecture regarding the first version of Python used to a
  footnote.
2018-02-16 19:15:32 +11:00
Ben McGinnes
2b092bf235 Merge branch 'master' of /Users/ben/dev/hgit/mine/gnupg/gpgme/master into ben/python-docs-01 2018-02-16 02:04:57 +11:00
Ben McGinnes
6f15d82140 LaTeX margins
* Added LaTeX header for 1 inch margins in the quite likely event that
  all PDF output ultimately uses LaTeX.
2018-02-16 01:26:20 +11:00
Ben McGinnes
235d899a5f TODO Documentation
* Checked off the decision to stick with Org Mode.
2018-02-15 21:30:32 +11:00
Ben McGinnes
40da502292 TODO
* Beginning to turn the first part of this into something kind of like
  an actual TODO list as Org Mode uses it (maybe).
2018-02-15 21:28:07 +11:00
NIIBE Yutaka
b5ec21b9ba tests: Makefile portability.
* tests/gpg/Makefile.am: Don't use "export" directive.
* tests/gpgsm/Makefile.am: Ditto.
* lang/qt/tests/Makefile.am: Ditto.
* lang/python/tests/Makefile.am: Ditto.

--

GnuPG-bug-id: 3056
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2018-02-15 11:14:49 +09:00
NIIBE Yutaka
c9a351f5af build: More Makefile fix.
* lang/python/tests/Makefile.am: Avoid target with '/'.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2018-02-15 10:27:59 +09:00
Ben McGinnes
3c3b149996 Short History
* Fixed or updated the most fundamental errors.
* Also included some details on which modules are available on PyPI,
  as well as what happened to the PyME commit log.
2018-02-15 04:19:15 +11:00
Ben McGinnes
7c662d22a8 Subsectioned history
* Split the main parts down into subsections.
* Still need to cull the incorrect stuff towards the end and add more
  recent changes.
2018-02-15 01:03:12 +11:00
Ben McGinnes
a1bc710c5f History
* Reshaping the history file to fit Org Mode's structuring for docs.
* Also said history needs to be a bit more clear (it was kind of
  unfinished).
2018-02-14 22:44:27 +11:00
Ben McGinnes
fccd2ea387 TODO
* Updated TODO.
* The entirety of the old TODO has been replaced with either more
  relevant tasks or goals for the examples and a more measured
  approach to the docs and why, in this project, Org Mode trumps reST,
  even though it's Python through and through.
2018-02-14 22:28:50 +11:00
Ben McGinnes
487ed9337e TODO
* Removed reST version of file.
2018-02-14 21:25:45 +11:00
Ben McGinnes
c4fa421619 TODO
* Converted document from reST to org-mode.
2018-02-14 21:24:54 +11:00
Ben McGinnes
1d48b04cfb Short History
* Removed reST version.
2018-02-14 21:23:04 +11:00
Ben McGinnes
d86fd7c54c Short History
* Converted document from reST to org-mode.
2018-02-14 21:21:58 +11:00
Andre Heinecke
7b5182f288
Spelling fixes for comments and doc
--
Patch provided by ka7 in dev.gnupg.org

Differential D423
2017-12-08 05:59:11 +01:00
Tobias Mueller
3cf9aedc92
python: Default whence argument for Data() to SEEK_SET.
* lang/python/gpgme.i: copied signature from gpgme.h and defaulted the
value to SEEK_SET.
* lang/python/tests/t-data.py: Added a test for no second argument
--

Having to import the os package when wanting to read a Data object is a
slight annoyance. With SWIG, we can define default parameters. This
change defaults the whence argument to SEEK_SET which is how StringIO
and BytesIO behave.

Signed-off-by: Tobias Mueller <muelli@cryptobitch.de>
2017-12-04 08:10:06 +01:00
NIIBE Yutaka
c441fb7313 tests: Make portability fix.
* lang/python/tests/Makefile.am: Distinguish target and path.
* tests/gpg/Makefile.am: Ditto.
* tests/gpgsm/Makefile.am: Ditto.

--

GNU Make is powerful enough to match path to target (and vice versa),
but BSD make is not.

GnuPG-bug-id: 3056
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2017-11-21 15:35:10 +09:00
Alon Bar-Lev
57c1259308
python: Support parallel build in tests
* lang/python/tests/Makefile.am: Depend xcheck with all which was lost
due to the check hack.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2017-08-21 10:55:10 +02:00
Justus Winter
70c8be9efe
python: Improve keylist test.
* lang/python/tests/t-keylist.py: Check a keylist matching no keys.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-08-21 10:54:10 +02:00
Justus Winter
1e68f93dc5
python: Improve error handling.
* NEWS: Update.
* lang/python/src/core.py (Context.__read__): New helper function.
(Context.encrypt): Attach partial results to exceptions.
(Context.decrypt): Likewise.
(Context.sign): Likewise.
(Context.verify): Likewise.
* lang/python/src/errors.py (GpgError): Move the core of GPGMEError to
this class, add a nicer interface for it.  This makes the errors
thrown by this library more uniform, and allows us to track the
underlying error in synthesized high-level errors.
(GPGMEError): Simplify.
(...): Make sure to call the parent classes' constructor in all other
classes.
--

Attach partial results to errors.  Some operations return results even
though they signal an error.  Of course this information must be taken
with a grain of salt.  But often, this information is useful for
diagnostic uses or to give the user feedback.  Since the normal
control flow is disrupted by the exception, the callee can no longer
return results, hence we attach them to the exception objects.

GnuPG-bug-id: 3271
Signed-off-by: Justus Winter <justus@g10code.com>
2017-07-11 12:28:39 +02:00
Justus Winter
05fa2a9c77
Add flag 'is_de_vs' to decryption results and signatures.
* NEWS: Update.
* lang/cpp/src/decryptionresult.cpp (DecryptionResult::isDeVs): New
function.
* lang/cpp/src/decryptionresult.h (DecryptionResult::isDeVs): New
prototype.
* lang/cpp/src/verificationresult.cpp (Signature::isDeVs): New
function.
* lang/cpp/src/verificationresult.h (Signature::isDeVs): New
prototype.
* lang/python/src/results.py (DecryptResult): Turn field 'is_de_vs'
into a boolean.
(Signature): Likewise.
* src/decrypt.c (_gpgme_decrypt_status_handler): Handle the new
compliance status line.
* src/verify.c (_gpgme_verify_status_handler): Likewise.
* src/gpgme.h.in (gpgme_status_code_t): Add new status codes for the
new status lines.
* src/keylist.c (parse_pub_field18): Move function to 'util.h'.
(keylist_colon_handler): Adapt callsites.
* src/status-table.c (status_table): Add new status lines.
* src/util.h (PARSE_COMPLIANCE_FLAGS): New macro.  This used to be
'parse_pub_field18', but turned into a macro to make it polymorphic.
--

When decrypting data and verifying signatures, report whether the
operations are in compliance with the criteria for data classified as
VS-NfD.  This information can the be presented to the user.

GnuPG-bug-id: 3059
Signed-off-by: Justus Winter <justus@g10code.com>
2017-06-01 14:16:11 +02:00
Justus Winter
84a203e60b
python: Fix build in certain cases.
* lang/python/setup.py.in: Prepend the Python build dir to the list of
include directories so that it takes precedence over any other include
directory.
--
Fixes the build in case an older 'gpgme.h' is installed and is picked
up by the compiler when compiling the Python module.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-18 12:22:29 +02:00
Justus Winter
6b4dd3b929
python: Fix test environment creation.
* lang/python/tests/Makefile.am (pubring-stamp): Do not depend on the
configuration files, this can trigger superfluous rebuilds.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 16:19:52 +02:00
Justus Winter
a226eca846
tests: Make sure to kill all previously running daemons.
* lang/python/tests/Makefile.am: Kill all previously running daemons
before creating the private key store.
* lang/qt/tests/Makefile.am: Likewise.
* tests/gpg/Makefile.am: Likewise.
* tests/gpgsm/Makefile.am: Likewise.
--

Now that the daemons sockets are no longer created in the GNUPGHOME,
we cannot rely on cleaning the build directory to make sure they are
shut down.  Therefore, we explicitly kill any running daemons when
creating the test environment.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 15:52:12 +02:00
Justus Winter
15adff073b
tests: Harmonize test suites.
* lang/python/tests/Makefile.am: Create test environment as part of
'make all'.
* tests/gpg/Makefile.am: Make sure the private keystore is created
first.
* tests/gpgsm/Makefile.am: Create test environment as part of
'make all'.  Make sure the private keystore is created
first.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-05-10 15:49:54 +02:00
Justus Winter
979d48e823
python: Skip TOFU test if not supported by GnuPG.
* lang/python/tests/support.py (have_tofu_support): New function.
* lang/python/tests/t-quick-key-manipulation.py: Skip TOFU test if not
supported by GnuPG.

Signed-off-by: Justus Winter <justus@g10code.com>
2017-04-11 12:24:41 +02:00
Alon Bar-Lev
a827382caf
python: use autoconf pre-processor when building via autoconf
* configure.ac: Add AC_PROG_CPP.
* lang/python/Makefile.am: Set CPP environment for setup.py to use.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2017-04-11 10:24:44 +02:00
Alon Bar-Lev
d785c053a9
python: fix run-tests missing python_libdir
* lang/python/tests/run-tests.py: Set python_libdir if --python-libdir
is set.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2017-04-11 10:16:47 +02:00