Certify key.

In-place editing with a popup if user is allowed in app config file.
User must of course manage at least a private key. User identities of
target key may be selectively chosen. Optionally, certification may be
exportable and non-revocable.
This commit is contained in:
SET
2020-11-03 11:06:25 +01:00
parent e434315940
commit 7f8af95d3a
23 changed files with 922 additions and 24 deletions

View File

@@ -14,7 +14,9 @@
#include <gpgme++/error.h>
#include <gpgme++/key.h>
#include <gpgme++/gpgsetownertrusteditinteractor.h>
#include <gpgme++/gpgsignkeyeditinteractor.h>
#include <vector>
#include "LoopbackPassphraseProvider.h"
using namespace std;
using namespace GpgME;
@@ -59,9 +61,25 @@ public:
* @return
*/
const Error EditOwnerTrust(const char * anyFullId, GpgME::Key::OwnerTrust trustLevel);
/**
* Certify (sign) selected key.
* @param fprSigningKey
* @param fprKeyToSign
* @param userIDsToSign : index of each user identity in a vector.
* @param options : Exportable (1), Non revocable (2).
* \nTrust(4) is not implemented.
* @param passphrase
* @return
*/
const Error CertifyKey(const char * fprSigningKey,
const char * fprKeyToSign,
vector<uint>& userIDsToSign, int options,
const string& passphrase);
private:
Context * m_ctx;
// GPG will fetch a password here.
LoopbackPassphraseProvider * m_ppp;
};
/**
@@ -70,14 +88,36 @@ private:
class SetOwnerTrustEditInteractor : public GpgSetOwnerTrustEditInteractor
{
public:
/**
*
* @param ownerTrust : New trust level
*/
SetOwnerTrustEditInteractor(GpgME::Key::OwnerTrust ownerTrust)
: GpgSetOwnerTrustEditInteractor(ownerTrust) {}
: GpgSetOwnerTrustEditInteractor(ownerTrust)
{
}
virtual ~SetOwnerTrustEditInteractor() {}
virtual ~SetOwnerTrustEditInteractor()
{
}
};
/**
* Passed to GPG engine to certify (sign) a key.
*/
class SetSignKeyEditInteractor : public GpgSignKeyEditInteractor
{
public:
SetSignKeyEditInteractor() : GpgSignKeyEditInteractor()
{
};
virtual ~SetSignKeyEditInteractor()
{
};
};