Page MenuHome GnuPG

GpgME++: Add support for gpgme_set_expire
Closed, ResolvedPublic

Description

Ingo, I have fixed the patch that we wrote for quick_set_expire in core. As we currently have an issue with upload here in phab I've placed it on: https://heinecke.or.at/div/0001-core-Add-gpgme_op_set_expire.patch

The problem was that the order in the engine pointer struct was wrong. So it went into gpg_passwd instead of gpg_setexpire and that gave the error.

So the run-genkey test now works:

./run-genkey --verbose --status --set-expire 9DA609619177E751E4ABD8250835A39ED2985025 61516800

I'm still unhappy how we provide the time here. For other usage of expire in the API it makes more sense to use a date in "seconds from now" because they relate to generate something new or add a new user id.

The next step here is to now to add it to the c++ wrapper to have it cleanly added.
So:
context.h / context.cpp need the standard wrappers.

Then in qt/tests I would add it to an autotest so that its tested. For me its mostly easier to cover new core functionality by a test there.

For such "small" command tests I use: lang/qt/tests/t-various.cpp

So some new

  • do_version_check for 2.1.22
  • change the subkey expiration using the new function
  • get the key
  • check that the expiration date is changed as expected.

This should show you how to use the Gpgme++ API from Qt and how the unit tests in gpgme/lang/qt/ work. And you have a build environment for GPGME with qt bindings afterwards.

To look at the keys which are there, best do a make check and then you can use the build directory as the gnupg homedir.
e.g.

gpg --homedir . -K

will show you the two secret keys available. The tests copy the keyrings from the build directory to a temporary directory for testing.