2019-10-25 20:16:43 +02:00
|
|
|
/*
|
|
|
|
|
* File: GpgMECWorker.h
|
2019-10-28 14:12:50 +01:00
|
|
|
* Author: SET - nmset@yandex.com
|
2019-10-25 20:16:43 +02:00
|
|
|
* License : LGPL v2.1
|
|
|
|
|
* Copyright SET - © 2019
|
|
|
|
|
*
|
|
|
|
|
* Created on 14 octobre 2019, 15:22
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef GPGMECWORKER_H
|
|
|
|
|
#define GPGMECWORKER_H
|
|
|
|
|
|
|
|
|
|
#include <gpgme.h>
|
|
|
|
|
#include <gpgme++/error.h>
|
|
|
|
|
|
2020-11-14 14:46:28 +01:00
|
|
|
class GpgMECWorker
|
|
|
|
|
{
|
2019-10-25 20:16:43 +02:00
|
|
|
public:
|
|
|
|
|
GpgMECWorker();
|
|
|
|
|
virtual ~GpgMECWorker();
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2019-10-25 20:16:43 +02:00
|
|
|
/**
|
|
|
|
|
* Deleting keys must be done with the C API because
|
|
|
|
|
* gpgmepp does not provide a way to use GPGME_DELETE_FORCE,
|
|
|
|
|
* resulting in a confirmation dialog triggered by GPG.
|
2020-11-11 21:09:43 +01:00
|
|
|
* This does not fit use on a web server.
|
|
|
|
|
* @param fpr
|
2019-10-25 20:16:43 +02:00
|
|
|
* @param secret delete secret key ?
|
|
|
|
|
* @param e
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2020-11-11 21:09:43 +01:00
|
|
|
bool DeleteKey(const char * fpr, bool secret, GpgME::Error& e);
|
2020-11-14 14:46:28 +01:00
|
|
|
|
2020-11-15 10:56:11 +01:00
|
|
|
#ifdef DEVTIME
|
|
|
|
|
/**
|
|
|
|
|
* Status : testing
|
|
|
|
|
* \n Result : fails to export a private key
|
|
|
|
|
* \n Reason : passphrase callback is never called
|
|
|
|
|
* \n With default pinentry mode, the password is requested normally
|
|
|
|
|
* and the private key is exported. But this can't be done on a web server.
|
|
|
|
|
* @param fpr
|
|
|
|
|
* @param e
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
bool ExportPrivateKey(const char* fpr, GpgME::Error& e);
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-10-25 20:16:43 +02:00
|
|
|
private:
|
|
|
|
|
gpgme_ctx_t c_ctx;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* GPGMECWORKER_H */
|
|
|
|
|
|