Module: Secret::Retrievable

Defined in:
(unknown)

Overview

A read-only view of a secret item in the Secret Service.

Secret::Retrievable provides a read-only view of a secret item stored in the Secret Service.

Each item has a value, represented by a [structValue], which can be retrieved by [methodRetrievable.retrieve_secret] and [methodRetrievable.retrieve_secret_finish].

Instance Method Summary collapse

Instance Method Details

#attributesGLib::HashTable<String>

Get the attributes of this object.

The attributes are a mapping of string keys to string values. Attributes are used to search for items. Attributes are not stored or transferred securely by the secret service.

Do not modify the attribute returned by this method.

Returns:

  • (GLib::HashTable<String>)

    a new reference to the attributes, which should not be modified, and released with [funcGLib.HashTable.unref]

#createdInteger

Get the created date and time of the object.

The return value is the number of seconds since the unix epoch, January 1st 1970.

Returns:

  • (Integer)

    the created date and time

#labelString

Get the label of this item.

Returns:

  • (String)

    the label, which should be freed with [funcGLib.free]

#modifiedInteger

Get the modified date and time of the object.

The return value is the number of seconds since the unix epoch, January 1st 1970.

Returns:

  • (Integer)

    the modified date and time

#retrieve_secret(cancellable, callback, user_data) ⇒ nil

Retrieve the secret value of this object.

Each retrievable object has a single secret which might be a password or some other secret binary value.

This function returns immediately and completes asynchronously.

Parameters:

  • cancellable (Gio::Cancellable)

    optional cancellation object

  • callback (Gio::AsyncReadyCallback)

    called when the operation completes

  • user_data (GObject)

    data to pass to the callback

Returns:

  • (nil)

#retrieve_secret_finish(result) ⇒ Secret::Value

Complete asynchronous operation to retrieve the secret value of this object.

Parameters:

  • result (Gio::AsyncResult)

    asynchronous result passed to callback

Returns:

  • (Secret::Value)

    the secret value which should be released with [methodValue.unref], or nil

#retrieve_secret_sync(cancellable) ⇒ Secret::Value

Retrieve the secret value of this object synchronously.

Each retrievable object has a single secret which might be a password or some other secret binary value.

This method may block indefinitely and should not be used in user interface threads.

Parameters:

  • cancellable (Gio::Cancellable)

    optional cancellation object

Returns:

  • (Secret::Value)

    the secret value which should be released with [methodValue.unref], or nil