The recommended way to use the GnuPG crypto stack from your application is GPGME. Here is the online version of the manual (maybe out of date).
- pyme SWIG generated wrapper (continuation of the old version)
- https://launchpad.net/pygpgme manually written wrapper in C
- http://quickgit.kde.org/?p=kdepimlibs.git gpgme++ is a wrapper for gpgme in kdepimlibs