Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gck.builder_unref(builder)[source]¶
-
Unreferences a builder. If this was the last reference then the builder is freed.
It is an error to use this function on builders that were allocated on the stack.
- Gck.message_from_rv(rv)[source]¶
- Parameters:
rv (
int) – The PKCS#11 return value to get a message for.- Returns:
The user readable message.
- Return type:
Get a message for a PKCS#11 return value or error code. Do not pass
CKR_OKor other non-errors to this function.
- Gck.modules_enumerate_objects(modules, attrs, session_options)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulesattrs (
Gck.Attributes) – attributes that the objects must have, or empty for all objectssession_options (
Gck.SessionOptions) – Options fromGck.SessionOptions
- Returns:
A new enumerator, which should be released with
GObject.Object.unref().- Return type:
Setup an enumerator for listing matching objects on the modules.
This call will not block but will return an enumerator immediately.
If the attrs [struct`Attributes`] is floating, it is consumed.
- Gck.modules_enumerate_uri(modules, uri, session_options)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulesuri (
str) – The URI that the enumerator will matchsession_options (
Gck.SessionOptions) – Options fromGck.SessionOptions
- Raises:
- Returns:
A new
Gck.Enumerator, orNoneif an error occurs.- Return type:
Enumerate objects that match a URI.
This call will not block. Use the [class`Enumerator`] functions in order to get at the actual objects that match.
- Gck.modules_get_slots(modules, token_present)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulestoken_present (
bool) – Whether to only list slots with token present
- Returns:
A list of
Gck.Slotobjects, which should be freed with gck_list_unref_free().- Return type:
[
Gck.Slot]
Get a list of slots for across all of the modules.
- Gck.modules_initialize_registered(cancellable)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optional cancellation object- Raises:
- Returns:
A newly allocated list of
Gck.Moduleobjects, which should be released with gck_list_unref_free().- Return type:
Load and initialize all the registered modules.
- Gck.modules_initialize_registered_async(cancellable, callback, *user_data)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optional cancellation objectcallback (
Gio.AsyncReadyCallbackorNone) – a callback which will be called when the operation completes
Load and initialize all the registered modules asynchronously.
- Gck.modules_initialize_registered_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult) – the asynchronous result- Raises:
- Returns:
a list of newly initialized
Gck.Moduleobjects- Return type:
Finishes the asynchronous operation to initialize the registered PKCS#11 modules.
- Gck.modules_object_for_uri(modules, uri, session_options)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulesuri (
str) – The URI the objects must matchsession_options (
Gck.SessionOptions) – Options fromGck.SessionOptions
- Raises:
- Returns:
A new
Gck.Objectwhich should be released withGObject.Object.unref(), orNoneif no matching object was found.- Return type:
Gck.ObjectorNone
Find an object that matches a URI.
This call can block. Use [func`modules_enumerate_uri`] for a non-blocking version.
- Gck.modules_objects_for_uri(modules, uri, session_options)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulesuri (
str) – The URI the objects must matchsession_options (
Gck.SessionOptions) – Options fromGck.SessionOptions
- Raises:
- Returns:
A list of
Gck.Objectwhich should be released with gck_list_unref_free(), orNoneif no matching object was found.- Return type:
Find objects that match a URI.
This call can block. Use [func`modules_enumerate_uri`] for a non-blocking version.
- Gck.modules_token_for_uri(modules, uri)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulesuri (
str) – The URI that the token must match
- Raises:
- Returns:
A newly allocated
Gck.SlotorNoneif no such token was found.- Return type:
Lookup a token that matches the URI.
- Gck.modules_tokens_for_uri(modules, uri)[source]¶
- Parameters:
modules ([
Gck.Module]) – The modulesuri (
str) – The URI that the token must match
- Raises:
- Returns:
A list of newly allocated
Gck.Slotobjects. Use gck_list_unref_free() to release the list once you’re done with it.- Return type:
[
Gck.Slot]
Lookup a token that matches the URI.
- Gck.objects_from_handle_array(session, object_handles)[source]¶
- Parameters:
session (
Gck.Session) – The session for these objectsobject_handles ([
int]) – The raw object handles.
- Returns:
The list of
Gck.Objectobjects. You should use gck_list_unref_free() when done with this list.- Return type:
Initialize a list of
Gck.Objectfrom raw PKCS#11 handles. The handles argument must contain contiguous CK_OBJECT_HANDLE handles in an array.
- Gck.slots_enumerate_objects(slots, match, options)[source]¶
- Parameters:
slots ([
Gck.Slot]) – a list ofGck.Slotto enumerate objects on.match (
Gck.Attributes) – attributes that the objects must match, or empty for all objectsoptions (
Gck.SessionOptions) – options for opening a session
- Returns:
a new enumerator
- Return type:
Setup an enumerator for listing matching objects on the slots.
If the match
Gck.Attributesis floating, it is consumed.This call will not block but will return an enumerator immediately.
- Gck.uri_build(uri_data, flags)[source]¶
- Parameters:
uri_data (
Gck.UriData) – the info to build the URI from.flags (
Gck.UriFlags) – The context that the URI is for
- Returns:
a newly allocated string containing a PKCS#11 URI.
- Return type:
Build a PKCS#11 URI. The various parts relevant to the flags specified will be used to build the URI.
- Gck.uri_parse(string, flags)[source]¶
- Parameters:
string (
str) – the URI to parse.flags (
Gck.UriFlags) – the context in which the URI will be used.
- Raises:
- Returns:
a newly allocated
Gck.UriData; which should be freed withGck.UriData.free()- Return type:
Parse a PKCS#11 URI for use in a given context.
The result will contain the fields that are relevant for the given context. See
Gck.UriDatafor more info. Other fields will be set toNone.