![]() |
![]() |
![]() |
Gck Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct GckSession; GckSession * gck_session_from_handle (GckSlot *slot
,gulong session_handle
,GckSessionOptions options
); GckModule * gck_session_get_module (GckSession *self
); GckSlot * gck_session_get_slot (GckSession *self
); gulong gck_session_get_handle (GckSession *self
); GckSessionInfo * gck_session_get_info (GckSession *self
); GTlsInteraction * gck_session_get_interaction (GckSession *self
); gboolean gck_session_login (GckSession *self
,gulong user_type
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GError **error
); void gck_session_login_async (GckSession *self
,gulong user_type
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gck_session_login_finish (GckSession *self
,GAsyncResult *result
,GError **error
); gboolean gck_session_logout (GckSession *self
,GCancellable *cancellable
,GError **error
); void gck_session_logout_async (GckSession *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gck_session_logout_finish (GckSession *self
,GAsyncResult *result
,GError **error
); GckObject * gck_session_create_object (GckSession *self
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
); void gck_session_create_object_async (GckSession *self
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GckObject * gck_session_create_object_finish (GckSession *self
,GAsyncResult *result
,GError **error
); gulong * gck_session_find_handles (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,gulong *n_handles
,GError **error
); void gck_session_find_handles_async (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gulong * gck_session_find_handles_finish (GckSession *self
,GAsyncResult *result
,gulong *n_handles
,GError **error
); GList * gck_session_find_objects (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,GError **error
); void gck_session_find_objects_async (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GList * gck_session_find_objects_finish (GckSession *self
,GAsyncResult *result
,GError **error
); guchar * gck_session_encrypt (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
); guchar * gck_session_encrypt_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
); void gck_session_encrypt_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); guchar * gck_session_encrypt_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
); guchar * gck_session_decrypt (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
); guchar * gck_session_decrypt_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
); void gck_session_decrypt_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); guchar * gck_session_decrypt_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
); guchar * gck_session_sign (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
); guchar * gck_session_sign_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
); void gck_session_sign_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); guchar * gck_session_sign_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
); gboolean gck_session_verify (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,const guchar *signature
,gsize n_signature
,GCancellable *cancellable
,GError **error
); gboolean gck_session_verify_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,const guchar *signature
,gsize n_signature
,GCancellable *cancellable
,GError **error
); void gck_session_verify_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,const guchar *signature
,gsize n_signature
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gck_session_verify_finish (GckSession *self
,GAsyncResult *result
,GError **error
); GckObject * gck_session_derive_key (GckSession *self
,GckObject *base
,gulong mech_type
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
); void gck_session_derive_key_async (GckSession *self
,GckObject *base
,GckMechanism *mechanism
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GckObject * gck_session_derive_key_finish (GckSession *self
,GAsyncResult *result
,GError **error
); GckObject * gck_session_derive_key_full (GckSession *self
,GckObject *base
,GckMechanism *mechanism
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
); gboolean gck_session_generate_key_pair (GckSession *self
,gulong mech_type
,GckAttributes *public_attrs
,GckAttributes *private_attrs
,GckObject **public_key
,GckObject **private_key
,GCancellable *cancellable
,GError **error
); void gck_session_generate_key_pair_async (GckSession *self
,GckMechanism *mechanism
,GckAttributes *public_attrs
,GckAttributes *private_attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gck_session_generate_key_pair_finish (GckSession *self
,GAsyncResult *result
,GckObject **public_key
,GckObject **private_key
,GError **error
); gboolean gck_session_generate_key_pair_full (GckSession *self
,GckMechanism *mechanism
,GckAttributes *public_attrs
,GckAttributes *private_attrs
,GckObject **public_key
,GckObject **private_key
,GCancellable *cancellable
,GError **error
); GckSessionOptions gck_session_get_options (GckSession *self
); gulong gck_session_get_state (GckSession *self
); gboolean gck_session_init_pin (GckSession *self
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GError **error
); void gck_session_init_pin_async (GckSession *self
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gck_session_init_pin_finish (GckSession *self
,GAsyncResult *result
,GError **error
); gboolean gck_session_set_pin (GckSession *self
,const guchar *old_pin
,gsize n_old_pin
,const guchar *new_pin
,gsize n_new_pin
,GCancellable *cancellable
,GError **error
); void gck_session_set_pin_async (GckSession *self
,const guchar *old_pin
,gsize n_old_pin
,const guchar *new_pin
,gsize n_new_pin
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean gck_session_set_pin_finish (GckSession *self
,GAsyncResult *result
,GError **error
); GckObject * gck_session_unwrap_key (GckSession *self
,GckObject *wrapper
,gulong mech_type
,const guchar *input
,gsize n_input
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
); void gck_session_unwrap_key_async (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); GckObject * gck_session_unwrap_key_finish (GckSession *self
,GAsyncResult *result
,GError **error
); GckObject * gck_session_unwrap_key_full (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
); guchar * gck_session_wrap_key (GckSession *self
,GckObject *wrapper
,gulong mech_type
,GckObject *wrapped
,gsize *n_result
,GCancellable *cancellable
,GError **error
); void gck_session_wrap_key_async (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,GckObject *wrapped
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); guchar * gck_session_wrap_key_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
); guchar * gck_session_wrap_key_full (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,GckObject *wrapped
,gsize *n_result
,GCancellable *cancellable
,GError **error
); struct GckSessionInfo; GckSessionInfo * gck_session_info_copy (GckSessionInfo *session_info
); void gck_session_info_free (GckSessionInfo *session_info
); struct GckMechanism;
"handle" gulong : Read / Write / Construct Only "interaction" GTlsInteraction* : Read / Write "module" GckModule* : Read / Write / Construct Only "options" GckSessionOptions : Read / Write / Construct Only "slot" GckSlot* : Read / Write / Construct Only
Before performing any PKCS11 operations, a session must be opened. This is analogous to an open database handle, or a file handle.
GckSession * gck_session_from_handle (GckSlot *slot
,gulong session_handle
,GckSessionOptions options
);
Initialize a GckSession object from a raw PKCS#11 session handle.
Usually one would use the gck_slot_open_session()
function to
create a session.
|
The slot which the session belongs to. |
|
the raw PKCS#11 handle of the session |
|
Session options. Those which are used during opening a session have no effect. |
Returns : |
the new GckSession object. [transfer full] |
GckModule * gck_session_get_module (GckSession *self
);
Get the PKCS#11 module to which this session belongs.
|
The session object. |
Returns : |
the module, which should be unreffed after use. [transfer full] |
GckSlot * gck_session_get_slot (GckSession *self
);
Get the PKCS#11 slot to which this session belongs.
|
The session object. |
Returns : |
The slot, which should be unreffed after use. [transfer full] |
gulong gck_session_get_handle (GckSession *self
);
Get the raw PKCS#11 session handle from a GckSession object.
|
The session object. |
Returns : |
The raw session handle. |
GckSessionInfo * gck_session_get_info (GckSession *self
);
Get information about the session.
|
The session object. |
Returns : |
the session info. Use the gck_session_info_free()
to release when done. [transfer full]
|
GTlsInteraction * gck_session_get_interaction (GckSession *self
);
Get the interaction object set on this session, which is used to prompt for pins and the like.
|
the session |
Returns : |
the interaction object, or NULL . [transfer full][allow-none]
|
gboolean gck_session_login (GckSession *self
,gulong user_type
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GError **error
);
Login the user on the session. This call may block for an indefinite period.
|
Log in to this session. |
|
The type of login user. |
|
the user's PIN, or NULL for
protected authentication path. [allow-none][array length=n_pin]
|
|
The length of the PIN. |
|
Optional cancellation object, or NULL. |
|
A location to return an error. |
Returns : |
Whether successful or not. |
void gck_session_login_async (GckSession *self
,gulong user_type
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Login the user on the session. This call will return immediately and completes asynchronously.
|
Log in to this session. |
|
The type of login user. |
|
the user's PIN, or NULL for
protected authentication path. [allow-none][array length=n_pin]
|
|
The length of the PIN. |
|
Optional cancellation object, or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
gboolean gck_session_login_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of a login operation.
|
The session logged into. |
|
The result passed to the callback. |
|
A location to return an error. |
Returns : |
Whether the operation was successful or not. |
gboolean gck_session_logout (GckSession *self
,GCancellable *cancellable
,GError **error
);
Log out of the session. This call may block for an indefinite period.
|
Logout of this session. |
|
Optional cancellation object, or NULL. |
|
A location to return an error. |
Returns : |
Whether the logout was successful or not. |
void gck_session_logout_async (GckSession *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Log out of the session. This call returns immediately and completes asynchronously.
|
Logout of this session. |
|
Optional cancellation object, or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
gboolean gck_session_logout_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of logging out of a session.
|
Logout of this session. |
|
The result passed to the callback. |
|
A location to return an error. |
Returns : |
Whether the logout was successful or not. |
GckObject * gck_session_create_object (GckSession *self
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Create a new PKCS#11 object. This call may block for an indefinite period.
|
The session to create the object on. |
|
The attributes to create the object with. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
the newly created object or NULL if an error occurred. [transfer full]
|
void gck_session_create_object_async (GckSession *self
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Create a new PKCS#11 object. This call will return immediately and complete asynchronously.
|
The session to create the object on. |
|
The attributes to create the object with. |
|
Optional cancellation object or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
GckObject * gck_session_create_object_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of creating a new PKCS#11 object.
|
The session to create the object on. |
|
The result passed to the callback. |
|
A location to return an error, or NULL. |
Returns : |
the newly created object or NULL if an error occurred. [transfer full] |
gulong * gck_session_find_handles (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,gulong *n_handles
,GError **error
);
Find the objects matching the passed attributes. This call may block for an indefinite period.
|
the session to find objects on |
|
the attributes to match against objects |
|
optional cancellation object or NULL
|
|
location to return number of handles |
|
a location to return an error or NULL
|
Returns : |
a list of the matching objects, which may be empty. [transfer full][array length=n_handles][allow-none] |
void gck_session_find_handles_async (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Find the objects matching the passed attributes. This call will return immediately and complete asynchronously.
|
the session to find objects on |
|
the attributes to match against the objects |
|
optional cancellation object or NULL
|
|
called when the operation completes |
|
data to pass to the callback |
gulong * gck_session_find_handles_finish (GckSession *self
,GAsyncResult *result
,gulong *n_handles
,GError **error
);
Get the result of a find handles operation.
|
the session |
|
the asynchronous result |
|
location to store number of handles returned |
|
a location to return an error on failure |
Returns : |
an array of
handles that matched, which may be empty, or NULL on failure. [transfer full][array length=n_handles][allow-none]
|
GList * gck_session_find_objects (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,GError **error
);
Find the objects matching the passed attributes. This call may block for an indefinite period.
|
The session to find objects on. |
|
the attributes to match |
|
Optional cancellation object or NULL. |
|
A location to return an error or NULL. |
Returns : |
a list of the matching objects, which may be empty. [transfer full][element-type Gck.Object] |
void gck_session_find_objects_async (GckSession *self
,GckAttributes *match
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Find the objects matching the passed attributes. This call will return immediately and complete asynchronously.
|
The session to find objects on. |
|
The attributes to match. |
|
Optional cancellation object or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
GList * gck_session_find_objects_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of a find operation.
|
The session to find objects on. |
|
The attributes to match. |
|
A location to return an error. |
Returns : |
a list of the matching objects, which may be empty. [transfer full][element-type Gck.Object] |
guchar * gck_session_encrypt (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Encrypt data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to encrypt with. |
|
The mechanism type to use for encryption. |
|
The data to encrypt. |
|
The length of the data to encrypt. |
|
A location to store the length of the result data. |
|
Optional cancellation object, or NULL
|
|
A location to place error information. |
Returns : |
the data that was encrypted,
or NULL if an error occured. [transfer full][array length=n_result]
|
guchar * gck_session_encrypt_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Encrypt data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to encrypt with. |
|
The mechanism type and parameters to use for encryption. |
|
The data to encrypt. |
|
The length of the data to encrypt. |
|
A location to store the length of the result data. |
|
A GCancellable which can be used to cancel the operation. |
|
A location to place error information. |
Returns : |
the data that was encrypted,
or NULL if an error occured. [transfer full][array length=n_result]
|
void gck_session_encrypt_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Encrypt data in a mechanism specific manner. This call will return immediately and complete asynchronously.
|
The session. |
|
The key to encrypt with. |
|
The mechanism type and parameters to use for encryption. |
|
The data to encrypt. |
|
The length of the data to encrypt. |
|
A GCancellable which can be used to cancel the operation. |
|
Called when the operation completes. |
|
A pointer to pass to the callback. |
guchar * gck_session_encrypt_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
);
Get the result of an encryption operation.
|
The session. |
|
The result object passed to the callback. |
|
A location to store the length of the result data. |
|
A location to place error information. |
Returns : |
the data that was encrypted,
or NULL if an error occurred. [transfer full][array length=n_result]
|
guchar * gck_session_decrypt (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Decrypt data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to decrypt with. |
|
The mechanism type to use for decryption. |
|
The data to decrypt. |
|
The length of the data to decrypt. |
|
A location to store the length of the result data. |
|
Optional cancellation object, or NULL
|
|
A location to place an error. |
Returns : |
the data that was decrypted, or NULL if an error occured. [transfer full][array length=n_result] |
guchar * gck_session_decrypt_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Decrypt data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to decrypt with. |
|
The mechanism type and parameters to use for decryption. |
|
The data to decrypt. |
|
The length of the data to decrypt. |
|
A location to store the length of the result data. |
|
A GCancellable which can be used to cancel the operation. |
|
A location to place error information. |
Returns : |
the data that was decrypted,
or NULL if an error occured. [transfer full][array length=n_result]
|
void gck_session_decrypt_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Decrypt data in a mechanism specific manner. This call will return immediately and complete asynchronously.
|
The session. |
|
The key to decrypt with. |
|
The mechanism type and parameters to use for decryption. |
|
The data to decrypt. |
|
The length of the data to decrypt. |
|
A GCancellable which can be used to cancel the operation. |
|
Called when the operation completes. |
|
A pointer to pass to the callback. |
guchar * gck_session_decrypt_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
);
Get the result of an decryption operation.
|
The session. |
|
The result object passed to the callback. |
|
A location to store the length of the result data. |
|
A location to place error information. |
Returns : |
the data that was decrypted, or NULL if an error occurred. [transfer full][array length=n_result] |
guchar * gck_session_sign (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Sign data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to sign with. |
|
The mechanism type to use for signing. |
|
The data to sign. |
|
The length of the data to sign. |
|
A location to store the length of the result data. |
|
Optional cancellation object, or NULL
|
|
A location to place an error. |
Returns : |
the data that was signed,
or NULL if an error occured. [transfer full][array length=n_result]
|
guchar * gck_session_sign_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Sign data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to sign with. |
|
The mechanism type and parameters to use for signing. |
|
The data to sign. |
|
The length of the data to sign. |
|
A location to store the length of the result data. |
|
A GCancellable which can be used to cancel the operation. |
|
A location to place error information. |
Returns : |
The data that was signed, or NULL if an error occured. |
void gck_session_sign_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Sign data in a mechanism specific manner. This call will return immediately and complete asynchronously.
|
The session. |
|
The key to sign with. |
|
The mechanism type and parameters to use for signing. |
|
The data to sign. |
|
The length of the data to sign. |
|
A GCancellable which can be used to cancel the operation. |
|
Called when the operation completes. |
|
A pointer to pass to the callback. |
guchar * gck_session_sign_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
);
Get the result of an signing operation.
|
The session. |
|
The result object passed to the callback. |
|
A location to store the length of the result data. |
|
A location to place error information. |
Returns : |
the data that was signed,
or NULL if an error occurred. [transfer full][array length=n_result]
|
gboolean gck_session_verify (GckSession *self
,GckObject *key
,gulong mech_type
,const guchar *input
,gsize n_input
,const guchar *signature
,gsize n_signature
,GCancellable *cancellable
,GError **error
);
Verify data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to verify with. |
|
The mechanism type to use for verifying. |
|
The data to verify. |
|
The length of the data to verify. |
|
The signature. |
|
The length of the signature. |
|
Optional cancellation object, or NULL
|
|
A location to place an error. |
Returns : |
TRUE if the data verified correctly, otherwise a failure or error occurred. |
gboolean gck_session_verify_full (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,const guchar *signature
,gsize n_signature
,GCancellable *cancellable
,GError **error
);
Verify data in a mechanism specific manner. This call may block for an indefinite period.
|
The session. |
|
The key to verify with. |
|
The mechanism type and parameters to use for signing. |
|
The data to verify. |
|
The length of the data to verify. |
|
The signature. |
|
The length of the signature. |
|
A GCancellable which can be used to cancel the operation. |
|
A location to place an error. |
Returns : |
TRUE if the data verified correctly, otherwise a failure or error occurred. |
void gck_session_verify_async (GckSession *self
,GckObject *key
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,const guchar *signature
,gsize n_signature
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Verify data in a mechanism specific manner. This call returns immediately and completes asynchronously.
|
The session. |
|
The key to verify with. |
|
The mechanism type and parameters to use for signing. |
|
The data to verify. |
|
The length of the data to verify. |
|
The signature. |
|
The length of the signature. |
|
A GCancellable which can be used to cancel the operation. |
|
Called when the operation completes. |
|
A pointer to pass to the callback. |
gboolean gck_session_verify_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of an verify operation.
|
The session. |
|
The result object passed to the callback. |
|
A location to place error information. |
Returns : |
TRUE if the data verified correctly, otherwise a failure or error occurred. |
GckObject * gck_session_derive_key (GckSession *self
,GckObject *base
,gulong mech_type
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Derive a key from another key. This call may block for an indefinite period.
|
The session to use. |
|
The key to derive from. |
|
The mechanism to use for derivation. |
|
Additional attributes for the derived key. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
the new derived key or NULL if the operation failed. [transfer full] |
void gck_session_derive_key_async (GckSession *self
,GckObject *base
,GckMechanism *mechanism
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Derive a key from another key. This call will return immediately and complete asynchronously.
|
The session to use. |
|
The key to derive from. |
|
The mechanism to use for derivation. |
|
Additional attributes for the derived key. |
|
Optional cancellation object or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
GckObject * gck_session_derive_key_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of a derive key operation.
|
The session to use. |
|
The async result passed to the callback. |
|
A location to return an error. |
Returns : |
the new derived key or NULL if the operation
failed. [transfer full]
|
GckObject * gck_session_derive_key_full (GckSession *self
,GckObject *base
,GckMechanism *mechanism
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Derive a key from another key. This call may block for an indefinite period.
|
The session to use. |
|
The key to derive from. |
|
The mechanism to use for derivation. |
|
Additional attributes for the derived key. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
the new derived key or NULL if the operation failed. [transfer full] |
gboolean gck_session_generate_key_pair (GckSession *self
,gulong mech_type
,GckAttributes *public_attrs
,GckAttributes *private_attrs
,GckObject **public_key
,GckObject **private_key
,GCancellable *cancellable
,GError **error
);
Generate a new key pair of public and private keys. This call may block for an indefinite period.
|
The session to use. |
|
The mechanism type to use for key generation. |
|
Additional attributes for the generated public key. |
|
Additional attributes for the generated private key. |
|
A location to return the resulting public key. |
|
A location to return the resulting private key. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
TRUE if the operation succeeded. |
void gck_session_generate_key_pair_async (GckSession *self
,GckMechanism *mechanism
,GckAttributes *public_attrs
,GckAttributes *private_attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Generate a new key pair of public and private keys. This call will return immediately and complete asynchronously.
|
The session to use. |
|
The mechanism to use for key generation. |
|
Additional attributes for the generated public key. |
|
Additional attributes for the generated private key. |
|
Optional cancellation object or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
gboolean gck_session_generate_key_pair_finish (GckSession *self
,GAsyncResult *result
,GckObject **public_key
,GckObject **private_key
,GError **error
);
Get the result of a generate key pair operation.
|
The session to use. |
|
The async result passed to the callback. |
|
A location to return the resulting public key. |
|
A location to return the resulting private key. |
|
A location to return an error. |
Returns : |
TRUE if the operation succeeded. |
gboolean gck_session_generate_key_pair_full (GckSession *self
,GckMechanism *mechanism
,GckAttributes *public_attrs
,GckAttributes *private_attrs
,GckObject **public_key
,GckObject **private_key
,GCancellable *cancellable
,GError **error
);
Generate a new key pair of public and private keys. This call may block for an indefinite period.
|
The session to use. |
|
The mechanism to use for key generation. |
|
Additional attributes for the generated public key. |
|
Additional attributes for the generated private key. |
|
A location to return the resulting public key. |
|
A location to return the resulting private key. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
TRUE if the operation succeeded. |
GckSessionOptions gck_session_get_options (GckSession *self
);
Get the options this session was opened with.
|
The session to get options from. |
Returns : |
The session options. |
gulong gck_session_get_state (GckSession *self
);
Get the session state. The state is the various PKCS#11 CKS_XXX flags.
|
the session |
Returns : |
the session state |
gboolean gck_session_init_pin (GckSession *self
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GError **error
);
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.
This call may block for an indefinite period.
|
Initialize PIN for this session's slot. |
|
The user's PIN, or NULL for protected authentication path. |
|
The length of the PIN. |
|
Optional cancellation object, or NULL. |
|
A location to return an error. |
Returns : |
Whether successful or not. |
void gck_session_init_pin_async (GckSession *self
,const guchar *pin
,gsize n_pin
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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.
This call will return immediately and completes asynchronously.
|
Initialize PIN for this session's slot. |
|
The user's PIN, or NULL for protected authentication path. [allow-none][array length=n_pin] |
|
The length of the PIN. |
|
Optional cancellation object, or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
gboolean gck_session_init_pin_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of initializing a user's PIN.
|
The session. |
|
The result passed to the callback. |
|
A location to return an error. |
Returns : |
Whether the operation was successful or not. |
gboolean gck_session_set_pin (GckSession *self
,const guchar *old_pin
,gsize n_old_pin
,const guchar *new_pin
,gsize n_new_pin
,GCancellable *cancellable
,GError **error
);
Change the user's pin on this slot that this session is opened on.
This call may block for an indefinite period.
|
Change the PIN for this session's slot. |
|
the user's old PIN, or NULL
for protected authentication path. [allow-none][array length=n_old_pin]
|
|
The length of the PIN. |
|
the user's new PIN, or NULL
for protected authentication path. [allow-none][array length=n_new_pin]
|
|
The length of the PIN. |
|
Optional cancellation object, or NULL. |
|
A location to return an error. |
Returns : |
Whether successful or not. |
void gck_session_set_pin_async (GckSession *self
,const guchar *old_pin
,gsize n_old_pin
,const guchar *new_pin
,gsize n_new_pin
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Change the user's pin on this slot that this session is opened on.
This call will return immediately and completes asynchronously.
|
Change the PIN for this session's slot. |
|
The user's old PIN, or NULL for protected authentication path. |
|
The length of the PIN. |
|
The user's new PIN, or NULL for protected authentication path. |
|
The length of the PIN. |
|
Optional cancellation object, or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
gboolean gck_session_set_pin_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of changing a user's PIN.
|
The session. |
|
The result passed to the callback. |
|
A location to return an error. |
Returns : |
Whether the operation was successful or not. |
GckObject * gck_session_unwrap_key (GckSession *self
,GckObject *wrapper
,gulong mech_type
,const guchar *input
,gsize n_input
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Unwrap a key from a byte stream. This call may block for an indefinite period.
|
The session to use. |
|
The key to use for unwrapping. |
|
The mechanism to use for unwrapping. |
|
the wrapped data as a byte stream. [array length=n_input] |
|
The length of the wrapped data. |
|
Additional attributes for the unwrapped key. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
the new unwrapped key or NULL if the operation failed. [transfer full] |
void gck_session_unwrap_key_async (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Unwrap a key from a byte stream. This call will return immediately and complete asynchronously.
|
The session to use. |
|
The key to use for unwrapping. |
|
The mechanism to use for unwrapping. |
|
the wrapped data as a byte stream. [array length=n_input] |
|
The length of the wrapped data. |
|
Additional attributes for the unwrapped key. |
|
Optional cancellation object or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
GckObject * gck_session_unwrap_key_finish (GckSession *self
,GAsyncResult *result
,GError **error
);
Get the result of a unwrap key operation.
|
The session to use. |
|
The async result passed to the callback. |
|
A location to return an error. |
Returns : |
the new unwrapped key or NULL if the operation
failed. [transfer full]
|
GckObject * gck_session_unwrap_key_full (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,const guchar *input
,gsize n_input
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Unwrap a key from a byte stream. This call may block for an indefinite period.
|
The session to use. |
|
The key to use for unwrapping. |
|
The mechanism to use for unwrapping. |
|
the wrapped data as a byte stream. [array length=n_input] |
|
The length of the wrapped data. |
|
Additional attributes for the unwrapped key. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
the new unwrapped key or NULL if the operation failed. [transfer full] |
guchar * gck_session_wrap_key (GckSession *self
,GckObject *wrapper
,gulong mech_type
,GckObject *wrapped
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Wrap a key into a byte stream. This call may block for an indefinite period.
|
The session to use. |
|
The key to use for wrapping. |
|
The mechanism type to use for wrapping. |
|
The key to wrap. |
|
A location in which to return the length of the wrapped data. |
|
A GCancellable or NULL
|
|
A location to return an error, or NULL. |
Returns : |
the wrapped data or NULL
if the operation failed. [transfer full][array length=n_result]
|
void gck_session_wrap_key_async (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,GckObject *wrapped
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Wrap a key into a byte stream. This call will return immediately and complete asynchronously.
|
The session to use. |
|
The key to use for wrapping. |
|
The mechanism to use for wrapping. |
|
The key to wrap. |
|
Optional cancellation object or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
guchar * gck_session_wrap_key_finish (GckSession *self
,GAsyncResult *result
,gsize *n_result
,GError **error
);
Get the result of a wrap key operation.
|
The session to use. |
|
The async result passed to the callback. |
|
A location in which to return the length of the wrapped data. |
|
A location to return an error. |
Returns : |
the wrapped data or NULL
if the operation failed. [transfer full][array length=n_result]
|
guchar * gck_session_wrap_key_full (GckSession *self
,GckObject *wrapper
,GckMechanism *mechanism
,GckObject *wrapped
,gsize *n_result
,GCancellable *cancellable
,GError **error
);
Wrap a key into a byte stream. This call may block for an indefinite period.
|
The session to use. |
|
The key to use for wrapping. |
|
The mechanism to use for wrapping. |
|
The key to wrap. |
|
A location in which to return the length of the wrapped data. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
the wrapped data or NULL
if the operation failed. [transfer full][array length=n_result]
|
struct GckSessionInfo { gulong slot_id; gulong state; gulong flags; gulong device_error; };
Information about the session. This is analogous to a CK_SESSION_INFO structure.
When done with this structure, release it using gck_session_info_free()
.
GckSessionInfo * gck_session_info_copy (GckSessionInfo *session_info
);
Make a new copy of a session info structure.
|
a session info structure |
Returns : |
a new copy of the session info. [transfer full] |
void gck_session_info_free (GckSessionInfo *session_info
);
Free the GckSessionInfo structure and all associated memory.
|
Session info to free. |
struct GckMechanism { gulong type; gconstpointer parameter; gulong n_parameter; };
Represents a mechanism used with crypto operations.
gulong |
The mechanism type |
gconstpointer |
Mechanism specific data. |
gulong |
Length of mechanism specific data. |
"handle"
property"handle" gulong : Read / Write / Construct Only
The raw CK_SESSION_HANDLE handle of this session.
"interaction"
property"interaction" GTlsInteraction* : Read / Write
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
"module"
property"module" GckModule* : Read / Write / Construct Only
The GckModule that this session is opened on.
"options"
property"options" GckSessionOptions : Read / Write / Construct Only
The options this session was opened with.
"slot"
property"slot" GckSlot* : Read / Write / Construct Only
The GckSlot this session is opened on.
"discard-handle"
signalgboolean user_function (GckSession *session,
gulong handle,
gpointer user_data) : Run Last
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.
If no signal handler claims the handle, then it is closed.
|
The session. |
|
The handle being discarded. |
|
user data set when the signal handler was connected. |
Returns : |
Whether or not this handle was claimed. |