GnuCash
5.6-150-g038405b370+
|
Files | |
file | gnc-keyring.h |
Functions to save and retrieve passwords. | |
Functions | |
void | gnc_keyring_set_password (const gchar *access_method, const gchar *server, guint32 port, const gchar *service, const gchar *user, const gchar *password) |
Attempt to store a password in some trusted keystore. More... | |
gboolean | gnc_keyring_get_password (GtkWidget *parent, const gchar *access_method, const gchar *server, guint32 port, const gchar *service, gchar **user, gchar **password) |
Attempt to retrieve a password to connect to a remote service. More... | |
gboolean gnc_keyring_get_password | ( | GtkWidget * | parent, |
const gchar * | access_method, | ||
const gchar * | server, | ||
guint32 | port, | ||
const gchar * | service, | ||
gchar ** | user, | ||
gchar ** | password | ||
) |
Attempt to retrieve a password to connect to a remote service.
This is deliberately generic: the remote service can be a database, website, anything.
If a trusted keystore infrastructure is found (such as the Gnome's keyring or Mac OS X' keychain) this infrastructure will be queried first.
If no such infrastructure is available or the query didn't return a valid result, the user will be prompted for his password.
parent | Used to transition from in case the user is prompted for a password. |
access_method | Service type the user attempts to access. Can things like 'mysql', 'postgres' and so on. |
server | Server the user wishes to connect to. |
port | Port the service listens on. If set to 0, it will be ignored in the search for a password. |
service | The service the user wishes to access on the server. This can be a database name or a path. |
user | The user name to access the service. Remember, although you pass it to search for the password, it can have changed when the function returns. |
password | The password to access the service. |
access_method, server, port, service and user will be the parameters passed to the trusted keystore (if available) to find the unique password for this service.
Definition at line 167 of file gnc-keyring.c.
void gnc_keyring_set_password | ( | const gchar * | access_method, |
const gchar * | server, | ||
guint32 | port, | ||
const gchar * | service, | ||
const gchar * | user, | ||
const gchar * | password | ||
) |
Attempt to store a password in some trusted keystore.
At this point that can be Gnome's keyring or Mac OS X' keychain. If no such keystore is available, this function does nothing.
All the parameters passed (except for the password) will be used to create a unique key, so the password can later be retrieved again with the same parameters.
access_method | Service type the user attempts to access. Can things like 'mysql', 'postgres' and so on. |
server | Server the user wishes to connect to. |
port | Port the service listens on. If set to 0, it will be ignored in the search for a password. |
service | The service the user wishes to access on the server. This can be a database name or a path. |
user | The username to access the service. |
password | The password to access the service. |
Definition at line 68 of file gnc-keyring.c.