gnome-keyring Reference Manual: Network Passwords

## Network Passwords Network Passwords — Saving of network passwords. |

## Functions

void | gnome_keyring_network_password_free ()
void | gnome_keyring_network_password_list_free ()
gpointer | gnome_keyring_find_network_password ()
GnomeKeyringResult | gnome_keyring_find_network_password_sync ()
gpointer | gnome_keyring_set_network_password ()
GnomeKeyringResult | gnome_keyring_set_network_password_sync ()

## Types and Values

| GnomeKeyringNetworkPasswordData

## Object Hierarchy

## Description

All of these APIs are deprecated. Use libsecret instead.

Networks passwords are a simple way of saving passwords associated with a certain user/server/protocol and other fields.

Attributes are not stored in a secret or encrypted manner by gnome-keyring. Do not store sensitive information in attributes.

## Functions

### gnome_keyring_network_password_free ()

    void
    gnome_keyring_network_password_free (GnomeKeyringNetworkPasswordData *data);

`gnome_keyring_network_password_free` is deprecated and should not be used in newly-written code.

Not used with libsecret.

Free a network password data pointer. If `NULL` is passed in, nothing happens.

#### Parameters

data | A GnomeKeyringNetworkPasswordData pointer. | [allow-none]

### gnome_keyring_network_password_list_free ()

    void
    gnome_keyring_network_password_list_free
                                   (GList *list);

`gnome_keyring_network_password_list_free` is deprecated and should not be used in newly-written code.

Not used with libsecret.

Free a list of network password data.

#### Parameters

list | A list of GnomeKeyringNetworkPasswordData pointers. | [element-type GnomeKeyringNetworkPasswordData]

### gnome_keyring_find_network_password ()

    gpointer
    gnome_keyring_find_network_password (const char *user,
                                         const char *domain,
                                         const char *server,
                                         const char *object,
                                         const char *protocol,
                                         const char *authtype,
                                         guint32 port,
                                         GnomeKeyringOperationGetListCallback callback,
                                         gpointer data,
                                         GDestroyNotify destroy_data);

`gnome_keyring_find_network_password` is deprecated and should not be used in newly-written code.

Use `secret_password_lookup()` with `SECRET_SCHEMA_COMPAT_NETWORK`.

Find a previously stored network password. Searches all keyrings.

A `GList` of GnomeKeyringNetworkPasswordData structures are passed to the `callback` . The list and structures are freed after the callback returns.

The user may have been prompted to unlock necessary keyrings, and user will have been prompted for access to the items if needed.

Network passwords are items with the item type `GNOME_KEYRING_ITEM_NETWORK_PASSWORD`

#### Parameters

user | The user name or `NULL` for any user. | [allow-none]
domain | The domain name or `NULL` for any domain. | [allow-none]
server | The server or `NULL` for any server. | [allow-none]
object | The remote object or `NULL` for any object. | [allow-none]
protocol | The network protocol or `NULL` for any protocol. | [allow-none]
authtype | The authentication type or `NULL` for any type. | [allow-none]
port | The network port or zero for any port. |
callback | Callback which is called when the operation completes |
data | Data to be passed to callback. | [allow-none]
destroy_data | Function to be called when data is no longer needed. |

#### Returns

The asynchronous request, which can be passed to `gnome_keyring_cancel_request()`.

[transfer none]

### gnome_keyring_find_network_password_sync ()

    GnomeKeyringResult
    gnome_keyring_find_network_password_sync
                                   (const char *user,
                                    const char *domain,
                                    const char *server,
                                    const char *object,
                                    const char *protocol,
                                    const char *authtype,
                                    guint32 port,
                                    GList **results);

`gnome_keyring_find_network_password_sync` is deprecated and should not be used in newly-written code.

Use `secret_password_lookup_sync()` with `SECRET_SCHEMA_COMPAT_NETWORK`.

Find a previously stored network password. Searches all keyrings.

A `GList` of GnomeKeyringNetworkPasswordData structures are returned in the `out_list` argument. The list should be freed with `gnome_keyring_network_password_list_free()`

The user may have been prompted to unlock necessary keyrings, and user will have been prompted for access to the items if needed.

Network passwords are items with the item type `GNOME_KEYRING_ITEM_NETWORK_PASSWORD`

#### Parameters

user | The user name or `NULL`. | [allow-none]
domain | The domain name or `NULL`. | [allow-none]
server | The server or `NULL`. | [allow-none]
object | The remote object or `NULL`. | [allow-none]
protocol | The network protocol or `NULL`. | [allow-none]
authtype | The authentication type or `NULL`. | [allow-none]
port | The network port or zero. |
results | A location to return a `GList` of GnomeKeyringNetworkPasswordData pointers. | [out][element-type GnomeKeyringNetworkPasswordData]

#### Returns

`GNOME_KEYRING_RESULT_OK` if the operation was succcessful or an error result otherwise.

### gnome_keyring_set_network_password ()

    gpointer
    gnome_keyring_set_network_password (const char *keyring,
                                        const char *user,
                                        const char *domain,
                                        const char *server,
                                        const char *object,
                                        const char *protocol,
                                        const char *authtype,
                                        guint32 port,
                                        const char *password,
                                        GnomeKeyringOperationGetIntCallback callback,
                                        gpointer data,
                                        GDestroyNotify destroy_data);

`gnome_keyring_set_network_password` is deprecated and should not be used in newly-written code.

Use `secret_password_store()` with `SECRET_SCHEMA_COMPAT_NETWORK`.

Store a network password.

If an item already exists for with this network info (ie: user, server etc...) then it will be updated.

Whether a new item is created or not, id of the item will be passed to the `callback` .

Network passwords are items with the item type `GNOME_KEYRING_ITEM_NETWORK_PASSWORD`

#### Parameters

keyring | The keyring to store the password in, or `NULL` for the default keyring. | [allow-none]
user | The user name or `NULL`. | [allow-none]
domain | The domain name or `NULL`. | [allow-none]
server | The server or `NULL`. | [allow-none]
object | The remote object or `NULL`. | [allow-none]
protocol | The network protocol or `NULL`. | [allow-none]
authtype | The authentication type or `NULL`. | [allow-none]
port | The network port or zero. |
password | The password to store, must not be `NULL`. |
callback | Callback which is called when the operation completes |
data | Data to be passed to callback. | [allow-none]
destroy_data | Function to be called when data is no longer needed. |

#### Returns

The asynchronous request, which can be passed to `gnome_keyring_cancel_request()`.

[transfer none]

### gnome_keyring_set_network_password_sync ()

    GnomeKeyringResult
    gnome_keyring_set_network_password_sync
                                   (const char *keyring,
                                    const char *user,
                                    const char *domain,
                                    const char *server,
                                    const char *object,
                                    const char *protocol,
                                    const char *authtype,
                                    guint32 port,
                                    const char *password,
                                    guint32 *item_id);

`gnome_keyring_set_network_password_sync` is deprecated and should not be used in newly-written code.

Use `secret_password_store_sync()` with `SECRET_SCHEMA_COMPAT_NETWORK`.

Store a network password.

If an item already exists for with this network info (ie: user, server etc...) then it will be updated.

The created or updated item id will be returned in `item_id` .

Network passwords are items with the item type `GNOME_KEYRING_ITEM_NETWORK_PASSWORD`

#### Parameters

keyring | The keyring to store the password in, or `NULL` for the default keyring. | [allow-none]
user | The user name or `NULL`. | [allow-none]
domain | The domain name or `NULL`. | [allow-none]
server | The server or `NULL`. | [allow-none]
object | The remote object or `NULL`. | [allow-none]
protocol | The network protocol or `NULL`. | [allow-none]
authtype | The authentication type or `NULL`. | [allow-none]
port | The network port or zero. |
password | The password to store, must not be `NULL`. |
item_id | A location to store the resulting item's id. | [out]

#### Returns

`GNOME_KEYRING_RESULT_OK` if the operation was succcessful or an error result otherwise.

## Types and Values

### GnomeKeyringNetworkPasswordData

    typedef struct {
    	char *keyring;
    	guint32 item_id;

    	char *protocol;
    	char *server;
    	char *object;
    	char *authtype;
    	guint32 port;

    	char *user;
    	char *domain;
    	char *password;
    } GnomeKeyringNetworkPasswordData;

`GnomeKeyringNetworkPasswordData` is deprecated and should not be used in newly-written code.

Use SECRET_SCHEMA_COMPAT_NETWORK instead.

Network password info.

#### Members

char *`keyring`; | Keyring item stored in. |
guint32 `item_id`; | The identifier of the item. |
char *`protocol`; | Network protocol or scheme. |
char *`server`; | Server or host name. |
char *`object`; | Share or other object on server. |
char *`authtype`; | Type of authentication. |
guint32 `port`; | TCP port. |
char *`user`; | User name. |
char *`domain`; | User domain |
char *`password`; | The password. |