Gck.Enumerator

g GObject.Object GObject.Object Gck.Enumerator Gck.Enumerator GObject.Object->Gck.Enumerator

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_chained ()

get_interaction ()

get_object_type ()

next (cancellable)

next_async (max_objects, cancellable, callback, *user_data)

next_finish (result)

next_n (max_objects, cancellable)

set_chained (chained)

set_interaction (interaction)

set_object_type (object_type, attr_types)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

chained

Gck.Enumerator

r/w

Chained enumerator

interaction

Gio.TlsInteraction

r/w

Interaction asking for pins

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gck.Enumerator(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gck.EnumeratorClass

Can be used to enumerate through PKCS#11 objects. It will automatically create sessions as necessary.

Use [func`modules_enumerate_objects`] or [func`modules_enumerate_uri`] to create an enumerator. To get the objects, use [method`Enumerator`.next] or [method`Enumerator`.next_async] functions.

get_chained()[source]
Returns:

the chained enumerator or None

Return type:

Gck.Enumerator or None

Get the enumerator that will be run after all objects from this one are seen.

get_interaction()[source]
Returns:

the interaction or None

Return type:

Gio.TlsInteraction or None

Get the interaction used when a pin is needed

get_object_type()[source]
Returns:

the type of objects created

Return type:

GObject.GType

Get the type of objects created by this enumerator. The type will always either be Gck.Object or derived from it.

next(cancellable)[source]
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None

Raises:

GLib.Error

Returns:

The next object, which must be released using GObject.Object.unref, or None.

Return type:

Gck.Object or None

Get the next object in the enumerator, or None if there are no more objects.

None is also returned if the function fails. Use the error to determine whether a failure occurred or not.

next_async(max_objects, cancellable, callback, *user_data)[source]
Parameters:

Get the next set of objects from the enumerator. This operation completes asynchronously.The maximum number of objects can be specified with max_objects. If -1 is specified, then all the remaining objects will be enumerated.

next_finish(result)[source]
Parameters:

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

Raises:

GLib.Error

Returns:

A list of ``Gck.Object``s

Return type:

[Gck.Object]

Complete an operation to enumerate next objects.

None is also returned if the function fails. Use the error to determine whether a failure occurred or not.

next_n(max_objects, cancellable)[source]
Parameters:
Raises:

GLib.Error

Returns:

A list of ``Gck.Object``s

Return type:

[Gck.Object]

Get the next set of objects from the enumerator. The maximum number of objects can be specified with max_objects. If -1 is specified, then all the remaining objects will be returned.

None is also returned if the function fails. Use the error to determine whether a failure occurred or not.

set_chained(chained)[source]
Parameters:

chained (Gck.Enumerator or None) – the chained enumerator or None

Set a chained enumerator that will be run after all objects from this one are seen.

set_interaction(interaction)[source]
Parameters:

interaction (Gio.TlsInteraction or None) – the interaction or None

Set the interaction used when a pin is needed

set_object_type(object_type, attr_types)[source]
Parameters:
  • object_type (GObject.GType) – the type of objects to create

  • attr_types ([int]) – types of attributes to retrieve for objects

Set the type of objects to be created by this enumerator. The type must always be either Gck.Object or derived from it.

If attr_types and attr_count are non-None and non-zero respectively, then the Gck.ObjectCache interface is expected to be implemented on the derived class, then the enumerator will retrieve attributes for each object.

Property Details

Gck.Enumerator.props.chained
Name:

chained

Type:

Gck.Enumerator

Default Value:

None

Flags:

READABLE, WRITABLE

Chained enumerator, which will be enumerated when this enumerator has enumerated all its objects.

Gck.Enumerator.props.interaction
Name:

interaction

Type:

Gio.TlsInteraction

Default Value:

None

Flags:

READABLE, WRITABLE

Interaction object used to ask the user for pins when opening sessions. Used if the session_options of the enumerator have Gck.SessionOptions.LOGIN_USER