]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/frontends/android/app/src/main/jni/libandroidbridge/backend/android_creds.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / frontends / android / app / src / main / jni / libandroidbridge / backend / android_creds.h
1 /*
2 * Copyright (C) 2012-2017 Tobias Brunner
3 *
4 * Copyright (C) secunet Security Networks AG
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 /**
18 * @defgroup android_creds android_creds
19 * @{ @ingroup android_backend
20 */
21
22 #ifndef ANDROID_CREDS_H_
23 #define ANDROID_CREDS_H_
24
25 #include <library.h>
26 #include <credentials/credential_set.h>
27
28 typedef struct android_creds_t android_creds_t;
29
30 /**
31 * Android credential set that provides CA certificates via JNI and supplied
32 * user credentials.
33 */
34 struct android_creds_t {
35
36 /**
37 * Implements credential_set_t
38 */
39 credential_set_t set;
40
41 /**
42 * Add user name and password for EAP authentication
43 *
44 * @param username user name
45 * @param password password
46 */
47 void (*add_username_password)(android_creds_t *this, char *username,
48 char *password);
49
50 /**
51 * Load the user certificate and private key
52 *
53 * @return loaded client certificate, NULL on failure
54 */
55 certificate_t *(*load_user_certificate)(android_creds_t *this);
56
57 /**
58 * Clear the cached certificates and stored credentials.
59 */
60 void (*clear)(android_creds_t *this);
61
62 /**
63 * Destroy a android_creds instance.
64 */
65 void (*destroy)(android_creds_t *this);
66
67 };
68
69 /**
70 * Create an android_creds instance.
71 *
72 * @param crldir directory for cached CRLs
73 */
74 android_creds_t *android_creds_create(char *crldir);
75
76 #endif /** ANDROID_CREDS_H_ @}*/
77