Gck.Enumerator¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Chained enumerator |
||
r/w |
Interaction asking for pins |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gck.Enumerator(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
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:
Get the interaction used when a pin is needed
- get_object_type()[source]¶
- Returns:
the type of objects created
- Return type:
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
orNone
) – AGio.Cancellable
orNone
- Raises:
- Returns:
The next object, which must be released using
GObject.Object.unref
, orNone
.- Return type:
Gck.Object
orNone
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:
max_objects (
int
) – The maximum number of objects to getcancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – Called when the result is ready
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:
- Returns:
A list of ``Gck.Object``s
- Return type:
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:
max_objects (
int
) – The maximum amount of objects to enumeratecancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
- Raises:
- Returns:
A list of ``Gck.Object``s
- Return type:
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
orNone
) – the chained enumerator orNone
Set a chained enumerator that will be run after all objects from this one are seen.
- set_interaction(interaction)[source]¶
- Parameters:
interaction (
Gio.TlsInteraction
orNone
) – the interaction orNone
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 createattr_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 theGck.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:
- Default Value:
- Flags:
Chained enumerator, which will be enumerated when this enumerator has enumerated all its objects.
- Gck.Enumerator.props.interaction¶
- Name:
interaction
- Type:
- Default Value:
- Flags:
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