Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- 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_OK
or 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.
- 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
, orNone
if 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.Slot
objects.- Return type:
[
Gck.Slot
]
Get a list of slots for across all of the modules.
- Gck.modules_initialize_registered(cancellable)[source]¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optional cancellation object- Raises:
- Returns:
A newly allocated list of
Gck.Module
objects.- Return type:
Load and initialize all the registered modules.
- Gck.modules_initialize_registered_async(cancellable, callback, *user_data)[source]¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – 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.Module
objects- 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.Object
which should be released withGObject.Object.unref
(), orNone
if no matching object was found.- Return type:
Gck.Object
orNone
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 (possibly empty) list of ``Gck.Object``s.
- 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.Slot
orNone
if 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.Slot
objects.- 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.Object
objects.- Return type:
Initialize a list of
Gck.Object
from 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.Slot
to 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.
This call will not block but will return an enumerator immediately.
- Gck.uri_data_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.UriData
for more info. Other fields will be set toNone
.