summaryrefslogtreecommitdiffstats
path: root/src/userpref.h
diff options
context:
space:
mode:
authorGravatar Jonathan Beck2008-08-04 22:31:43 +0200
committerGravatar Matt Colyer2008-08-05 23:28:10 -0700
commit4b558a53f61005b0ca49665d2da92303f6e14872 (patch)
tree3631ebdcfbf681a239bde3192172d3014b56322b /src/userpref.h
parent20a6f8797add1a44aa6ea2cc1d089122d1f39be3 (diff)
downloadlibimobiledevice-4b558a53f61005b0ca49665d2da92303f6e14872.tar.gz
libimobiledevice-4b558a53f61005b0ca49665d2da92303f6e14872.tar.bz2
Store certificates and private keys as PEM files instead of storing them in config file. Added functions to generate proper pairing request.
Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src/userpref.h')
-rw-r--r--src/userpref.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/userpref.h b/src/userpref.h
index cef0bed..441c7be 100644
--- a/src/userpref.h
+++ b/src/userpref.h
@@ -22,6 +22,7 @@
22#ifndef USERPREF_H 22#ifndef USERPREF_H
23#define USERPREF_H 23#define USERPREF_H
24 24
25#include <gnutls/gnutls.h>
25/** 26/**
26* \fn char* get_host_id() 27* \fn char* get_host_id()
27* method to get user's HostID. Caller must free returned buffer. 28* method to get user's HostID. Caller must free returned buffer.
@@ -43,34 +44,34 @@ int is_device_known(char* public_key);
43int store_device_public_key(char* public_key); 44int store_device_public_key(char* public_key);
44 45
45/** 46/**
46* \fn char* get_root_private_key() 47* \fn int get_root_private_key(gnutls_datum_t* root_privkey)
47* \return RootPrivateKey if exists. Returns NULL otherwise. 48* \return 1 if everything went well. Returns 0 otherwise.
48*/ 49*/
49char* get_root_private_key(); 50int get_root_private_key(gnutls_datum_t* root_privkey);
50 51
51/** 52/**
52* \fn char* get_host_private_key() 53* \fn int get_host_private_key(gnutls_datum_t* host_privkey)
53* \return HostPrivateKey if exists. Returns NULL otherwise. 54* \return 1 if everything went well. Returns 0 otherwise.
54*/ 55*/
55char* get_host_private_key(); 56int get_host_private_key(gnutls_datum_t* host_privkey);
56 57
57/** 58/**
58* \fn char* get_root_certificate() 59* \fn int get_root_certificate(gnutls_datum_t* root_cert)
59* \return RootCertificate if exists. Returns NULL otherwise. 60* \return 1 if everything went well. Returns 0 otherwise.
60*/ 61*/
61char* get_root_certificate(); 62int get_root_certificate(gnutls_datum_t* root_cert);
62 63
63/** 64/**
64* \fn char* get_host_certificate() 65* \fn int get_host_certificate(gnutls_datum_t* host_cert)
65* \return HostCertificate if exists. Returns NULL otherwise. 66* \return 1 if everything went well. Returns 0 otherwise.
66*/ 67*/
67char* get_host_certificate(); 68int get_host_certificate(gnutls_datum_t* host_cert);
68 69
69/** 70/**
70* \fn int init_config_file(char* host_id, char* root_private_key, char* host_private_key, char* root_cert, char* host_cert) 71* \fn int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert)
71* setup a brand new config file. 72* setup a brand new config file.
72* \return 1 if everything went well. Returns 0 otherwise. 73* \return 1 if everything went well. Returns 0 otherwise.
73*/ 74*/
74int init_config_file(char* host_id, char* root_private_key, char* host_private_key, char* root_cert, char* host_cert); 75int init_config_file(char* host_id, gnutls_datum_t* root_key, gnutls_datum_t* host_key, gnutls_datum_t* root_cert, gnutls_datum_t* host_cert);
75#endif 76#endif
76 77