1 /* Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net> */
2 /* Date: Fri, 04 Apr 2008 19:31:16 -0400 */
3 /* License: GPL v3 or later */
6 #include <gnutls/gnutls.h>
7 #include <gnutls/openpgp.h>
12 #include <sys/types.h>
17 /* Functions to help dealing with GnuTLS for monkeysphere key
18 translation projects: */
20 /* set everything up, including logging levels. Return 0 on
24 /* logging and output functions: */
26 void err(const char* fmt, ...);
27 void logfunc(int level, const char* string);
29 /* basic datum manipulations: */
31 void init_datum(gnutls_datum_t* d);
32 void copy_datum(gnutls_datum_t* dest, const gnutls_datum_t* src);
33 int compare_data(const gnutls_datum_t* a, const gnutls_datum_t* b);
34 void free_datum(gnutls_datum_t* d);
36 /* keyid manipulations: */
37 typedef unsigned char printable_keyid[16];
39 void init_keyid(gnutls_openpgp_keyid_t keyid);
40 void make_keyid_printable(printable_keyid out, gnutls_openpgp_keyid_t keyid);
42 /* functions to get data into datum objects: */
44 /* read the passed-in string, store in a single datum */
45 int set_datum_string(gnutls_datum_t* d, const char* s);
47 /* read the passed-in file descriptor until EOF, store in a single
49 int set_datum_fd(gnutls_datum_t* d, int fd);
51 /* read the file indicated (by na1me) in the fname parameter. store
52 its entire contents in a single datum. */
53 int set_datum_file(gnutls_datum_t* d, const char* fname);