Size: 3829
Comment: New maintainer. New license.
|
← Revision 43 as of 2024-06-17 14:47:58 ⇥
Size: 4314
Comment: + gpgme-rs
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= GPGME - an API to GnuPG | = GPGME - the API to GnuPG |
Line 14: | Line 14: |
=== GPGME bindings | === official GPGME bindings |
Line 16: | Line 16: |
A number of language bindings are maintained within the ~G~PGME repository. If possible, try to use these bindings. | Coming with official [[https://gnupg.org/software/gpgme/index.html|GPGME releases]] are bindings for: |
Line 18: | Line 19: |
* C++: Based upon the code previously maintained by KDE. * Qt: Based upon the code previously maintained by KDE. * Python: Based upon the 'pyme' bindings, should be backwards compatible. * Common Lisp |
* **C++**: Based upon the code previously maintained by KDE. * **Qt**: Based upon the code previously maintained by KDE. * **Python**: Based upon the 'pyme' bindings, should be backwards compatible. * **Common Lisp** The current development versions can be found at [[https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=tree;f=lang|git.gnupg.org gpgme/lang]]. The GnuPG-Team supports these bindings. === Examples for how to use the bindings * https://gitlab.com/reiterl/python3-gpg-examples (Python) * https://heptapod.host/intevation/gnupg/gnupg-scripts/-/tree/main/Python (Python) |
Line 25: | Line 36: |
==== C++ wrappers == | ==== C++ wrappers |
Line 30: | Line 41: |
* [[https://github.com/wget/gpgme-sharp|gpgme-sharp]] originally developed by Daniel Mueller in 2009 under LGPL, now under MIT and maintainership taken over by William Gathoye with the intention of being integrated to [[https://github.com/chocolatey/choco|Chocolatey]], the package manager for Windows. | * [[https://github.com/wget/gpgme-sharp|gpgme-sharp]]. It is [[https://www.nuget.org/packages/gpgme-sharp|available on NuGet]] and supports .NET Core |
Line 34: | Line 45: |
==== Java wrappers == | ==== Java wrappers |
Line 41: | Line 52: |
==== PHP wrappers * https://pecl.php.net/package/gnupg |
|
Line 43: | Line 56: |
==== Python wrappers == | ==== Python wrappers **Use official python-gpg bindings from GPG~ME** based on Py~ME, see above. We just document historic alternatives here: |
Line 45: | Line 60: |
* [[https://bitbucket.org/malb/pyme|pyme]] ~SWIG generated wrapper for python2 (continuation of the [[http://pyme.sourceforge.net/|old version]]) * [[https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=tree;f=lang/python;hb=refs/heads/master|pyme for python3]] ~SWIG generated wrapper for python3, port of pyme 0.9, included in G~P~GME v>=1.7. * https://launchpad.net/pygpgme manually written wrapper in C for python2 and python3. GNU ~LGPL v?=2. Packaged for Debian and Ubuntu. |
* Py~ME history: see [[https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=blob;f=lang/python/README|README of current python3-gpg bindings]]. * A different approach (last release from 2012) is https://launchpad.net/pygpgme , manually written wrapper in C for python2 and python3. GNU ~LGPL v?=2. Packaged for Debian and Ubuntu. |
Line 52: | Line 69: |
==== Rust wrappers ==== * [[https://github.com/gpg-rs/gpgme|gpgm-rs]] |
|
Line 60: | Line 83: |
== C# (c-sharp) | ==== C# (c-sharp) |
Line 63: | Line 86: |
== Objective-C | ==== Objective-C |
Line 66: | Line 89: |
== Python | ==== PHP * https://pear.php.net/package/Crypt_GPG seems to call the gpg binary directly. (probably cannot do S/MIME then). ==== Python |
GPGME - the API to GnuPG
The recommended way to use the GnuPG crypto stack from your application is GPGME, which is written in C. Here is the online version of the manual.
A number of GPGME bindings for other programming languages/environments exist (Please point us to missing entries or corrections or add them directly in the wiki.):
All / C
- gpgme (GPG Made Easy) is the official GnuPG API. It is implemented in C itself, but this is what you should use from your language as well.
official GPGME bindings
Coming with official GPGME releases are bindings for:
- C++: Based upon the code previously maintained by KDE.
- Qt: Based upon the code previously maintained by KDE.
- Python: Based upon the 'pyme' bindings, should be backwards compatible.
- Common Lisp
The current development versions can be found at git.gnupg.org gpgme/lang.
The GnuPG-Team supports these bindings.
Examples for how to use the bindings
- https://gitlab.com/reiterl/python3-gpg-examples (Python)
- https://heptapod.host/intevation/gnupg/gnupg-scripts/-/tree/main/Python (Python)
Third-party GPGME bindings
C++ wrappers
- http://quickgit.kde.org/?p=kdepimlibs.git gpgme++ is a wrapper for gpgme in kdepimlibs
C# (c-sharp) wrappers
- gpgme-sharp. It is available on NuGet and supports .NET Core The code quality was considered "experimental" and made for 32bits for Windows, but some reported success.
Java wrappers
- GnuPG-for-Java is a Java wrapper for gpgme >=1.5 and GnuPG >=2.x
- GnuPG-for-Java is a Java wrapper for gpgme and GnuPG 1.x
- Gnu Privacy Guard is an Android app based GnuPG-for-Java and uses gpgme to provide a GnuPG engine in Android
PHP wrappers
Python wrappers
Use official python-gpg bindings from GPGME based on PyME, see above. We just document historic alternatives here:
- PyME history: see README of current python3-gpg bindings.
- A different approach (last release from 2012) is https://launchpad.net/pygpgme , manually written wrapper in C for python2 and python3. GNU LGPL v?=2. Packaged for Debian and Ubuntu.
Ruby wrappers
- ruby-gpgme is a ruby wrapper, which can be installed with: gem install gpgme.
Rust wrappers
(not recommended) calling executables directly
A number of elder applications call GnuPG executables in a subprocess and interact with them via command line arguments and file-descriptors. This is less perferable to GPGME, because the command line arguments and text outputs are not an (official) API to GnuPG. While there is an effort made to keep them stable, using the official GPGME API can manage this more precisely and thus you end up with a more robust solution.
C# (c-sharp)
Objective-C
- Libmacgpg is a Mac OS X Framework built on top of GnuPG (but not gpgme), used as part of the GPGTools suite.
PHP
- https://pear.php.net/package/Crypt_GPG seems to call the gpg binary directly. (probably cannot do S/MIME then).
Python
- python-gnupg using the subprocess module to call the gpg executables (not using the recommended gpgme for python alternatives, see above). Xorg Style license.