2017-10-17 21:09:55 +02:00
|
|
|
#ifndef _CRYPTO_H
|
|
|
|
#define _CRYPTO_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "gmime-extra.h"
|
2017-10-17 21:09:56 +02:00
|
|
|
#include "notmuch.h"
|
2017-10-17 21:09:55 +02:00
|
|
|
|
|
|
|
typedef struct _notmuch_crypto {
|
|
|
|
bool verify;
|
|
|
|
bool decrypt;
|
|
|
|
#if (GMIME_MAJOR_VERSION < 3)
|
|
|
|
GMimeCryptoContext* gpgctx;
|
|
|
|
GMimeCryptoContext* pkcs7ctx;
|
|
|
|
const char *gpgpath;
|
|
|
|
#endif
|
|
|
|
} _notmuch_crypto_t;
|
|
|
|
|
2017-11-30 09:59:27 +01:00
|
|
|
GMimeObject *
|
|
|
|
_notmuch_crypto_decrypt (GMimeCryptoContext* crypto_ctx,
|
|
|
|
GMimeMultipartEncrypted *part,
|
|
|
|
GMimeDecryptResult **decrypt_result,
|
|
|
|
GError **err);
|
2017-10-17 21:09:55 +02:00
|
|
|
|
|
|
|
#if (GMIME_MAJOR_VERSION < 3)
|
2017-10-17 21:09:56 +02:00
|
|
|
notmuch_status_t
|
|
|
|
_notmuch_crypto_get_gmime_ctx_for_protocol (_notmuch_crypto_t *crypto,
|
|
|
|
const char *protocol,
|
|
|
|
GMimeCryptoContext **ctx);
|
2017-10-17 21:09:55 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
|
|
|
_notmuch_crypto_cleanup (_notmuch_crypto_t *crypto);
|
|
|
|
|
|
|
|
#endif
|