diff options
Diffstat (limited to 'src/userpref.h')
| -rw-r--r-- | src/userpref.h | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/src/userpref.h b/src/userpref.h index e7835d0..deced04 100644 --- a/src/userpref.h +++ b/src/userpref.h | |||
| @@ -8,64 +8,34 @@ | |||
| 8 | * modify it under the terms of the GNU Lesser General Public | 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either | 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. | 10 | * version 2.1 of the License, or (at your option) any later version. |
| 11 | * | 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, | 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. | 15 | * Lesser General Public License for more details. |
| 16 | * | 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public | 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software | 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #ifndef USERPREF_H | 22 | #ifndef USERPREF_H |
| 23 | #define USERPREF_H | 23 | #define USERPREF_H |
| 24 | 24 | ||
| 25 | #include <gnutls/gnutls.h> | 25 | #include <gnutls/gnutls.h> |
| 26 | /** | 26 | #include "libiphone/libiphone.h" |
| 27 | * Method to get user's HostID. Caller must free returned buffer. | ||
| 28 | * | ||
| 29 | * @return the HostID if exist in config file. Returns NULL otherwise. | ||
| 30 | */ | ||
| 31 | char *get_host_id(void); | ||
| 32 | 27 | ||
| 33 | /** | ||
| 34 | * Determine if we already paired this device. | ||
| 35 | * | ||
| 36 | * @return 1 if device is already paired. Returns 0 otherwise. | ||
| 37 | */ | ||
| 38 | int is_device_known(char *uid); | ||
| 39 | 28 | ||
| 40 | /** | 29 | iphone_error_t 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); |
| 41 | * @return 1 if everything went well. Returns 0 otherwise. | ||
| 42 | */ | ||
| 43 | int store_device_public_key(char *uid, char *public_key); | ||
| 44 | 30 | ||
| 45 | /** | 31 | iphone_error_t get_certs_as_pem(gnutls_datum_t *pem_root_cert, gnutls_datum_t *pem_host_cert); |
| 46 | * @return 1 if everything went well. Returns 0 otherwise. | ||
| 47 | */ | ||
| 48 | int get_root_private_key(gnutls_datum_t * root_privkey); | ||
| 49 | 32 | ||
| 50 | /** | 33 | char *get_host_id(void); |
| 51 | * @return 1 if everything went well. Returns 0 otherwise. | ||
| 52 | */ | ||
| 53 | int get_host_private_key(gnutls_datum_t * host_privkey); | ||
| 54 | 34 | ||
| 55 | /** | 35 | int is_device_known(char *uid); |
| 56 | * @return 1 if everything went well. Returns 0 otherwise. | ||
| 57 | */ | ||
| 58 | int get_root_certificate(gnutls_datum_t * root_cert); | ||
| 59 | 36 | ||
| 60 | /** | 37 | int store_device_public_key(char *uid, gnutls_datum_t public_key); |
| 61 | * @return 1 if everything went well. Returns 0 otherwise. | ||
| 62 | */ | ||
| 63 | int get_host_certificate(gnutls_datum_t * host_cert); | ||
| 64 | 38 | ||
| 65 | /** | 39 | int init_config_file( gnutls_datum_t * root_key, gnutls_datum_t * host_key, gnutls_datum_t * root_cert, |
| 66 | * Setup a brand new config file. | ||
| 67 | * @return 1 if everything went well. Returns 0 otherwise. | ||
| 68 | */ | ||
| 69 | int init_config_file(char *host_id, gnutls_datum_t * root_key, gnutls_datum_t * host_key, gnutls_datum_t * root_cert, | ||
| 70 | gnutls_datum_t * host_cert); | 40 | gnutls_datum_t * host_cert); |
| 71 | #endif | 41 | #endif |
