## Item Attributes Item Attributes — Attributes of individual keyring items. |

## Functions

#define | gnome_keyring_attribute_list_index()
GnomeKeyringAttributeList * | gnome_keyring_attribute_list_new ()
void | gnome_keyring_attribute_list_append_string ()
void | gnome_keyring_attribute_list_append_uint32 ()
void | gnome_keyring_attribute_list_free ()
GnomeKeyringAttributeList * | gnome_keyring_attribute_list_copy ()
const gchar * | gnome_keyring_attribute_get_string ()
guint32 | gnome_keyring_attribute_get_uint32 ()

## Types and Values

enum | GnomeKeyringAttributeType
typedef | GnomeKeyringAttributeList
| GnomeKeyringAttribute

## Description

All of these APIs are deprecated. Use libsecret instead.

Attributes allow various other pieces of information to be associated with an item. These can also be used to search for relevant items. Use `gnome_keyring_item_get_attributes()` or `gnome_keyring_item_set_attributes()`.

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

Each attribute has either a string, or unsigned integer value.

## Functions

### gnome_keyring_attribute_list_index()

    #define             gnome_keyring_attribute_list_index(a, i)

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

### gnome_keyring_attribute_list_new ()

    GnomeKeyringAttributeList *
    gnome_keyring_attribute_list_new (void);

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

libsecret stores attributes as a GHashTable containing string keys and values; use `g_hash_table_new()` instead.

Create a new GnomeKeyringAttributeList.

#### Returns

The new GnomeKeyringAttributeList.

[transfer full]

### gnome_keyring_attribute_list_append_string ()

    void
    gnome_keyring_attribute_list_append_string
                                   (GnomeKeyringAttributeList *attributes,
                                    const char *name,
                                    const char *value);

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

libsecret stores attributes as a GHashTable containing string keys and values, use `g_hash_table_replace()` instead.

Store a key-value-pair with a string value in `attributes` .

#### Parameters

attributes | A GnomeKeyringAttributeList |
name | The name of the new attribute |
value | The value to store in `attributes` |

### gnome_keyring_attribute_list_append_uint32 ()

    void
    gnome_keyring_attribute_list_append_uint32
                                   (GnomeKeyringAttributeList *attributes,
                                    const char *name,
                                    guint32 value);

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

libsecret does not support number attributes.

Store a key-value-pair with an unsigned 32bit number value in `attributes` .

#### Parameters

attributes | A GnomeKeyringAttributeList |
name | The name of the new attribute |
value | The value to store in `attributes` |

### gnome_keyring_attribute_list_free ()

    void
    gnome_keyring_attribute_list_free (GnomeKeyringAttributeList *attributes);

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

libsecret stores attributes as a GHashTable containing string keys and values, use `g_hash_table_unref()` instead.

Free the memory used by `attributes` .

If a `NULL` pointer is passed, it is ignored.

#### Parameters

attributes | A GnomeKeyringAttributeList |

### gnome_keyring_attribute_list_copy ()

    GnomeKeyringAttributeList *
    gnome_keyring_attribute_list_copy (GnomeKeyringAttributeList *attributes);

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

Not needed when using libsecret.

Copy a list of item attributes.

#### Parameters

attributes | A GnomeKeyringAttributeList to copy. |

#### Returns

The new GnomeKeyringAttributeList.

[transfer full]

### gnome_keyring_attribute_get_string ()

    const gchar *
    gnome_keyring_attribute_get_string (GnomeKeyringAttribute *attribute);

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

Not needed when using libsecret.

Return the string value. It is an error to call this method if `attribute.type` is not GNOME_KEYRING_ATTRIBUTE_TYPE_STRING. This method is mostly useful for language bindings which do not provide union access. In C you should just use attribute->value.string.

#### Parameters

attribute | a GnomeKeyringAttribute |

#### Returns

The value.string pointer of `attribute` . This is not a copy, do not free.

[transfer none]

### gnome_keyring_attribute_get_uint32 ()

    guint32
    gnome_keyring_attribute_get_uint32 (GnomeKeyringAttribute *attribute);

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

Not needed when using libsecret.

Return the uint32 value. It is an error to call this method if `attribute.type` is not GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32. This method is mostly useful for language bindings which do not provide union access. In C you should just use attribute->value.integer.

#### Parameters

attribute | a GnomeKeyringAttribute |

#### Returns

The value.integer of `attribute` .

## Types and Values

### enum GnomeKeyringAttributeType

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

The data type of the item attribute.

#### Members

GNOME_KEYRING_ATTRIBUTE_TYPE_STRING | A UTF-8 encoded string attribute. |
GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 | A unsigned integer attribute. |

### GnomeKeyringAttributeList

    typedef GArray GnomeKeyringAttributeList;

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

### GnomeKeyringAttribute

    typedef struct {
    	char *name;
    	GnomeKeyringAttributeType type;
    	union {
    		char *string;
    		guint32 integer;
    	} value;
    } GnomeKeyringAttribute;

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

libsecret only supports string attributes.

An item attribute. Set `string` if data type is `GNOME_KEYRING_ATTRIBUTE_TYPE_STRING` or `integer` if data type is `GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32`

#### Members

char *`name`; | The name of the attribute. |
GnomeKeyringAttributeType `type`; | The data type. |