Gck.ObjectCache

g GObject.GInterface GObject.GInterface Gck.ObjectCache Gck.ObjectCache GObject.GInterface->Gck.ObjectCache

Implementations:

None

Methods

fill (attrs)

set_attributes (attrs)

update (attr_types, cancellable)

update_async (attr_types, cancellable, callback, *user_data)

update_finish (result)

Virtual Methods

do_fill (attrs)

Properties

Name

Type

Flags

Short Description

attributes

Gck.Attributes

r/w

PKCS#11 Attributes

Signals

None

Fields

None

Class Details

class Gck.ObjectCache
Bases:

GObject.GInterface

Structure:

Gck.ObjectCacheIface

An interface implemented by derived classes of [class`Object`] to indicate which attributes they’d like an enumerator to retrieve.

These attributes are then cached on the object and can be retrieved through the [property`ObjectCache`:py:data::attributes<Gck.ObjectCache.props.attributes>] property.

fill(attrs)[source]
Parameters:

attrs (Gck.Attributes) – the attributes to cache

Adds the attributes to the set cached on this object. If an attribute is already present in the cache it will be overridden by this value.

This will be done in a thread-safe manner.

If the attrs Gck.Attributes is floating, it is consumed.

set_attributes(attrs)[source]
Parameters:

attrs (Gck.Attributes or None) – the attributes to set

Sets the attributes cached on this object.

If the attrs Gck.Attributes is floating, it is consumed.

update(attr_types, cancellable)[source]
Parameters:
  • attr_types ([int]) – the types of attributes to update

  • cancellable (Gio.Cancellable or None) – optional cancellation object

Raises:

GLib.Error

Returns:

whether the cache update was successful

Return type:

bool

Update the object cache with given attributes. If an attribute already exists in the cache, it will be updated, and if it doesn’t it will be added.

This may block, use the asynchronous version when this is not desirable

update_async(attr_types, cancellable, callback, *user_data)[source]
Parameters:

Update the object cache with given attributes. If an attribute already exists in the cache, it will be updated, and if it doesn’t it will be added.

This call will return immediately and complete asynchronously.

update_finish(result)[source]
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

whether the cache update was successful

Return type:

bool

Complete an asynchronous operation to update the object cache with given attributes.

do_fill(attrs) virtual
Parameters:

attrs (Gck.Attributes) – the attributes to cache

Adds the attributes to the set cached on this object. If an attribute is already present in the cache it will be overridden by this value.

This will be done in a thread-safe manner.

If the attrs Gck.Attributes is floating, it is consumed.

Property Details

Gck.ObjectCache.props.attributes
Name:

attributes

Type:

Gck.Attributes

Default Value:

None

Flags:

READABLE, WRITABLE

The attributes cached on this object.