2 * Copyright (C) 2010 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
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>.
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
17 * @defgroup android_creds android_creds
21 #ifndef ANDROID_CREDS_H_
22 #define ANDROID_CREDS_H_
24 #include <credentials/credential_set.h>
26 typedef struct android_creds_t android_creds_t
;
29 * Android credentials helper.
31 struct android_creds_t
{
34 * Implements credential_set_t
39 * Add a trusted CA certificate from the Android keystore to serve by
42 * @param name name/ID of the certificate in the keystore
43 * @return FALSE if the certificate does not exist or is invalid
45 bool (*add_certificate
)(android_creds_t
*this, char *name
);
48 * Set the username and password for authentication.
50 * @param id ID of the user
51 * @param password password to use for authentication
53 void (*set_username_password
)(android_creds_t
*this, identification_t
*id
,
57 * Clear the stored credentials.
59 void (*clear
)(android_creds_t
*this);
62 * Destroy a android_creds instance.
64 void (*destroy
)(android_creds_t
*this);
69 * Create an android_creds instance.
71 android_creds_t
*android_creds_create();
73 #endif /** ANDROID_CREDS_H_ @}*/