### Method

# Secret Service search_sync

#### Declaration [src]

    GList*
    secret_service_search_sync (
      SecretService* service,
      const SecretSchema* schema,
      GHashTable* attributes,
      SecretSearchFlags flags,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Search for items matching the `attributes`.

All collections are searched. The `attributes` should be a table of string keys and string values.

If `service` is `NULL`, then `secret_service_get_sync()` will be called to get the default `SecretService` proxy.

If `SECRET_SEARCH_ALL` is set in `flags`, then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.

If `SECRET_SEARCH_UNLOCK` is set in `flags`, then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.

If `SECRET_SEARCH_LOAD_SECRETS` is set in `flags`, then the items’ secret values will be loaded for any unlocked items. Loaded item secret values are available via `secret_item_get_secret()`. If the load of a secret values fail, then the

This function may block indefinitely. Use the asynchronous version in user interface threads.

#### Parameters

`schema`

  Type: `SecretSchema`

  The schema for the attributes.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`attributes`

  Type: `GHashTable`

  Search for items matching these attributes.

  The data is owned by the caller of the function.

`flags`

  Type: `SecretSearchFlags`

  Search option flags.

`cancellable`

  Type: `GCancellable`

  Optional cancellation object.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: A list of `None`

a list of items that matched the search.

The caller of the method takes ownership of the data, and is responsible for freeing it.