2 * Copyright (C) 2004 g10 Code GmbH
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 This is a crytpo module wrapping the gpgme based pgp code.
27 #ifdef CRYPT_BACKEND_GPGME
29 #include "crypt-mod.h"
30 #include "crypt-gpgme.h"
32 static void crypt_mod_pgp_init (void)
37 static void crypt_mod_pgp_void_passphrase (void)
39 /* Handled by gpg-agent. */
42 static int crypt_mod_pgp_valid_passphrase (void)
44 /* Handled by gpg-agent. */
48 static int crypt_mod_pgp_decrypt_mime (FILE * a, FILE ** b, BODY * c,
51 return pgp_gpgme_decrypt_mime (a, b, c, d);
54 static void crypt_mod_pgp_application_handler (BODY * m, STATE * s)
56 pgp_gpgme_application_handler (m, s);
59 static void crypt_mod_pgp_encrypted_handler (BODY * m, STATE * s)
61 pgp_gpgme_encrypted_handler (m, s);
64 static int crypt_mod_pgp_check_traditional (FILE * fp, BODY * b,
67 return pgp_gpgme_check_traditional (fp, b, tagged_only);
70 static char *crypt_mod_pgp_findkeys (ADDRESS * to, ADDRESS * cc,
73 return pgp_gpgme_findkeys (to, cc, bcc);
76 static BODY *crypt_mod_pgp_sign_message (BODY * a)
78 return pgp_gpgme_sign_message (a);
81 static int crypt_mod_pgp_verify_one (BODY * sigbdy, STATE * s,
84 return pgp_gpgme_verify_one (sigbdy, s, tempf);
87 static int crypt_mod_pgp_send_menu (HEADER * msg, int *redraw)
89 return pgp_gpgme_send_menu (msg, redraw);
92 static BODY *crypt_mod_pgp_encrypt_message (BODY * a, char *keylist, int sign)
94 return pgp_gpgme_encrypt_message (a, keylist, sign);
97 struct crypt_module_specs crypt_mod_pgp_gpgme = { APPLICATION_PGP,
101 crypt_mod_pgp_void_passphrase,
102 crypt_mod_pgp_valid_passphrase,
103 crypt_mod_pgp_decrypt_mime,
104 crypt_mod_pgp_application_handler,
105 crypt_mod_pgp_encrypted_handler,
106 crypt_mod_pgp_findkeys,
107 crypt_mod_pgp_sign_message,
108 crypt_mod_pgp_verify_one,
109 crypt_mod_pgp_send_menu,
112 crypt_mod_pgp_encrypt_message,
113 NULL, /* pgp_make_key_attachment, */
114 crypt_mod_pgp_check_traditional,
115 NULL, /* pgp_traditional_encryptsign */
116 NULL, /* pgp_invoke_getkeys */
117 NULL, /* pgp_invoke_import */
118 NULL, /* pgp_extract_keys_from_attachment_list */
120 NULL, /* smime_getkeys */
121 NULL, /* smime_verify_sender */
122 NULL, /* smime_build_smime_entity */
123 NULL, /* smime_invoke_import */