Gcr.Importer¶
- Implementations:
None
Methods¶
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Interaction for prompts |
||
r |
The label for the importer |
||
r |
URI of location |
Signals¶
None
Fields¶
None
Class Details¶
- class Gcr.Importer¶
- Bases:
- Structure:
An interface which allows importing of certificates and keys. Each importer is registered with a set of PKCS#11 attributes to match stuff that it can import.
An importer gets passed a [class`Parser`] and accesses the currently parsed item. To create a set of importers that can import the currently parsed item in a parser, use [func`Importer`.create_for_parsed]. The list of importers returned has the parsed item queued for import.
To queue additional items with a importer use [method`Importer`.queue_for_parsed]. In addition you can try and queue an additional item with a set of importers using the [func`Importer`.queue_and_filter_for_parsed].
To start the import, use [method`Importer`.import_async].
- classmethod create_for_parsed(parsed)[source]¶
- Parameters:
parsed (
Gcr.Parsed
) – a parser with a parsed item to import- Returns:
a list of importers which can import the parsed item, which should be freed with
GObject.Object.unref
(), orNone
if no types of importers can be created- Return type:
Create a set of importers which can import this parsed item. The parsed item is represented by the state of the
Gcr.Parser
at the time of calling this method.
- classmethod queue_and_filter_for_parsed(importers, parsed)[source]¶
- Parameters:
importers ([
Gcr.Importer
]) – a set of importersparsed (
Gcr.Parsed
) – a parsed item
- Returns:
a new set of importers that queued the item.
- Return type:
Queues an additional item to be imported in all compattible importers in the set. The parsed item is represented by the state of the
Gcr.Parser
at the time of calling this method.If the parsed item is incompatible with an importer, then that the item will not be queued on that importer.
- classmethod register(importer_type, attrs)[source]¶
- Parameters:
importer_type (
GObject.GType
) – theGObject.GType
of the importer being registeredattrs (
Gck.Attributes
) – the attributes that this importer is compatible with
Register an importer to handle parsed items that match the given attributes.
- get_interaction()[source]¶
- Returns:
the interaction or
None
- Return type:
Get the interaction used to prompt the user when needed by this importer.
- import_async(cancellable, callback, *user_data)[source]¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Import the queued items in the importer. This function returns immediately and completes asynchronously.
- import_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – an asynchronous result- Raises:
- Returns:
whether the import succeeded or failed
- Return type:
Complete an asynchronous operation to import queued items.
- queue_for_parsed(parsed)[source]¶
- Parameters:
parsed (
Gcr.Parsed
) – a parsed item to import- Returns:
whether the item was queued or not
- Return type:
Queues an additional item to be imported. The parsed item is represented by the state of the [class`Parser`] at the time of calling this method.
If the parsed item is incompatible with the importer, then this will fail and the item will not be queued.
- set_interaction(interaction)[source]¶
- Parameters:
interaction (
Gio.TlsInteraction
) – the interaction used by the importer
Set the interaction used to prompt the user when needed by this importer.
- do_import_async(cancellable, callback, *user_data) virtual¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Import the queued items in the importer. This function returns immediately and completes asynchronously.
- do_import_finish(result) virtual¶
- Parameters:
result (
Gio.AsyncResult
) – an asynchronous result- Returns:
whether the import succeeded or failed
- Return type:
Complete an asynchronous operation to import queued items.
- do_queue_for_parsed(parsed) virtual¶
- Parameters:
parsed (
Gcr.Parsed
) – a parsed item to import- Returns:
whether the item was queued or not
- Return type:
Queues an additional item to be imported. The parsed item is represented by the state of the [class`Parser`] at the time of calling this method.
If the parsed item is incompatible with the importer, then this will fail and the item will not be queued.
Property Details¶
- Gcr.Importer.props.interaction¶
- Name:
interaction
- Type:
- Default Value:
- Flags:
The interaction for the importer.
- Gcr.Importer.props.label¶
-
The label for the importer.