19
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
35
#include <gnutls/gnutls.h>
36
typedef gnutls_datum_t key_data_t;
41
#ifndef LIBIMOBILEDEVICE_INTERNAL
43
#define LIBIMOBILEDEVICE_INTERNAL
45
#define LIBIMOBILEDEVICE_INTERNAL __attribute__((visibility("hidden")))
28
49
#define USERPREF_E_SUCCESS 0
29
50
#define USERPREF_E_INVALID_ARG -1
30
51
#define USERPREF_E_INVALID_CONF -2
31
52
#define USERPREF_E_SSL_ERROR -3
53
#define USERPREF_E_READ_ERROR -4
54
#define USERPREF_E_WRITE_ERROR -5
33
56
#define USERPREF_E_UNKNOWN_ERROR -256
35
58
typedef int16_t userpref_error_t;
37
G_GNUC_INTERNAL userpref_error_t userpref_get_keys_and_certs(gnutls_x509_privkey_t root_privkey, gnutls_x509_crt_t root_crt, gnutls_x509_privkey_t host_privkey, gnutls_x509_crt_t host_crt);
38
G_GNUC_INTERNAL userpref_error_t userpref_set_keys_and_certs(gnutls_datum_t * root_key, gnutls_datum_t * root_cert, gnutls_datum_t * host_key, gnutls_datum_t * host_cert);
39
G_GNUC_INTERNAL userpref_error_t userpref_get_certs_as_pem(gnutls_datum_t *pem_root_cert, gnutls_datum_t *pem_host_cert);
40
G_GNUC_INTERNAL userpref_error_t userpref_set_device_public_key(const char *uuid, gnutls_datum_t public_key);
41
userpref_error_t userpref_remove_device_public_key(const char *uuid);
42
G_GNUC_INTERNAL int userpref_has_device_public_key(const char *uuid);
43
userpref_error_t userpref_get_paired_uuids(char ***list, unsigned int *count);
61
LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_keys_and_certs(key_data_t* root_privkey, key_data_t* root_crt, key_data_t* host_privkey, key_data_t* host_crt);
63
LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_keys_and_certs(gnutls_x509_privkey_t root_privkey, gnutls_x509_crt_t root_crt, gnutls_x509_privkey_t host_privkey, gnutls_x509_crt_t host_crt);
65
LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_keys_and_certs(key_data_t * root_key, key_data_t * root_cert, key_data_t * host_key, key_data_t * host_cert);
66
LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_get_certs_as_pem(key_data_t *pem_root_cert, key_data_t *pem_host_cert);
67
LIBIMOBILEDEVICE_INTERNAL userpref_error_t userpref_set_device_public_key(const char *udid, key_data_t public_key);
68
userpref_error_t userpref_remove_device_public_key(const char *udid);
69
LIBIMOBILEDEVICE_INTERNAL int userpref_has_device_public_key(const char *udid);
70
userpref_error_t userpref_get_paired_udids(char ***list, unsigned int *count);
44
71
void userpref_get_host_id(char **host_id);