Tizen 2.0 Release
[external/libgnutls26.git] / lib / openpgp / gnutls_openpgp.h
1 #include <config.h>
2
3 #ifdef ENABLE_OPENPGP
4
5 #ifndef GNUTLS_OPENPGP_LOCAL_H
6 #define GNUTLS_OPENPGP_LOCAL_H
7
8 #include <auth_cert.h>
9 #include <opencdk.h>
10 #include <gnutls/abstract.h>
11
12 /* OpenCDK compatible */
13 typedef enum
14 {
15   KEY_ATTR_NONE = 0,
16   KEY_ATTR_SHORT_KEYID = 3,
17   KEY_ATTR_KEYID = 4,
18   KEY_ATTR_FPR = 5
19 } key_attr_t;
20
21 int gnutls_openpgp_count_key_names (const gnutls_datum_t * cert);
22
23 int gnutls_openpgp_get_key (gnutls_datum_t * key,
24                             gnutls_openpgp_keyring_t keyring,
25                             key_attr_t by, opaque * pattern);
26
27 /* internal */
28 int _gnutls_openpgp_raw_crt_to_gcert (gnutls_cert * cert,
29                                       const gnutls_datum_t * raw,
30                                       const gnutls_openpgp_keyid_t);
31
32 int
33 _gnutls_openpgp_raw_privkey_to_gkey (gnutls_privkey_t * pkey,
34                                      const gnutls_datum_t * raw_key);
35
36 int
37 _gnutls_openpgp_privkey_cpy (gnutls_openpgp_privkey_t dest, gnutls_openpgp_privkey_t src);
38
39 int
40 _gnutls_openpgp_request_key (gnutls_session_t,
41                              gnutls_datum_t * ret,
42                              const gnutls_certificate_credentials_t cred,
43                              opaque * key_fpr, int key_fpr_size);
44
45 int _gnutls_openpgp_verify_key (const gnutls_certificate_credentials_t,
46                                 const gnutls_datum_t * cert_list,
47                                 int cert_list_length, unsigned int *status);
48 int _gnutls_openpgp_fingerprint (const gnutls_datum_t * cert,
49                                  unsigned char *fpr, size_t * fprlen);
50 time_t _gnutls_openpgp_get_raw_key_creation_time (const gnutls_datum_t *
51                                                   cert);
52 time_t _gnutls_openpgp_get_raw_key_expiration_time (const gnutls_datum_t *
53                                                     cert);
54
55 int
56 _gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key,
57                                    const gnutls_datum_t * hash,
58                                    gnutls_datum_t * signature);
59
60
61 int
62 _gnutls_openpgp_privkey_decrypt_data (gnutls_openpgp_privkey_t key,
63                                      unsigned int flags,
64                                      const gnutls_datum_t * ciphertext,
65                                      gnutls_datum_t * plaintext);
66
67 #endif /*GNUTLS_OPENPGP_LOCAL_H */
68
69 #endif /*ENABLE_OPENPGP */