summaryrefslogtreecommitdiffstats
path: root/src/userpref.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/userpref.h')
-rw-r--r--src/userpref.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/userpref.h b/src/userpref.h
deleted file mode 100644
index 450549f..0000000
--- a/src/userpref.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * userpref.h
3 * contains methods to access user specific certificates IDs and more.
4 *
5 * Copyright (c) 2008 Jonathan Beck All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
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
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef USERPREF_H
23#define USERPREF_H
24
25#include <gnutls/gnutls.h>
26/**
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 */
31char *get_host_id();
32
33/**
34 * Determine if we already paired this device.
35 *
36 * @return 1 if device is already paired. Returns 0 otherwise.
37 */
38int is_device_known(char *uid);
39
40/**
41 * @return 1 if everything went well. Returns 0 otherwise.
42 */
43int store_device_public_key(char *uid, gnutls_datum_t public_key);
44
45/**
46 * @return 1 if everything went well. Returns 0 otherwise.
47 */
48int get_root_private_key(gnutls_datum_t * root_privkey);
49
50/**
51 * @return 1 if everything went well. Returns 0 otherwise.
52 */
53int get_host_private_key(gnutls_datum_t * host_privkey);
54
55/**
56 * @return 1 if everything went well. Returns 0 otherwise.
57 */
58int get_root_certificate(gnutls_datum_t * root_cert);
59
60/**
61 * @return 1 if everything went well. Returns 0 otherwise.
62 */
63int get_host_certificate(gnutls_datum_t * host_cert);
64
65/**
66 * Setup a brand new config file.
67 * @return 1 if everything went well. Returns 0 otherwise.
68 */
69int 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);
71#endif