| Gcr Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
gboolean gcr_pkcs11_initialize (GCancellable *cancellable,GError **error); void gcr_pkcs11_initialize_async (GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data); gboolean gcr_pkcs11_initialize_finish (GAsyncResult *result,GError **error); GList * gcr_pkcs11_get_modules (void); void gcr_pkcs11_set_modules (GList *modules); void gcr_pkcs11_add_module (GckModule *module); gboolean gcr_pkcs11_add_module_from_file (const gchar *module_path,gpointer unused,GError **error); GList * gcr_pkcs11_get_trust_lookup_slots (void); GckSlot * gcr_pkcs11_get_trust_store_slot (void); const gchar ** gcr_pkcs11_get_trust_lookup_uris (void); void gcr_pkcs11_set_trust_lookup_uris (const gchar **pkcs11_uris); const gchar * gcr_pkcs11_get_trust_store_uri (void); void gcr_pkcs11_set_trust_store_uri (const gchar *pkcs11_uri);
Manage or lookup various global aspesct and settings of the library.
The GCR library maintains a global list of PKCS#11 modules to use for
its various lookups and storage operations. Each module is represented by
a GckModule object. You can examine this list by using
gcr_pkcs11_get_modules().
The list is configured automatically by looking for system installed
PKCS#11 modules. It's not not normally necessary to modify this list. But
if you have special needs, you can use the gcr_pkcs11_set_modules() and
gcr_pkcs11_add_module() to do so.
Trust assertions are stored and looked up in specific PKCS#11 slots.
You can examine this list with gcr_pkcs11_get_trust_lookup_slots()
gboolean gcr_pkcs11_initialize (GCancellable *cancellable,GError **error);
Asynchronously initialize the registered PKCS#11 modules.
|
optional cancellable used to cancel the operation |
|
location to place an error on failure |
Returns : |
whether the operation was successful or not. |
void gcr_pkcs11_initialize_async (GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously initialize the registered PKCS#11 modules.
|
optional cancellable used to cancel the operation |
|
callback which will be called when the operation completes |
|
data passed to the callback |
gboolean gcr_pkcs11_initialize_finish (GAsyncResult *result,GError **error);
Complete the asynchronous operation to initialize the registered PKCS#11 modules.
|
the asynchronous result |
|
location to place an error on failure |
Returns : |
whether the operation was successful or not. |
GList * gcr_pkcs11_get_modules (void);
List all the PKCS#11 modules that are used by the GCR library. Each module is a GckModule object.
An empty list of modules will be returned if gcr_pkcs11_set_modules(),
or gcr_pkcs11_initialize() has not yet run.
When done with the list, free it with gck_list_unref_free().
Returns : |
a newly allocated list of GckModule objects. [transfer full][element-type Gck.Module] |
void gcr_pkcs11_set_modules (GList *modules);
Set the list of PKCS#11 modules that are used by the GCR library. Each module in the list is a GckModule object.
It is not normally necessary to call this function. The available PKCS#11 modules installed on the system are automatically loaded by the GCR library.
|
a list of GckModule. [element-type Gck.Module] |
void gcr_pkcs11_add_module (GckModule *module);
Add a GckModule to the list of PKCS#11 modules that are used by the GCR library.
It is not normally necessary to call this function. The available PKCS#11 modules installed on the system are automatically loaded by the GCR library.
|
a GckModule |
gboolean gcr_pkcs11_add_module_from_file (const gchar *module_path,gpointer unused,GError **error);
Initialize a PKCS#11 module and add it to the modules that are used by the GCR library. Note that is an error to initialize the same PKCS#11 module twice.
It is not normally necessary to call this function. The available PKCS#11 modules installed on the system are automatically loaded by the GCR library.
|
the full file path of the PKCS#11 module |
|
unused |
|
a GError or NULL |
Returns : |
whether the module was sucessfully added. |
GList * gcr_pkcs11_get_trust_lookup_slots (void);
List all the PKCS#11 slots that are used by the GCR library for lookup of trust assertions. Each slot is a GckSlot object.
This will return an empty list if the gcr_pkcs11_initialize() function has
not yet been called.
When done with the list, free it with gck_list_unref_free().
Returns : |
a list of GckSlot objects to use for lookup of trust. [transfer full][element-type Gck.Slot] |
GckSlot * gcr_pkcs11_get_trust_store_slot (void);
Selects an appropriate PKCS#11 slot to store trust assertions. The slot to use is normally configured automatically by the system.
This will only return a valid result after the gcr_pkcs11_initialize()
method has been called.
When done with the GckSlot, use g_object_unref() to release it.
Returns : |
the GckSlot to use for trust assertions. [transfer full] |
const gchar ** gcr_pkcs11_get_trust_lookup_uris (void);
Get the PKCS#11 URIs that are used to identify which slots to use for lookup trust assertions.
Returns : |
the uri which identifies trust storage slot. [allow-none][transfer none] |
void gcr_pkcs11_set_trust_lookup_uris (const gchar **pkcs11_uris);
Set the PKCS#11 URIs that are used to identify which slots to use for lookup of trust assertions.
It is not normally necessary to call this function. The relevant PKCS#11 slots are automatically configured by the GCR library.
|
the uris which identifies trust lookup slots. [allow-none] |
const gchar * gcr_pkcs11_get_trust_store_uri (void);
Get the PKCS#11 URI that is used to identify which slot to use for storing trust storage.
Returns : |
the uri which identifies trust storage slot. [allow-none] |
void gcr_pkcs11_set_trust_store_uri (const gchar *pkcs11_uri);
Set the PKCS#11 URI that is used to identify which slot to use for storing trust assertions.
It is not normally necessary to call this function. The relevant PKCS#11 slot is automatically configured by the GCR library.
|
the uri which identifies trust storage slot. [allow-none] |