diff options
Diffstat (limited to 'src/daemon/https/openpgp/gnutls_openpgp.h')
-rw-r--r-- | src/daemon/https/openpgp/gnutls_openpgp.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/src/daemon/https/openpgp/gnutls_openpgp.h b/src/daemon/https/openpgp/gnutls_openpgp.h new file mode 100644 index 00000000..82e22eee --- /dev/null +++ b/src/daemon/https/openpgp/gnutls_openpgp.h | |||
@@ -0,0 +1,98 @@ | |||
1 | #include <config.h> | ||
2 | |||
3 | #ifdef ENABLE_OPENPGP | ||
4 | |||
5 | #ifndef GNUTLS_OPENPGP_H | ||
6 | #define GNUTLS_OPENPGP_H | ||
7 | |||
8 | #include <auth_cert.h> | ||
9 | #include <opencdk.h> | ||
10 | |||
11 | typedef struct | ||
12 | { | ||
13 | int type; | ||
14 | size_t size; | ||
15 | uint8_t *data; | ||
16 | }keybox_blob; | ||
17 | |||
18 | typedef enum | ||
19 | { | ||
20 | KBX_BLOB_FILE = 0x00, | ||
21 | KBX_BLOB_DATA = 0x01 | ||
22 | }keyring_blob_types; | ||
23 | |||
24 | /* OpenCDK compatible */ | ||
25 | typedef enum | ||
26 | { | ||
27 | KEY_ATTR_NONE = 0, | ||
28 | KEY_ATTR_SHORT_KEYID = 3, | ||
29 | KEY_ATTR_KEYID = 4, | ||
30 | KEY_ATTR_FPR = 5 | ||
31 | }key_attr_t; | ||
32 | |||
33 | int | ||
34 | gnutls_certificate_set_openpgp_key_file (gnutls_certificate_credentials_t | ||
35 | res, const char *CERTFILE, | ||
36 | const char *KEYFILE, gnutls_openpgp_crt_fmt_t); | ||
37 | |||
38 | int gnutls_openpgp_count_key_names (const gnutls_datum_t * cert); | ||
39 | |||
40 | int gnutls_certificate_set_openpgp_keyring_file | ||
41 | (gnutls_certificate_credentials_t c, const char *file, gnutls_openpgp_crt_fmt_t); | ||
42 | |||
43 | int | ||
44 | gnutls_certificate_set_openpgp_keyring_mem (gnutls_certificate_credentials_t | ||
45 | c, const opaque * data, | ||
46 | size_t dlen, gnutls_openpgp_crt_fmt_t); | ||
47 | |||
48 | int gnutls_openpgp_get_key (gnutls_datum_t * key, | ||
49 | gnutls_openpgp_keyring_t keyring, | ||
50 | key_attr_t by, opaque * pattern); | ||
51 | |||
52 | int gnutls_openpgp_recv_key (const char *host, | ||
53 | short port, uint32_t keyid, | ||
54 | gnutls_datum_t * key); | ||
55 | |||
56 | /* internal */ | ||
57 | int _gnutls_openpgp_raw_key_to_gcert (gnutls_cert * cert, | ||
58 | const gnutls_datum_t * raw); | ||
59 | |||
60 | extern int | ||
61 | _gnutls_openpgp_raw_privkey_to_gkey (gnutls_privkey * pkey, | ||
62 | const gnutls_datum_t * raw_key, | ||
63 | gnutls_openpgp_crt_fmt_t format); | ||
64 | |||
65 | int | ||
66 | _gnutls_openpgp_request_key (gnutls_session_t, | ||
67 | gnutls_datum_t * ret, | ||
68 | const gnutls_certificate_credentials_t cred, | ||
69 | opaque * key_fpr, int key_fpr_size); | ||
70 | |||
71 | int _gnutls_openpgp_verify_key (const gnutls_certificate_credentials_t, | ||
72 | const gnutls_datum_t * cert_list, | ||
73 | int cert_list_length, unsigned int *status); | ||
74 | int _gnutls_openpgp_fingerprint (const gnutls_datum_t * cert, | ||
75 | unsigned char *fpr, size_t * fprlen); | ||
76 | time_t _gnutls_openpgp_get_raw_key_creation_time (const gnutls_datum_t * | ||
77 | cert); | ||
78 | time_t _gnutls_openpgp_get_raw_key_expiration_time (const gnutls_datum_t * | ||
79 | cert); | ||
80 | |||
81 | int | ||
82 | gnutls_openpgp_privkey_init (gnutls_openpgp_privkey_t * key); | ||
83 | |||
84 | int | ||
85 | gnutls_openpgp_privkey_init (gnutls_openpgp_privkey_t * key); | ||
86 | |||
87 | void | ||
88 | gnutls_openpgp_privkey_deinit (gnutls_openpgp_privkey_t key); | ||
89 | |||
90 | int | ||
91 | gnutls_openpgp_privkey_import (gnutls_openpgp_privkey_t key, | ||
92 | const gnutls_datum_t * data, | ||
93 | gnutls_openpgp_crt_fmt_t format, | ||
94 | const char *pass, unsigned int flags); | ||
95 | |||
96 | #endif /*GNUTLS_OPENPGP_H */ | ||
97 | |||
98 | #endif /*ENABLE_OPENPGP */ | ||