Mercurial > ~mikael > mcabber > hg
annotate mcabber/mcabber/pgp.h @ 2223:965e0282c128
Backed out changeset fa516ef22145
Turns out that in this hash the value pointer is the same as the
key pointer, so there's no need to free both the key and the value.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 06 Nov 2015 22:31:40 +0100 |
parents | 8811fe9d6ef0 |
children |
rev | line source |
---|---|
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1413
diff
changeset
|
1 #ifndef __MCABBER_PGP_H__ |
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1413
diff
changeset
|
2 #define __MCABBER_PGP_H__ 1 |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
3 |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1413
diff
changeset
|
4 #include <mcabber/config.h> |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
5 |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
6 #ifdef HAVE_GPGME |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
7 |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
8 #define GPGME_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1 |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
9 #include <gpgme.h> |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
10 |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
11 int gpg_init(const char *priv_key, const char *passphrase); |
2196
8811fe9d6ef0
Improve support for GnuPG v2+
Mikael Berthe <mikael@lilotux.net>
parents:
2188
diff
changeset
|
12 int gpg_is_version1(void); |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
13 void gpg_terminate(void); |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
14 void gpg_set_passphrase(const char *passphrase); |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
15 void gpg_set_private_key(const char *priv_keyid); |
2188
84252c616919
PGP: Encrypt messages with our own PGP key when carbons are enabled
Mikael Berthe <mikael@lilotux.net>
parents:
2187
diff
changeset
|
16 const char *gpg_get_private_key_id(void); |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
17 char *gpg_verify(const char *gpg_data, const char *text, |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
18 gpgme_sigsum_t *sigsum); |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
19 char *gpg_sign(const char *gpg_data); |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
20 char *gpg_decrypt(const char *gpg_data); |
2187
e3b66c8ead4f
PGP: Change gpg_encrypt() so that several encryption keys can be used
Mikael Berthe <mikael@lilotux.net>
parents:
1811
diff
changeset
|
21 char *gpg_encrypt(const char *gpg_data, const char *keyid[], size_t n); |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
22 |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
23 int gpg_test_passphrase(void); |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
24 |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
25 #endif /* HAVE_GPGME */ |
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
26 |
1413 | 27 int gpg_enabled(void); |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
28 |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1413
diff
changeset
|
29 #endif /* __MCABBER_PGP_H__ */ |
1041
d4b97a2423eb
Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
30 |
1811 | 31 /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ |