]> git.notmuchmail.org Git - notmuch/blob - util/crypto.h
crypto: make shared crypto code behave library-like
[notmuch] / util / crypto.h
1 #ifndef _CRYPTO_H
2 #define _CRYPTO_H
3
4 #include <stdbool.h>
5 #if (GMIME_MAJOR_VERSION < 3)
6 #include "gmime-extra.h"
7 #include "notmuch.h"
8 #endif
9
10 typedef struct _notmuch_crypto {
11     bool verify;
12     bool decrypt;
13 #if (GMIME_MAJOR_VERSION < 3)
14     GMimeCryptoContext* gpgctx;
15     GMimeCryptoContext* pkcs7ctx;
16     const char *gpgpath;
17 #endif
18 } _notmuch_crypto_t;
19
20
21 #if (GMIME_MAJOR_VERSION < 3)
22 notmuch_status_t
23 _notmuch_crypto_get_gmime_ctx_for_protocol (_notmuch_crypto_t *crypto,
24                                             const char *protocol,
25                                             GMimeCryptoContext **ctx);
26 #endif
27
28 void
29 _notmuch_crypto_cleanup (_notmuch_crypto_t *crypto);
30
31 #endif