Gck.Slot¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
PKCS11 Slot ID |
||
r/w/co |
PKCS11 Module |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gck.Slot(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Represents a PKCS#11 slot that can contain a token.
A PKCS#11 slot can contain a token. As an example, a slot might be a card reader, and the token the card. If the PKCS#11 module is not a hardware driver, often the slot and token are equivalent.
- classmethod from_handle(module, slot_id)[source]¶
- Parameters:
module (
Gck.Module
) – The module that this slot is on.slot_id (
int
) – The raw PKCS#11 handle or slot id of this slot.
- Returns:
The new
Gck.Slot
object.- Return type:
Create a new
Gck.Slot
object for a raw PKCS#11 handle.
- enumerate_objects(match, options)[source]¶
- Parameters:
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 slot.
If the match
Gck.Attributes
is floating, it is consumed.This call will not block but will return an enumerator immediately.
- equal(slot2)[source]¶
- Parameters:
- Returns:
True
if slot1 and slot2 are equal.False
if either is not aGck.Slot
.- Return type:
Checks equality of two slots. Two
Gck.Slot
objects can point to the same underlying PKCS#11 slot.
- get_handle()[source]¶
- Returns:
the raw CK_SLOT_ID handle
- Return type:
Get the raw PKCS#11 handle of a slot.
- get_info()[source]¶
- Returns:
the slot information, when done, use
Gck.SlotInfo.free
() to release it.- Return type:
Get the information for this slot.
- get_mechanism_info(mech_type)[source]¶
- Parameters:
mech_type (
int
) – The mechanisms type to get info for.- Returns:
the mechanism information, or
None
if failed; useGck.MechanismInfo.free
() when done with it- Return type:
Get information for the specified mechanism.
- get_mechanisms()[source]¶
- Returns:
a list of the mechanisms for this slot, which should be freed with g_array_free ()
- Return type:
[
int
]
Get the available mechanisms for this slot.
- get_module()[source]¶
- Returns:
The module, you must unreference this after you’re done with it.
- Return type:
Get the module that this slot is on.
- get_token_info()[source]¶
- Returns:
the token information; when done, use
Gck.TokenInfo.free
() to release it- Return type:
Get the token information for this slot.
- has_flags(flags)[source]¶
- Parameters:
flags (
int
) – The flags to check.- Returns:
Whether one or more flags exist.
- Return type:
Check if the PKCS11 slot has the given flags.
- hash()[source]¶
- Returns:
An integer that can be used as a hash value, or 0 if invalid.
- Return type:
Create a hash value for the
Gck.Slot
.This function is intended for easily hashing a
Gck.Slot
to add to aGLib.HashTable
or similar data structure.
- match(uri)[source]¶
- Parameters:
uri (
Gck.UriData
) – the uri to match against the slot- Returns:
whether the URI matches or not
- Return type:
Check whether the PKCS#11 URI matches the slot
- open_session(options, interaction, cancellable)[source]¶
- Parameters:
options (
Gck.SessionOptions
) – TheGck.SessionOptions
to open a session with.interaction (
Gio.TlsInteraction
orNone
) – TheGio.TlsInteraction
to use, orNone
.cancellable (
Gio.Cancellable
orNone
) – An optional cancellation object, orNone
.
- Raises:
- Returns:
a new session or
None
if an error occurs- Return type:
Open a session on the slot. If the ‘auto reuse’ setting is set, then this may be a recycled session with the same flags.
This call may block for an indefinite period.
- open_session_async(options, interaction, cancellable, callback, *user_data)[source]¶
- Parameters:
options (
Gck.SessionOptions
) – The options to open the new session with.interaction (
Gio.TlsInteraction
orNone
) – TheGio.TlsInteraction
to use, orNone
.cancellable (
Gio.Cancellable
orNone
) – Optional cancellation object, orNone
.callback (
Gio.AsyncReadyCallback
orNone
) – Called when the operation completes.
Open a session on the slot. If the ‘auto reuse’ setting is set, then this may be a recycled session with the same flags.
This call will return immediately and complete asynchronously.
- open_session_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – The result passed to the callback.- Raises:
- Returns:
the new session or
None
if an error occurs- Return type:
Get the result of an open session operation. If the ‘auto reuse’ setting is set, then this may be a recycled session with the same flags.
Property Details¶
- Gck.Slot.props.handle¶
- Name:
handle
- Type:
- Default Value:
0
- Flags:
The raw CK_SLOT_ID handle of this slot.
- Gck.Slot.props.module¶
- Name:
module
- Type:
- Default Value:
- Flags:
The PKCS11 object that this slot is a part of.