![]() |
![]() |
![]() |
GCK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
GckModule; GckModule* gck_module_new (CK_FUNCTION_LIST_PTR funcs
,guint reserved_options
); GckModule* gck_module_initialize (const gchar *path
,gpointer reserved
,guint reserved_options
,GError **err
); gboolean gck_module_equal (gconstpointer module1
,gconstpointer module2
); guint gck_module_hash (gconstpointer module
); const gchar* gck_module_get_path (GckModule *self
); CK_FUNCTION_LIST_PTR gck_module_get_functions (GckModule *self
); GckModuleInfo* gck_module_get_info (GckModule *self
); GList* gck_module_get_slots (GckModule *self
,gboolean token_present
); GckModuleInfo; void gck_module_info_free (GckModuleInfo *module_info
);
"functions" gpointer : Read / Write / Construct Only "path" gchar* : Read / Write / Construct Only
A GckModule object holds a loaded PKCS11 module. A PKCS11 module is a shared library.
You can load and initialize a PKCS11 module with the gck_module_initialize()
call. If you already
have a loaded and initialized module that you'd like to use with the various gck functions, then
you can use gck_module_new()
.
GckModule* gck_module_new (CK_FUNCTION_LIST_PTR funcs
,guint reserved_options
);
Create a GckModule representing a PKCS11 module. It is assumed that this the module is already initialized. In addition it will not be finalized when complete.
|
Initialized PKCS11 function list pointer |
|
|
Returns : |
The new PKCS11 module. |
GckModule* gck_module_initialize (const gchar *path
,gpointer reserved
,guint reserved_options
,GError **err
);
Load and initialize a PKCS11 module represented by a GckModule object.
|
The file system path to the PKCS11 module to load. |
|
Extra arguments for the PKCS11 module, should usually be NULL. |
|
No options are currently available. |
|
A location to store an error resulting from a failed load. |
Returns : |
The loaded PKCS11 module or NULL if failed. |
gboolean gck_module_equal (gconstpointer module1
,gconstpointer module2
);
Checks equality of two modules. Two GckModule objects can point to the same underlying PKCS11 module.
|
A pointer to the first GckModule |
|
A pointer to the second GckModule |
Returns : |
TRUE if module1 and module2 are equal. FALSE if either is not a GckModule. |
guint gck_module_hash (gconstpointer module
);
Create a hash value for the GckModule.
This function is intended for easily hashing a GckModule to add to a GHashTable or similar data structure.
|
A pointer to a GckModule |
Returns : |
An integer that can be used as a hash value, or 0 if invalid. |
const gchar* gck_module_get_path (GckModule *self
);
Get the file path of this module. This may not be an absolute path, and
usually reflects the path passed to gck_module_initialize()
.
|
The module for which to get the path. |
Returns : |
The path, do not modify or free this value. |
CK_FUNCTION_LIST_PTR gck_module_get_functions (GckModule *self
);
Get the PKCS11 function list for the module.
|
The module for which to get the function list. |
Returns : |
The function list, do not modify this structure. |
GckModuleInfo* gck_module_get_info (GckModule *self
);
Get the info about a PKCS11 module.
|
The module to get info for. |
Returns : |
The module info. Release this with gck_module_info_free() .
|
GList* gck_module_get_slots (GckModule *self
,gboolean token_present
);
Get the GckSlot objects for a given module.
|
The module for which to get the slots. |
|
Whether to limit only to slots with a token present. |
Returns : |
The possibly empty list of slots. Release this with gck_list_unref_free() .
|
typedef struct { guint8 pkcs11_version_major; guint8 pkcs11_version_minor; gchar *manufacturer_id; gulong flags; gchar *library_description; guint8 library_version_major; guint8 library_version_minor; } GckModuleInfo;
Holds information about the PKCS#11 module.
This structure corresponds to CK_MODULE_INFO in the PKCS11 standard. The strings are NULL terminated for easier use.
Use gck_module_info_free()
to release this structure when done with it.
guint8 |
The major version of the module. |
guint8 |
The minor version of the module. |
gchar * |
The module manufacturer. |
gulong |
The module PKCS#11 flags. |
gchar * |
The module description. |
guint8 |
The major version of the library. |
guint8 |
The minor version of the library. |
void gck_module_info_free (GckModuleInfo *module_info
);
Free a GckModuleInfo structure.
|
The module info to free, or NULL. |
"functions"
property"functions" gpointer : Read / Write / Construct Only
The raw PKCS#11 function list for the module.
This points to a CK_FUNCTION_LIST structure.
"path"
property"path" gchar* : Read / Write / Construct Only
The PKCS#11 module file path.
This may be set to NULL if this object was created from an already
initialized module via the gck_module_new()
function.
Default value: NULL
"authenticate-object"
signalgboolean user_function (GckModule *module, GckObject *object, gchar *label, gpointer password, gpointer user_data) : Run Last
This signal is emitted when a password is needed to authenticate a PKCS#11 object like a key. If the module prompts for passwords itself, then this signal will not be emitted.
|
The module. |
|
The object to be authenticated. |
|
A displayable label which describes the object. |
|
A gchar** where a password should be returned. |
|
user data set when the signal handler was connected. |
Returns : |
FALSE if the user cancelled, TRUE if we should proceed. |
"authenticate-slot"
signalgboolean user_function (GckModule *module, GckSlot *slot, gchar *string, gpointer password, gpointer user_data) : Run Last
This signal is emitted when a password is needed to authenticate a PKCS#11 slot. If the module prompts for passwords itself, then this signal will not be emitted.
|
The module |
|
The slot to be authenticated. |
|
A displayable label which describes the object. |
|
A gchar** where a password should be returned. |
|
user data set when the signal handler was connected. |
Returns : |
FALSE if the user cancelled, TRUE if we should proceed. |