added .gitignore files to NM applet
[strongswan.git] / src / charon / plugins / nm / nm_creds.h
1 /*
2 * Copyright (C) 2008 Martin Willi
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 nm_creds nm_creds
18 * @{ @ingroup nm
19 */
20
21 #ifndef NM_CREDS_H_
22 #define NM_CREDS_H_
23
24 #include <credentials/credential_set.h>
25
26 typedef struct nm_creds_t nm_creds_t;
27
28 /**
29 * NetworkManager credentials helper.
30 */
31 struct nm_creds_t {
32
33 /**
34 * Implements credential_set_t
35 */
36 credential_set_t set;
37
38 /**
39 * Set the trusted gateway certificate to serve by this set.
40 *
41 * @param cert certificate to serve
42 */
43 void (*set_certificate)(nm_creds_t *this, certificate_t *cert);
44
45 /**
46 * Set the username/password for authentication.
47 *
48 * @param id ID of the user
49 * @param password password to use for authentication
50 */
51 void (*set_username_password)(nm_creds_t *this, identification_t *id,
52 char *password);
53 /**
54 * Set the certificate and private key to use for client authentication.
55 *
56 * @param cert client certificate
57 * @param key associated private key
58 */
59 void (*set_cert_and_key)(nm_creds_t *this, certificate_t *cert,
60 private_key_t *key);
61 /**
62 * Clear the stored credentials.
63 */
64 void (*clear)(nm_creds_t *this);
65
66 /**
67 * Destroy a nm_creds instance.
68 */
69 void (*destroy)(nm_creds_t *this);
70 };
71
72 /**
73 * Create a nm_creds instance.
74 */
75 nm_creds_t *nm_creds_create();
76
77 #endif /** NM_CREDS_H_ @}*/