Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GpgME++ - C++ bindings/wrapper for GPGME
|
2016-02-22 18:13:36 +00:00
|
|
|
----------------------------------------
|
|
|
|
Based on KF5gpgmepp
|
|
|
|
|
|
|
|
Overview
|
|
|
|
--------
|
|
|
|
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GpgME++ is a C++ wrapper (or C++ bindings) for the GnuPG project's
|
2016-02-22 18:13:36 +00:00
|
|
|
gpgme (GnuPG Made Easy) library, version 0.4.4 and later.
|
|
|
|
|
|
|
|
It is fairly complete, with some minor things still missing (in
|
|
|
|
particular, the key edit interface).
|
|
|
|
|
|
|
|
The design principles of this library are as follows:
|
|
|
|
|
|
|
|
1. A value-based interface (most clases are implicitly shared)
|
|
|
|
2. Callbacks are replaced by C++ interfaces (classes with only
|
|
|
|
abstract methods).
|
|
|
|
3. No exceptions are thrown
|
|
|
|
4. There is (as yet) no explicit support for multi-threaded use
|
|
|
|
(other than what gpgme itself provides; most notably the
|
|
|
|
refcounting for implicit sharing is not thread-safe)
|
|
|
|
5. To avoid binary incompatible interface changes, we make
|
|
|
|
extensive use of the d-pointer pattern and avoid virtual
|
|
|
|
methods; any polymorphism present is already provided by gpgme
|
|
|
|
itself, anyway (see e.g. Data). A notable exception of the
|
|
|
|
no-virtuals rule is the use of abstract classes to cover
|
|
|
|
C-callbacks.
|
2016-09-19 12:09:19 +00:00
|
|
|
6. Use of STL containers for improved memory management and
|
|
|
|
dealing with lists.
|
|
|
|
7. Complete abstraction of the C-API so "gpgme.h" should not
|
|
|
|
be needed in your project using GpgME++.
|
|
|
|
8. Abstraction of GnuPG's edit-key interface by prepared
|
|
|
|
Editinteractor classes.
|
|
|
|
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GpgME++ was originally developed as part of the KDEPIM community.
|
2016-09-19 12:09:19 +00:00
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
The usage pattern of GpgME++ closely follows GPGMEs core usage
|
2016-09-19 12:09:19 +00:00
|
|
|
pattern so the documentation for GPGME itself provides a good
|
|
|
|
way to start.
|
|
|
|
|
|
|
|
The context structure in GPGME is mapped to a Context object in
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GpgME++. Additional convenience code provides Data objects and
|
2016-09-19 12:09:19 +00:00
|
|
|
a Dataprovider interface that can be used to implement GPGME's
|
|
|
|
data with any subclass by implementing the right callbacks.
|
2016-02-22 18:13:36 +00:00
|
|
|
|
2016-09-19 12:09:19 +00:00
|
|
|
EditInteractor subclasses provide ready to use classes for
|
|
|
|
common --edit-key tasks. You can implement your own editinteractor
|
|
|
|
classes by implementing the EditInteractor interface and using
|
|
|
|
your subclass as an interactor in the edit function.
|
|
|
|
|
|
|
|
Example to set the ownertrust of a key:
|
|
|
|
|
|
|
|
/* Create an edit interactor */
|
|
|
|
EditInteractor *ei = new GpgSetOwnerTrustEditInteractor(Key::Ultimate);
|
|
|
|
/* Obtain a Context */
|
|
|
|
Context *ctx = Context::createForProtocol(Protocol::OpenPGP);
|
|
|
|
/* Create an in memory data object */
|
|
|
|
Data data;
|
|
|
|
/* Start the edit on some key previously obtained. */
|
|
|
|
Error e = ctx->edit(key, std::unique_ptr<EditInteractor>(ei), data);
|
2017-12-08 04:59:11 +00:00
|
|
|
/* Errors provide boolean comparison */
|
2016-09-19 12:09:19 +00:00
|
|
|
if (!e)
|
|
|
|
...
|
|
|
|
/* Delete the context */
|
|
|
|
delete ctx;
|
|
|
|
|
|
|
|
Examples / Tests
|
|
|
|
----------------
|
|
|
|
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GpgME++ is tested through the Qt API. You can refer to the
|
2016-09-19 12:09:19 +00:00
|
|
|
tests in qt/tests for examples of usage or refer to
|
|
|
|
the actual QGpgME*Job.cpp implementations which rely
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
on GpgME++ and should cover most use cases.
|
2016-02-22 18:13:36 +00:00
|
|
|
|
2016-04-11 16:16:05 +00:00
|
|
|
Hacking
|
|
|
|
-------
|
2016-09-19 12:09:19 +00:00
|
|
|
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GpgME++ follows KDE Coding styles. See:
|
2016-04-11 16:16:05 +00:00
|
|
|
https://techbase.kde.org/Policies/Frameworks_Coding_Style
|
|
|
|
for more info.
|
|
|
|
|
2016-02-22 18:13:36 +00:00
|
|
|
License
|
|
|
|
-------
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
|
|
|
|
GPGME++ is free software; you can redistribute it and/or
|
2016-09-19 12:09:19 +00:00
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
2016-02-22 18:13:36 +00:00
|
|
|
|
Unify spelling of the name of the C++ bindings for GpgME
* lang/cpp/README, lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am, lang/cpp/tests/run-getkey.cpp,
lang/cpp/tests/run-keylist.cpp, lang/cpp/tests/run-verify.cpp,
lang/cpp/tests/run-wkdlookup.cpp, lang/qt/README: Replace GpgMEpp with
GpgME++.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in,
lang/cpp/src/GpgmeppConfigVersion.cmake.in,
lang/cpp/src/Makefile.am: Replace GPGME-CL (c&p error) with GpgME++.
* lang/cpp/tests/Makefile.am: Replace GPGME with GPGME++.
* lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp,
lang/cpp/tests/run-verify.cpp: Replace QGpgME (c&p error) with GpgME++.
--
2024-06-06 14:34:18 +00:00
|
|
|
GPGME++ is distributed in the hope that it will be useful,
|
2016-09-19 12:09:19 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public License
|
|
|
|
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
|
|
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|