4c4e02137f68e671353a3993f80a0b791ef4772f
[apps/madmutt.git] / lib-crypt / crypt-gpgme.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 2004 g10 Code GmbH
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 #ifndef CRYPT_GPGME_H
11 #define CRYPT_GPGME_H
12
13 #include <lib-crypt/crypt.h>
14
15 /* {{{ cruft */
16
17 /* Type defintions for crypto module functions. */
18 typedef int (*crypt_func_encrypted_handler_t) (BODY * m, STATE * s);
19
20 typedef void (*crypt_func_pgp_invoke_getkeys_t) (address_t * addr);
21 typedef BODY *(*crypt_func_pgp_make_key_attachment_t) (char *tempf);
22 typedef int (*crypt_func_send_menu_t) (HEADER * msg, int *redraw);
23
24  /* (SMIME) */
25 typedef void (*crypt_func_smime_getkeys_t) (ENVELOPE * env);
26 typedef BODY *(*crypt_func_smime_build_smime_entity_t) (BODY * a,
27                                                         char *certlist);
28
29 typedef struct crypt_module_specs {
30     /* Common/General functions.  */
31     crypt_func_encrypted_handler_t encrypted_handler;
32
33     /* PGP specific functions.  */
34     crypt_func_pgp_make_key_attachment_t pgp_make_key_attachment;
35     crypt_func_pgp_invoke_getkeys_t pgp_invoke_getkeys;
36
37     /* S/MIME specific functions.  */
38     crypt_func_smime_getkeys_t smime_getkeys;
39     crypt_func_smime_build_smime_entity_t smime_build_smime_entity;
40 } crypt_module_specs_t;
41
42 extern struct crypt_module_specs crypt_mod_SMIME_gpgme;
43 extern struct crypt_module_specs crypt_mod_PGP_gpgme;
44
45 /* }}} */
46
47 BODY *pgp_gpgme_encrypt_message (BODY * a, char *keylist, int sign);
48 BODY *smime_gpgme_build_smime_entity (BODY * a, char *keylist);
49
50 int pgp_gpgme_check_traditional (FILE * fp, BODY * b, int tagged_only);
51 int pgp_gpgme_encrypted_handler (BODY * a, STATE * s);
52 BODY *pgp_gpgme_make_key_attachment (char *tempf);
53
54 #endif