Allow revoking key certifications.

Certified user identities in keys can be revoked using the same popup
for certification.

Requires GnuPG 2.2.24 (not available in distro's repository, not fully
tested to date).
This commit is contained in:
SET
2020-11-22 14:22:08 +01:00
parent 898764be7b
commit 110e5e4fb3
7 changed files with 168 additions and 35 deletions

View File

@@ -145,6 +145,34 @@ const Error GpgMEWorker::CertifyKey(const char* fprSigningKey,
return e;
}
const Error GpgMEWorker::RevokeKeyCertifications(const char* fprSigningKey,
const char* fprKeyToSign,
vector<GpgME::UserID>& userIDsToRevoke,
const string& passphrase)
{
Error e;
Key signingKey = FindKey(fprSigningKey, e, true);
if (e.code() != 0)
return e;
e = m_ctx->addSigningKey(signingKey); // +++
if (e.code() != 0)
return e;
Key keyToSign = FindKey(fprKeyToSign, e, false);
if (e.code() != 0)
return e;
m_ctx->setPinentryMode(Context::PinentryMode::PinentryLoopback);
if (m_ppp == NULL)
m_ppp = new LoopbackPassphraseProvider();
m_ppp->SetPassphrase(passphrase);
m_ctx->setPassphraseProvider(m_ppp);
e = m_ctx->revokeSignature(keyToSign, signingKey, userIDsToRevoke);
m_ctx->clearSigningKeys();
return e;
}
const Error GpgMEWorker::SetSubkeyExpiryTime(const char* keyFpr,
const char* subkeyFpr,
const string& passphrase,