Gck.Session
Description: Reference for Gck.Session

### Class

# GckSession

since: 2

#### Description [src]

    class Gck.Session : GObject.Object
      implements Gio.AsyncInitable, Gio.Initable {
      /* No available fields */
    }

Represents an open PKCS11 session.

Before performing any PKCS11 operations, a session must be opened. This is analogous to an open database handle, or a file handle.

Available since: 2

#### Hierarchy

#### Ancestors

- GObject

#### Implements

- GAsyncInitable
- GInitable

#### Functions

###### gck_session_from_handle

Initialize a session object from a raw PKCS#11 session handle. Usually one would use the `gck_slot_open_session()` function to create a session.

since: 2

###### gck_session_open

Open a session on the slot. This call may block for an indefinite period.

since: 2

###### gck_session_open_async

Open a session on the slot. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_open_finish

Get the result of an open session operation.

since: 2

#### Instance methods

###### gck_session_create_object

Create a new PKCS#11 object. This call may block for an indefinite period.

since: 2

###### gck_session_create_object_async

Create a new PKCS#11 object. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_create_object_finish

Get the result of creating a new PKCS#11 object.

since: 2

###### gck_session_decrypt

Decrypt data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_decrypt_async

Decrypt data in a mechanism specific manner. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_decrypt_finish

Get the result of an decryption operation.

since: 2

###### gck_session_decrypt_full

Decrypt data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_derive_key

Derive a key from another key. This call may block for an indefinite period.

since: 2

###### gck_session_derive_key_async

Derive a key from another key. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_derive_key_finish

Get the result of a derive key operation.

since: 2

###### gck_session_derive_key_full

Derive a key from another key. This call may block for an indefinite period.

since: 2

###### gck_session_encrypt

Encrypt data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_encrypt_async

Encrypt data in a mechanism specific manner. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_encrypt_finish

Get the result of an encryption operation.

since: 2

###### gck_session_encrypt_full

Encrypt data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_enumerate_objects

Setup an enumerator for listing matching objects available via this session.

since: 2

###### gck_session_find_handles

Find the objects matching the passed attributes. This call may block for an indefinite period.

since: 2

###### gck_session_find_handles_async

Find the objects matching the passed attributes. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_find_handles_finish

Get the result of a find handles operation.

since: 2

###### gck_session_find_objects

Find the objects matching the passed attributes. This call may block for an indefinite period.

since: 2

###### gck_session_find_objects_async

Find the objects matching the passed attributes. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_find_objects_finish

Get the result of a find operation.

since: 2

###### gck_session_generate_key_pair

Generate a new key pair of public and private keys. This call may block for an indefinite period.

since: 2

###### gck_session_generate_key_pair_async

Generate a new key pair of public and private keys. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_generate_key_pair_finish

Get the result of a generate key pair operation.

since: 2

###### gck_session_generate_key_pair_full

Generate a new key pair of public and private keys. This call may block for an indefinite period.

since: 2

###### gck_session_get_handle

Get the raw PKCS#11 session handle from a session object.

since: 2

###### gck_session_get_info

Get information about the session.

since: 2

###### gck_session_get_interaction

Get the interaction object set on this session, which is used to prompt for pins and the like.

since: 2

###### gck_session_get_module

Get the PKCS#11 module to which this session belongs.

since: 2

###### gck_session_get_options

Get the options this session was opened with.

since: 2

###### gck_session_get_slot

Get the PKCS#11 slot to which this session belongs.

since: 2

###### gck_session_get_state

Get the session state. The state is the various PKCS#11 CKS_XXX flags.

since: 2

###### gck_session_init_pin

Initialize the user’s pin on this slot that this session is opened on. According to the PKCS#11 standards, the session must be logged in with the CKU_SO user type.

since: 2

###### gck_session_init_pin_async

Initialize the user’s pin on this slot that this session is opened on. According to the PKCS#11 standards, the session must be logged in with the `CKU_SO` user type.

since: 2

###### gck_session_init_pin_finish

Get the result of initializing a user’s PIN.

since: 2

###### gck_session_login

Login the user on the session. This call may block for an indefinite period.

since: 2

###### gck_session_login_async

Login the user on the session. This call will return immediately and completes asynchronously.

since: 2

###### gck_session_login_finish

Get the result of a login operation.

since: 2

###### gck_session_login_interactive

Login the user on the session requesting the password interactively when necessary. This call may block for an indefinite period.

since: 2

###### gck_session_login_interactive_async

Login the user on the session prompting for passwords interactively when necessary. This call will return immediately and completes asynchronously.

since: 2

###### gck_session_login_interactive_finish

Get the result of a login operation.

since: 2

###### gck_session_logout

Log out of the session. This call may block for an indefinite period.

since: 2

###### gck_session_logout_async

Log out of the session. This call returns immediately and completes asynchronously.

since: 2

###### gck_session_logout_finish

Get the result of logging out of a session.

since: 2

###### gck_session_set_interaction

Set the interaction object on this session, which is used to prompt for pins and the like.

since: 2

###### gck_session_set_pin

Change the user’s pin on this slot that this session is opened on.

since: 2

###### gck_session_set_pin_async

Change the user’s pin on this slot that this session is opened on.

since: 2

###### gck_session_set_pin_finish

Get the result of changing a user’s PIN.

since: 2

###### gck_session_sign

Sign data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_sign_async

Sign data in a mechanism specific manner. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_sign_finish

Get the result of an signing operation.

since: 2

###### gck_session_sign_full

Sign data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_unwrap_key

Unwrap a key from a byte stream. This call may block for an indefinite period.

since: 2

###### gck_session_unwrap_key_async

Unwrap a key from a byte stream. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_unwrap_key_finish

Get the result of a unwrap key operation.

since: 2

###### gck_session_unwrap_key_full

Unwrap a key from a byte stream. This call may block for an indefinite period.

since: 2

###### gck_session_verify

Verify data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_verify_async

Verify data in a mechanism specific manner. This call returns immediately and completes asynchronously.

since: 2

###### gck_session_verify_finish

Get the result of an verify operation.

since: 2

###### gck_session_verify_full

Verify data in a mechanism specific manner. This call may block for an indefinite period.

since: 2

###### gck_session_wrap_key

Wrap a key into a byte stream. This call may block for an indefinite period.

since: 2

###### gck_session_wrap_key_async

Wrap a key into a byte stream. This call will return immediately and complete asynchronously.

since: 2

###### gck_session_wrap_key_finish

Get the result of a wrap key operation.

since: 2

###### gck_session_wrap_key_full

Wrap a key into a byte stream. This call may block for an indefinite period.

since: 2

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from GAsyncInitable (3)

###### g_async_initable_init_async

Starts asynchronous initialization of the object implementing the interface. This must be done before any real use of the object after initial construction. If the object also implements `GInitable` you can optionally call `g_initable_init()` instead.

unstable since: 2.22

###### g_async_initable_init_finish

Finishes asynchronous initialization and returns the result. See g_async_initable_init_async().

unstable since: 2.22

###### g_async_initable_new_finish

Finishes the async construction for the various g_async_initable_new calls, returning the created object or `NULL` on error.

unstable since: 2.22

##### Methods inherited from GInitable (1)

###### g_initable_init

Initializes the object implementing the interface.

unstable since: 2.22

#### Properties

###### Gck.Session:app-data

Raw PKCS#11 application data used to open the PKCS#11 session.

since: 2

###### Gck.Session:handle

The raw CK_SESSION_HANDLE handle of this session.

since: 2

###### Gck.Session:interaction

Interaction object used to ask the user for pins when opening sessions. Used if the session_options of the enumerator have `GCK_SESSION_LOGIN_USER`.

since: 2

###### Gck.Session:module

The GckModule that this session is opened on.

since: 2

###### Gck.Session:opening-flags

Raw PKCS#11 flags used to open the PKCS#11 session.

since: 2

###### Gck.Session:options

The options this session was opened with.

since: 2

###### Gck.Session:slot

The GckSlot this session is opened on.

since: 2

#### Signals

###### Gck.Session::discard-handle

When a GckSession is being disposed of it emits this signal to allow a session pool to pick up the handle and keep it around.

since: 2

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct GckSessionClass {
      GObjectClass parent;
      gboolean (* discard_handle) (
        GckSession* session,
        CK_SESSION_HANDLE handle
      );

    }

No description available.

###### Class members

`parent: GObjectClass`
  No description available.
`discard_handle: gboolean (* discard_handle) ( GckSession* session, CK_SESSION_HANDLE handle )`
  No description available.

#### Virtual methods

###### Gck.SessionClass.discard_handle

No description available.

since: 2