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;
|
2017-12-08 07:23:52 +01:00
|
|
|
notmuch_decryption_policy_t decrypt;
|
2017-10-17 21:09:55 +02:00
|
|
|
#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 *
|
2017-12-08 07:23:53 +01:00
|
|
|
_notmuch_crypto_decrypt (notmuch_decryption_policy_t decrypt,
|
|
|
|
notmuch_message_t *message,
|
2017-11-30 09:59:29 +01:00
|
|
|
GMimeCryptoContext* crypto_ctx,
|
2017-11-30 09:59:27 +01:00
|
|
|
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
|