added ERX_SUPPORTED IKEv2 Notify
[strongswan.git] / src / libcharon / plugins / android / android_creds.h
1 /*
2 * Copyright (C) 2010 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup android_creds android_creds
18 * @{ @ingroup android
19 */
20
21 #ifndef ANDROID_CREDS_H_
22 #define ANDROID_CREDS_H_
23
24 #include <credentials/credential_set.h>
25
26 typedef struct android_creds_t android_creds_t;
27
28 /**
29 * Android credentials helper.
30 */
31 struct android_creds_t {
32
33 /**
34 * Implements credential_set_t
35 */
36 credential_set_t set;
37
38 /**
39 * Add a trusted CA certificate from the Android keystore to serve by
40 * this set.
41 *
42 * @param name name/ID of the certificate in the keystore
43 * @return FALSE if the certificate does not exist or is invalid
44 */
45 bool (*add_certificate)(android_creds_t *this, char *name);
46
47 /**
48 * Set the username and password for authentication.
49 *
50 * @param id ID of the user
51 * @param password password to use for authentication
52 */
53 void (*set_username_password)(android_creds_t *this, identification_t *id,
54 char *password);
55
56 /**
57 * Clear the stored credentials.
58 */
59 void (*clear)(android_creds_t *this);
60
61 /**
62 * Destroy a android_creds instance.
63 */
64 void (*destroy)(android_creds_t *this);
65
66 };
67
68 /**
69 * Create an android_creds instance.
70 */
71 android_creds_t *android_creds_create();
72
73 #endif /** ANDROID_CREDS_H_ @}*/