2 * Copyright (C) 2008 Martin Willi
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 nm_creds nm_creds
24 #include <credentials/keys/private_key.h>
25 #include <credentials/credential_set.h>
27 typedef struct nm_creds_t nm_creds_t
;
30 * NetworkManager credentials helper.
35 * Implements credential_set_t
40 * Add a trusted gateway certificate to serve by this set.
42 * @param cert certificate to serve
44 void (*add_certificate
)(nm_creds_t
*this, certificate_t
*cert
);
47 * Load CA certificates recursively from a directory.
49 * @param dir directory to PEM encoded CA certificates
51 void (*load_ca_dir
)(nm_creds_t
*this, char *dir
);
54 * Set the username/password for authentication.
56 * @param id ID of the user
57 * @param password password to use for authentication
59 void (*set_username_password
)(nm_creds_t
*this, identification_t
*id
,
63 * Set the passphrase to use for private key decryption.
65 * @param password password to use
67 void (*set_key_password
)(nm_creds_t
*this, char *password
);
70 * Set the PIN to unlock a smartcard.
72 * @param keyid keyid of the smartcard key
75 void (*set_pin
)(nm_creds_t
*this, chunk_t keyid
, char *pin
);
78 * Set the certificate and private key to use for client authentication.
80 * @param cert client certificate
81 * @param key associated private key
83 void (*set_cert_and_key
)(nm_creds_t
*this, certificate_t
*cert
,
87 * Clear the stored credentials.
89 void (*clear
)(nm_creds_t
*this);
92 * Destroy a nm_creds instance.
94 void (*destroy
)(nm_creds_t
*this);
98 * Create a nm_creds instance.
100 nm_creds_t
*nm_creds_create();
102 #endif /** NM_CREDS_H_ @}*/