Gcr.Importer

g GObject.GInterface GObject.GInterface Gcr.Importer Gcr.Importer GObject.GInterface->Gcr.Importer

Implementations:

None

Methods

class

create_for_parsed (parsed)

class

queue_and_filter_for_parsed (importers, parsed)

class

register (importer_type, attrs)

class

register_well_known ()

get_interaction ()

import_async (cancellable, callback, *user_data)

import_finish (result)

queue_for_parsed (parsed)

set_interaction (interaction)

Virtual Methods

do_import_async (cancellable, callback, *user_data)

do_import_finish (result)

do_queue_for_parsed (parsed)

Properties

Name

Type

Flags

Short Description

interaction

Gio.TlsInteraction

r/w

Interaction for prompts

label

str

r

The label for the importer

uri

str

r

URI of location

Signals

None

Fields

None

Class Details

class Gcr.Importer
Bases:

GObject.GInterface

Structure:

Gcr.ImporterInterface

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(), or None if no types of importers can be created

Return type:

[Gcr.Importer]

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:
Returns:

a new set of importers that queued the item.

Return type:

[Gcr.Importer]

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:

Register an importer to handle parsed items that match the given attributes.

classmethod register_well_known()[source]

Register built-in PKCS#11 and GnuPG importers.

get_interaction()[source]
Returns:

the interaction or None

Return type:

Gio.TlsInteraction or None

Get the interaction used to prompt the user when needed by this importer.

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

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:

GLib.Error

Returns:

whether the import succeeded or failed

Return type:

bool

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:

bool

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:

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:

bool

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:

bool

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:

Gio.TlsInteraction

Default Value:

None

Flags:

READABLE, WRITABLE

The interaction for the importer.

Gcr.Importer.props.label
Name:

label

Type:

str

Default Value:

''

Flags:

READABLE

The label for the importer.

Gcr.Importer.props.uri
Name:

uri

Type:

str

Default Value:

None

Flags:

READABLE

The URI of the location imported to.