]> git.notmuchmail.org Git - notmuch/blob - util/crypto.h
crypto: new decryption policy "auto"
[notmuch] / util / crypto.h
1 #ifndef _CRYPTO_H
2 #define _CRYPTO_H
3
4 #include <stdbool.h>
5 #include "gmime-extra.h"
6 #include "notmuch.h"
7
8 typedef struct _notmuch_crypto {
9     bool verify;
10     notmuch_decryption_policy_t decrypt;
11 #if (GMIME_MAJOR_VERSION < 3)
12     GMimeCryptoContext* gpgctx;
13     GMimeCryptoContext* pkcs7ctx;
14     const char *gpgpath;
15 #endif
16 } _notmuch_crypto_t;
17
18 GMimeObject *
19 _notmuch_crypto_decrypt (notmuch_decryption_policy_t decrypt,
20                          notmuch_message_t *message,
21                          GMimeCryptoContext* crypto_ctx,
22                          GMimeMultipartEncrypted *part,
23                          GMimeDecryptResult **decrypt_result,
24                          GError **err);
25
26 #if (GMIME_MAJOR_VERSION < 3)
27 notmuch_status_t
28 _notmuch_crypto_get_gmime_ctx_for_protocol (_notmuch_crypto_t *crypto,
29                                             const char *protocol,
30                                             GMimeCryptoContext **ctx);
31 #endif
32
33 void
34 _notmuch_crypto_cleanup (_notmuch_crypto_t *crypto);
35
36 #endif