2017-10-17 15:09:55 -04:00
|
|
|
#ifndef _CRYPTO_H
|
|
|
|
#define _CRYPTO_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "gmime-extra.h"
|
2017-10-17 15:09:56 -04:00
|
|
|
#include "notmuch.h"
|
2017-10-17 15:09:55 -04:00
|
|
|
|
|
|
|
typedef struct _notmuch_crypto {
|
|
|
|
bool verify;
|
2017-12-08 01:23:52 -05:00
|
|
|
notmuch_decryption_policy_t decrypt;
|
2017-10-17 15:09:55 -04:00
|
|
|
#if (GMIME_MAJOR_VERSION < 3)
|
|
|
|
GMimeCryptoContext* gpgctx;
|
|
|
|
GMimeCryptoContext* pkcs7ctx;
|
|
|
|
const char *gpgpath;
|
|
|
|
#endif
|
|
|
|
} _notmuch_crypto_t;
|
|
|
|
|
2017-11-30 03:59:27 -05:00
|
|
|
GMimeObject *
|
2017-12-08 01:23:58 -05:00
|
|
|
_notmuch_crypto_decrypt (bool *attempted,
|
|
|
|
notmuch_decryption_policy_t decrypt,
|
2017-12-08 01:23:53 -05:00
|
|
|
notmuch_message_t *message,
|
2017-11-30 03:59:29 -05:00
|
|
|
GMimeCryptoContext* crypto_ctx,
|
2017-11-30 03:59:27 -05:00
|
|
|
GMimeMultipartEncrypted *part,
|
|
|
|
GMimeDecryptResult **decrypt_result,
|
|
|
|
GError **err);
|
2017-10-17 15:09:55 -04:00
|
|
|
|
|
|
|
#if (GMIME_MAJOR_VERSION < 3)
|
2017-10-17 15:09:56 -04:00
|
|
|
notmuch_status_t
|
|
|
|
_notmuch_crypto_get_gmime_ctx_for_protocol (_notmuch_crypto_t *crypto,
|
|
|
|
const char *protocol,
|
|
|
|
GMimeCryptoContext **ctx);
|
2017-10-17 15:09:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
|
|
|
_notmuch_crypto_cleanup (_notmuch_crypto_t *crypto);
|
|
|
|
|
|
|
|
#endif
|