aboutsummaryrefslogtreecommitdiff
path: root/util/crypto.h
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-10-17 15:09:55 -0400
committerDavid Bremner <david@tethera.net>2017-10-20 07:58:10 -0300
commit197d67959bf459fc0f1f63a202d162a569535bf3 (patch)
tree734955a02f99221191537ade2b14de8f0e1834c4 /util/crypto.h
parent6499fce3911df2646db67c0f1ff65672324904f0 (diff)
crypto: move into libnotmuch_util
This prepares us for using the crypto object in both libnotmuch and the client.
Diffstat (limited to 'util/crypto.h')
-rw-r--r--util/crypto.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/util/crypto.h b/util/crypto.h
new file mode 100644
index 00000000..80628dc5
--- /dev/null
+++ b/util/crypto.h
@@ -0,0 +1,28 @@
+#ifndef _CRYPTO_H
+#define _CRYPTO_H
+
+#include <stdbool.h>
+#if (GMIME_MAJOR_VERSION < 3)
+#include "gmime-extra.h"
+#endif
+
+typedef struct _notmuch_crypto {
+ bool verify;
+ bool decrypt;
+#if (GMIME_MAJOR_VERSION < 3)
+ GMimeCryptoContext* gpgctx;
+ GMimeCryptoContext* pkcs7ctx;
+ const char *gpgpath;
+#endif
+} _notmuch_crypto_t;
+
+
+#if (GMIME_MAJOR_VERSION < 3)
+GMimeCryptoContext *
+_notmuch_crypto_get_gmime_context (_notmuch_crypto_t *crypto, const char *protocol);
+#endif
+
+void
+_notmuch_crypto_cleanup (_notmuch_crypto_t *crypto);
+
+#endif