| Gcr Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
struct GcrImporter; struct GcrImporterClass; enum GcrImporterPromptBehavior; GcrImporter * gcr_importer_new (void); void gcr_importer_listen (GcrImporter *self,GcrParser *parser); void gcr_importer_queue (GcrImporter *self,const gchar *label,GckAttributes *attrs); gboolean gcr_importer_import (GcrImporter *self,GCancellable *cancel,GError **error); void gcr_importer_import_async (GcrImporter *self,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gcr_importer_import_finish (GcrImporter *self,GAsyncResult *result,GError **error); GckSlot * gcr_importer_get_slot (GcrImporter *self); void gcr_importer_set_slot (GcrImporter *self,GckSlot *slot); GcrImporterPromptBehavior gcr_importer_get_prompt_behavior (GcrImporter *self); void gcr_importer_set_prompt_behavior (GcrImporter *self,GcrImporterPromptBehavior behavior); GcrParser * gcr_importer_get_parser (GcrImporter *self); void gcr_importer_set_parser (GcrImporter *self,GcrParser *parser);
A GcrImporter can be used to import items into PKCS#11 slots. It's most
often used to parse the objects parsed with a GcrParser. Use
gcr_importer_listen() to hook up the importer to the parser.
Items are queued, and then imported with gcr_importer_import() or
gcr_importer_import_async().
struct GcrImporterClass {
GObjectClass parent_class;
/* signals */
void (*queued) (GcrImporter *self, const gchar *label, GckAttributes *attrs);
void (*imported) (GcrImporter *self, GckObject *object);
};
The class for GcrImporter.
GObjectClass |
The parent class |
| Signal which is fired when an item is queued | |
| Signal which is fired when an item is imported |
typedef enum {
GCR_IMPORTER_PROMPT_NEEDED,
GCR_IMPORTER_PROMPT_ALWAYS,
GCR_IMPORTER_PROMPT_NEVER
} GcrImporterPromptBehavior;
Flags for the prompting behavior of GcrImporter.
GcrImporter * gcr_importer_new (void);
Create a new GcrImporter.
Returns : |
A newly allocated importer, which should be released with
g_object_unref(). |
void gcr_importer_listen (GcrImporter *self,GcrParser *parser);
Listen for parse events from the GcrParser, and queue parsed items for importing.
|
The importer |
|
The parser to listen to |
void gcr_importer_queue (GcrImporter *self,const gchar *label,GckAttributes *attrs);
Queue the importing of an item. Use gcr_importer_listen() to automatically
queue items parsed by a GcrParser.
|
The importer |
|
Label of item to import |
|
Attributes of item to import |
gboolean gcr_importer_import (GcrImporter *self,GCancellable *cancel,GError **error);
void gcr_importer_import_async (GcrImporter *self,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Start an asynchronous import operation of the items that have been queued.
|
The importer |
|
An optional cancellation object |
|
Call when the operation result is ready |
|
Data to pass to the callback |
gboolean gcr_importer_import_finish (GcrImporter *self,GAsyncResult *result,GError **error);
Complete an asynchronous import operation.
|
The importer |
|
The operation result |
|
A location to raise an error on failure. |
Returns : |
Whether the operation was successful or not. |
GckSlot * gcr_importer_get_slot (GcrImporter *self);
Get the PKCS#11 slot the items will be imported to, or after an import operation, which slot they have been imported to.
|
The importer |
Returns : |
The slot. |
void gcr_importer_set_slot (GcrImporter *self,GckSlot *slot);
Set the PKCS#11 slot to import the items to.
|
The importer |
|
The slot to import to |
GcrImporterPromptBehavior gcr_importer_get_prompt_behavior
(GcrImporter *self);
Get the type of prompting configured for this importer.
|
The importer |
Returns : |
The prompting flags. |
void gcr_importer_set_prompt_behavior (GcrImporter *self,GcrImporterPromptBehavior behavior);
Set the type of prompting desired during import.
|
The importer |
|
The prompt behavior flag |
GcrParser * gcr_importer_get_parser (GcrImporter *self);
gcr_importer_get_parser is deprecated and should not be used in newly-written code. Since 3.0.0
Has no effect. Use gcr_importer_listen() instead.
|
An importer |
Returns : |
NULL is always returned. |
void gcr_importer_set_parser (GcrImporter *self,GcrParser *parser);
gcr_importer_set_parser is deprecated and should not be used in newly-written code. Since 3.0.0
Has no effect. Use gcr_importer_listen() instead.
|
An importer |
|
A parser |
"prompt-behavior" property"prompt-behavior" gint : Read / Write
Import Prompt Behavior.
Allowed values: >= 0
Default value: 0
"imported" signalvoid user_function (GcrImporter *object,
GckObject *arg1,
gpointer user_data) : Run First
This signal is emitted when an item has been imported.
|
The object which was imported. |
|
user data set when the signal handler was connected. |
"queued" signalvoid user_function (GcrImporter *label,
gchar *attrs,
gpointer user_data) : Run First
This signal is emitted when an item is queued for import.
|
The label of the queued item. |
|
The attributes of the queued item. |
|
user data set when the signal handler was connected. |