c61da590e2c7e1f8064a0cc93d9c4df347a16335
[claws.git] / src / plugins / pgpcore / sgpgme.h
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2012 the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20 #ifndef SGPGME_H
21 #define SGPGME_H 1
22
23 #include <gpgme.h>
24
25 #include "privacy.h"
26
27 void sgpgme_init(void);
28 void sgpgme_done(void);
29
30 gpgme_verify_result_t sgpgme_verify_signature   (gpgme_ctx_t ctx,
31                                          gpgme_data_t sig,
32                                          gpgme_data_t plain,
33                                          gpgme_data_t dummy);
34 SignatureStatus sgpgme_sigstat_gpgme_to_privacy
35                                         (gpgme_ctx_t ctx,
36                                          gpgme_verify_result_t status);
37 gchar *sgpgme_sigstat_info_short        (gpgme_ctx_t ctx,
38                                          gpgme_verify_result_t status);
39 gchar *sgpgme_sigstat_info_full         (gpgme_ctx_t ctx,
40                                          gpgme_verify_result_t status);
41 gpgme_data_t sgpgme_data_from_mimeinfo  (MimeInfo *mimeinfo);
42 gpgme_data_t sgpgme_decrypt_verify      (gpgme_data_t cipher, 
43                                          gpgme_verify_result_t *status,
44                                          gpgme_ctx_t ctx);
45 gchar *sgpgme_get_encrypt_data          (GSList *recp_names,
46                                          gpgme_protocol_t proto);
47 gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account,
48                               const gchar *from_addr);
49 void sgpgme_check_create_key(void);
50 gboolean sgpgme_has_secret_key(void);
51 void sgpgme_create_secret_key(PrefsAccount *account, gboolean ask_create);
52 void *sgpgme_data_release_and_get_mem(gpgme_data_t data, size_t *len);
53
54 gpgme_error_t cm_gpgme_data_rewind(gpgme_data_t dh);
55
56 #endif /* SGPGME_H */