mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / pyassuan.mdwn
1 [[!meta  title="pyassuan"]]
2 [[!template id=gitrepo repo=pyassuan]]
3
4 I've been trying to come up with a clean way to verify detached
5 [[PGP]] signatures from [[Python]].  There are [a number of existing
6 approaches to this problem][wrappers].  Many of them call [gpg][]
7 using Python's [multiprocessing][] or [subprocess][] modules, but to
8 verify detached signatures, you need to send the signature in [on a
9 separate file descriptor][enable-special-filenames], and handling that
10 in a way safe from deadlocks is difficult.  The other approach, taken
11 by [PyMe][] is to wrap [GPGME][] using [[SWIG]], which is great as far
12 as it goes, but development seems to have stalled, and I find the raw
13 GPGME interface excessively complicated.
14
15 The GnuPG tools themselves often communicate over sockets using the
16 [Assuan protocol][assuan], and I'd already written an Assuan server to
17 handle [pinentry][] (originally for my [[gpg-agent]] post, not part of
18 pyassuan).  I though it would be natural if there was a `gpgme-agent`
19 which would handle cryptographic tasks over this protocol, which would
20 make the [[pgp-mime]] implementation easier.  It turns out that there
21 already is such an agent ([gpgme-tool][]), so I turned my pinentry
22 script into the more general pyassuan package.  Now using Assuan from
23 Python should be as easy (or easier?) than using it from C via
24 [libassuan][].
25
26 The `README` is posted on the [PyPI page][pypi].
27
28 [wrappers]: http://wiki.python.org/moin/GnuPrivacyGuard
29 [gpg]: http://www.gnupg.org/
30 [multiprocessing]: http://docs.python.org/library/multiprocessing.html
31 [subprocess]: http://docs.python.org/library/subprocess.html
32 [enable-special-filenames]: http://lists.gnupg.org/pipermail/gnupg-devel/2002-November/019343.html
33 [PyMe]: http://pyme.sourceforge.net/
34 [GPGME]: http://www.gnupg.org/related_software/gpgme/
35 [assuan]: http://www.gnupg.org/documentation/manuals/assuan/
36 [pinentry]: http://git.tremily.us/?p=pyassuan.git;a=blob;f=bin/pinentry.py;hb=HEAD
37 [gpgme-tool]: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=blob;f=src/gpgme-tool.c;hb=HEAD
38 [libassuan]: http://www.gnupg.org/related_software/libassuan/
39 [pypi]: http://pypi.python.org/pypi/pyassuan/
40
41 [[!tag tags/code]]
42 [[!tag tags/linux]]
43 [[!tag tags/programming]]
44 [[!tag tags/pypi]]
45 [[!tag tags/python]]