annotate mcabber/src/pgp.h @ 1497:35020a2ed115

Do not use srand()/rand() if better alternatives exist (mirabilos) arc4random(3) is a self-seeding PRNG available on a lot of OSes (all BSDs, Darwin / Mac OSX, Interix / Microsoft® Services for Unix, Windows® 2003SR1, Windows® Vista, Debian with the new libbsd package installed, ???) and much better than srand(3)/rand(3). Thanks to GNU autoconf, this can be made portable. http://www.mirbsd.org/man/arc4random.3 //mirabilos
author Mikael Berthe <mikael@lilotux.net>
date Mon, 30 Jun 2008 23:13:50 +0200
parents f89844a0448a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1041
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
1 #ifndef __PGP_H__
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
2 #define __PGP_H__ 1
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
3
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
4 #include <config.h>
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);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
12 void gpg_terminate(void);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
13 void gpg_set_passphrase(const char *passphrase);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
14 void gpg_set_private_key(const char *priv_keyid);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
15 char *gpg_verify(const char *gpg_data, const char *text,
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
16 gpgme_sigsum_t *sigsum);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
17 char *gpg_sign(const char *gpg_data);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
18 char *gpg_decrypt(const char *gpg_data);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
19 char *gpg_encrypt(const char *gpg_data, const char *keyid);
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
20
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
21 int gpg_test_passphrase(void);
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 #endif /* HAVE_GPGME */
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
24
1413
f89844a0448a Remove useless inlines
Mikael Berthe <mikael@lilotux.net>
parents: 1041
diff changeset
25 int gpg_enabled(void);
1041
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
26
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
27 #endif /* __PGP_H__ */
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
28
d4b97a2423eb Introduce PGP utility functions
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
29 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */