![]() |
![]() |
![]() |
gp11 Reference Manual | ![]() |
---|---|---|---|---|
#define GP11_VENDOR_CODE #define CKR_GP11_MODULE_PROBLEM #define GP11_ERROR GQuark gp11_get_error_quark (void); void gp11_list_unref_free (GList *reflist); const gchar* gp11_message_from_rv (CK_RV rv); gchar* gp11_string_from_chars (const guchar *data, gsize max); GP11Mechanism; GP11Attribute; #define GP11_INVALID void gp11_attribute_init (GP11Attribute *attr, gulong attr_type, gconstpointer value, gsize length); void gp11_attribute_init_invalid (GP11Attribute *attr, gulong attr_type); void gp11_attribute_init_boolean (GP11Attribute *attr, gulong attr_type, gboolean value); void gp11_attribute_init_date (GP11Attribute *attr, gulong attr_type, const GDate *value); void gp11_attribute_init_ulong (GP11Attribute *attr, gulong attr_type, gulong value); void gp11_attribute_init_string (GP11Attribute *attr, gulong attr_type, const gchar *value); void gp11_attribute_init_copy (GP11Attribute *dest, GP11Attribute *src); GP11Attribute* gp11_attribute_new (gulong attr_type, gpointer value, gsize length); GP11Attribute* gp11_attribute_new_invalid (gulong attr_type); GP11Attribute* gp11_attribute_new_boolean (gulong attr_type, gboolean value); GP11Attribute* gp11_attribute_new_date (gulong attr_type, const GDate *value); GP11Attribute* gp11_attribute_new_ulong (gulong attr_type, gulong value); GP11Attribute* gp11_attribute_new_string (gulong attr_type, const gchar *value); gboolean gp11_attribute_is_invalid (GP11Attribute *attr); gboolean gp11_attribute_get_boolean (GP11Attribute *attr); gulong gp11_attribute_get_ulong (GP11Attribute *attr); gchar* gp11_attribute_get_string (GP11Attribute *attr); void gp11_attribute_get_date (GP11Attribute *attr, GDate *value); GP11Attribute* gp11_attribute_dup (GP11Attribute *attr); void gp11_attribute_clear (GP11Attribute *attr); void gp11_attribute_free (GP11Attribute *attr); GP11Attributes; #define GP11_TYPE_ATTRIBUTES GType gp11_attributes_get_boxed_type (void); GP11Attributes* gp11_attributes_new (void); GP11Attributes* gp11_attributes_newv (gulong attr_type, ...); GP11Attributes* gp11_attributes_new_valist (va_list va); void gp11_attributes_set_immutable (GP11Attributes *attrs); gboolean gp11_attributes_is_immutable (GP11Attributes *attrs); GP11Attribute* gp11_attributes_at (GP11Attributes *attrs, guint index); void gp11_attributes_add (GP11Attributes *attrs, GP11Attribute *attr); void gp11_attributes_add_data (GP11Attributes *attrs, gulong attr_type, gconstpointer value, gsize length); void gp11_attributes_add_invalid (GP11Attributes *attrs, gulong attr_type); void gp11_attributes_add_boolean (GP11Attributes *attrs, gulong attr_type, gboolean value); void gp11_attributes_add_string (GP11Attributes *attrs, gulong attr_type, const gchar *string); void gp11_attributes_add_date (GP11Attributes *attrs, gulong attr_type, const GDate *date); void gp11_attributes_add_ulong (GP11Attributes *attrs, gulong attr_type, gulong value); GP11Attribute* gp11_attributes_find (GP11Attributes *attrs, gulong attr_type); gboolean gp11_attributes_find_boolean (GP11Attributes *attrs, gulong attr_type, gboolean *value); gboolean gp11_attributes_find_ulong (GP11Attributes *attrs, gulong attr_type, gulong *value); gboolean gp11_attributes_find_string (GP11Attributes *attrs, gulong attr_type, gchar **value); gboolean gp11_attributes_find_date (GP11Attributes *attrs, gulong attr_type, GDate *value); gulong gp11_attributes_count (GP11Attributes *attrs); GP11Attributes* gp11_attributes_ref (GP11Attributes *attrs); void gp11_attributes_unref (GP11Attributes *attrs); GP11ModuleInfo; void gp11_module_info_free (GP11ModuleInfo *module_info); GP11Module; GP11Module* gp11_module_initialize (const gchar *path, gpointer reserved, GError **err); GP11ModuleInfo* gp11_module_get_info (GP11Module *module); GList* gp11_module_get_slots (GP11Module *module, gboolean token_present); GP11SlotInfo; void gp11_slot_info_free (GP11SlotInfo *slot_info); GP11TokenInfo; void gp11_token_info_free (GP11TokenInfo *token_info); GP11MechanismInfo; void gp11_mechanism_info_free (GP11MechanismInfo *mech_info); typedef GP11Mechanisms; #define gp11_mechanisms_length (a) #define gp11_mechanisms_at (a, i) #define gp11_mechanisms_free (a) #define GP11_TYPE_SLOT #define GP11_SLOT (obj) #define GP11_SLOT_CLASS (klass) #define GP11_IS_SLOT (obj) #define GP11_IS_SLOT_CLASS (klass) #define GP11_SLOT_GET_CLASS (obj) GP11Slot; GType gp11_slot_get_type (void); CK_SLOT_ID gp11_slot_get_handle (GP11Slot *slot); gboolean gp11_slot_get_reuse_sessions (GP11Slot *slot); void gp11_slot_set_reuse_sessions (GP11Slot *slot, gboolean reuse); gboolean gp11_slot_get_auto_login (GP11Slot *slot); void gp11_slot_set_auto_login (GP11Slot *slot, gboolean auto_login); gint gp11_slot_get_max_pin_length (GP11Slot *slot); GP11SlotInfo* gp11_slot_get_info (GP11Slot *slot); GP11TokenInfo* gp11_slot_get_token_info (GP11Slot *slot); GP11Mechanisms* gp11_slot_get_mechanisms (GP11Slot *slot); GP11MechanismInfo* gp11_slot_get_mechanism_info (GP11Slot *slot, gulong mech_type); gboolean gp11_slot_init_token (GP11Slot *slot, const guchar *pin, gsize length, const gchar *label, GError **err); void gp11_slot_init_token_async (GP11Slot *slot, const guchar *pin, gsize length, const gchar *label, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_slot_init_token_finish (GP11Slot *slot, GAsyncResult *result, GError **err); GP11Session* gp11_slot_open_session (GP11Slot *slot, gulong flags, GError **err); GP11Session* gp11_slot_open_session_full (GP11Slot *slot, gulong flags, GCancellable *cancellable, GError **err); void gp11_slot_open_session_async (GP11Slot *slot, gulong flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Session* gp11_slot_open_session_finish (GP11Slot *slot, GAsyncResult *result, GError **err); GP11SessionInfo; void gp11_session_info_free (GP11SessionInfo *session_info); #define GP11_TYPE_SESSION #define GP11_SESSION (obj) #define GP11_SESSION_CLASS (klass) #define GP11_IS_SESSION (obj) #define GP11_IS_SESSION_CLASS (klass) #define GP11_SESSION_GET_CLASS (obj) GP11Session; GType gp11_session_get_type (void); GP11Session* gp11_session_from_handle (GP11Slot *slot, CK_SESSION_HANDLE handle); CK_SESSION_HANDLE gp11_session_get_handle (GP11Session *session); GP11SessionInfo* gp11_session_get_info (GP11Session *session); gboolean gp11_session_init_pin (GP11Session *session, const guchar *pin, gsize n_pin, GError **err); void gp11_session_init_pin_async (GP11Session *session, const guchar *pin, gsize n_pin, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_init_pin_finish (GP11Session *session, GAsyncResult *result, GError **err); gboolean gp11_session_set_pin (GP11Session *session, const guchar *old_pin, gsize n_old_pin, const guchar *new_pin, gsize n_new_pin, GError **err); void gp11_session_set_pin_async (GP11Session *session, const guchar *old_pin, gsize n_old_pin, const guchar *new_pin, gsize n_new_pin, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_set_pin_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_get_operation_state (GP11Session *session, gsize *n_result, GError **err); void gp11_session_get_operation_state_async (GP11Session *session, gsize *n_result, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_get_operation_state_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); gboolean gp11_session_set_operation_state (GP11Session *session, const guchar *state, gsize n_state, GError **err); void gp11_session_set_operation_state_async (GP11Session *session, const guchar *state, gsize n_state, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_set_operation_state_finish (GP11Session *session, GAsyncResult *result, GError **err); gboolean gp11_session_login (GP11Session *session, gulong user_type, const guchar *pin, gsize n_pin, GError **err); gboolean gp11_session_login_full (GP11Session *session, gulong user_type, const guchar *pin, gsize n_pin, GCancellable *cancellable, GError **err); void gp11_session_login_async (GP11Session *session, gulong user_type, const guchar *pin, gsize n_pin, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_login_finish (GP11Session *session, GAsyncResult *result, GError **err); gboolean gp11_session_logout (GP11Session *session, GError **err); gboolean gp11_session_logout_full (GP11Session *session, GCancellable *cancellable, GError **err); void gp11_session_logout_async (GP11Session *session, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_logout_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Object* gp11_session_create_object (GP11Session *session, GError **err, ...); GP11Object* gp11_session_create_object_full (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GError **err); void gp11_session_create_object_async (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Object* gp11_session_create_object_finish (GP11Session *session, GAsyncResult *result, GError **err); GList* gp11_session_find_objects (GP11Session *session, GError **err, ...); GList* gp11_session_find_objects_full (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GError **err); void gp11_session_find_objects_async (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GList* gp11_session_find_objects_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Object* gp11_session_generate_key (GP11Session *session, GP11Mechanism *mechanism, GError **err, ...); void gp11_session_generate_key_async (GP11Session *session, GP11Mechanism *mechanism, GAsyncReadyCallback callback, gpointer user_data, ...); GP11Object* gp11_session_generate_key_finish (GP11Session *session, GAsyncResult *result, GError **err, ...); gboolean gp11_session_generate_key_pair (GP11Session *session, GP11Mechanism *mechanism, GP11Object **public_key, GP11Object **private_key, GError **err, ...); void gp11_session_generate_key_pair_async (GP11Session *session, GP11Mechanism *mechanism, GAsyncReadyCallback callback, gpointer user_data, ...); gboolean gp11_session_generate_key_pair_finish (GP11Session *session, GAsyncResult *result, GP11Object **public_key, GP11Object **private_key, GError **err, ...); gboolean gp11_session_seed_random (GP11Session *session, const guchar *seed, gsize n_seed, GError **err); void gp11_session_seed_random_async (GP11Session *session, const guchar *seed, gsize n_seed, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_seed_random_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_generate_random (GP11Session *session, gsize n_random, GError **err); void gp11_session_generate_random_async (GP11Session *session, gsize n_random, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_generate_random_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_encrypt (GP11Session *session, GP11Object *key, gulong mech, const guchar *input, gsize n_input, gsize *n_result, GError **err); guchar* gp11_session_encrypt_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_encrypt_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); GP11Processor* gp11_session_batch_encrypt (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err); void gp11_session_batch_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_encrypt_finish (GP11Session *session, GP11Object *key, GAsyncResult *result, GError **err); guchar* gp11_session_decrypt (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err); guchar* gp11_session_decrypt_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_decrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_decrypt_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); GP11Processor* gp11_session_batch_decrypt (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err); void gp11_session_batch_decrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_decrypt_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_digest (GP11Session *session, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err); guchar* gp11_session_digest_full (GP11Session *session, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_digest_async (GP11Session *session, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_digest_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); GP11Processor* gp11_session_batch_digest (GP11Session *session, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err); void gp11_session_batch_digest_async (GP11Session *session, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_digest_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Processor* gp11_session_batch_digest_encrypt (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GError **err); void gp11_session_batch_digest_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_digest_encrypt_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Processor* gp11_session_batch_digest_decrypt (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *decrypt_mech, GCancellable *cancellable, GError **err); void gp11_session_batch_digest_decrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *decrypt_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_digest_decrypt_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Processor* gp11_session_batch_decrypt_verify (GP11Session *session, GP11Object *key, GP11Mechanism *decrypt_mech, GP11Mechanism *verify_mech, GCancellable *cancellable, GError **err); void gp11_session_batch_decrypt_verify_async (GP11Session *session, GP11Object *key, GP11Mechanism *decrypt_mech, GP11Mechanism *verify_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_decrypt_verify_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_sign (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err); guchar* gp11_session_sign_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_sign_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_sign_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); GP11Processor* gp11_session_batch_sign (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err); void gp11_session_batch_sign_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_sign_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Processor* gp11_session_batch_sign_encrypt (GP11Session *session, GP11Object *key, GP11Mechanism *sign_mech, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GError **err); void gp11_session_batch_sign_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *sign_mechanism, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Processor* gp11_session_batch_sign_encrypt_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_sign_recover (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err); guchar* gp11_session_sign_recover_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_sign_recover_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_sign_recover_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); gboolean gp11_session_verify (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, const guchar *signature, gsize n_signature, GError **err); gboolean gp11_session_verify_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, const guchar *signature, gsize n_signature, GCancellable *cancellable, GError **err); void gp11_session_verify_async (GP11Session *session, GP11Object *key, GP11Mechanism *mechanism, const guchar *input, gsize n_input, const guchar *signature, gsize n_signature, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_session_verify_finish (GP11Session *session, GAsyncResult *result, GError **err); GkrProcessor* gp11_session_batch_verify (GP11Session *session, GP11Object *key, GP11Mechanism *mech_type, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_batch_verify_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GkrProcessor* gp11_session_batch_verify_finish (GP11Session *session, GAsyncResult *result, GError **err); guchar* gp11_session_verify_recover (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err); guchar* gp11_session_verify_recover_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err); void gp11_session_verify_recover_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_verify_recover_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); guchar* gp11_session_wrap (GP11Session *session, GP11Object *key, gulong mech_type, GP11Object *wrapped_key, gsize *n_result, GError **err); void gp11_session_wrap_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GP11Object *wrapped_key, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_session_wrap_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err); GP11Object* gp11_session_unwrap (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, GError **err, ...); void gp11_session_unwrap_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Object* gp11_session_unwrap_finish (GP11Session *session, GAsyncResult *result, GError **err); GP11Object* gp11_session_derive (GP11Session *session, GP11Object *key, gulong mech_type, GError **err, ...); GP11Object* gp11_session_derive_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err, ...); void gp11_session_derive_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Object* gp11_session_derive_finish (GP11Session *session, GAsyncResult *result, GError **err); #define GP11_TYPE_OBJECT #define GP11_OBJECT (obj) #define GP11_OBJECT_CLASS (klass) #define GP11_IS_OBJECT (obj) #define GP11_IS_OBJECT_CLASS (klass) #define GP11_OBJECT_GET_CLASS (obj) GP11Object; GType gp11_object_get_type (void); GP11Object* gp11_object_from_handle (GP11Session *session, CK_OBJECT_HANDLE handle); GList* gp11_objects_from_handle_array (GP11Session *session, const GP11Attribute *attr); CK_OBJECT_HANDLE gp11_object_get_handle (GP11Object *object); GP11Object* gp11_object_copy (GP11Object *object, GError **err); GP11Object* gp11_object_copy_full (GP11Object *object, GP11Attributes *additional, GCancellable *cancellable, GError **err); void gp11_object_copy_async (GP11Object *object, GP11Attributes *additional, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Object* gp11_object_copy_finish (GP11Object *object, GAsyncResult *result, GError **err); gboolean gp11_object_destroy (GP11Object *object, GError **err); gboolean gp11_object_destroy_full (GP11Object *object, GCancellable *cancellable, GError **err); void gp11_object_destroy_async (GP11Object *object, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_object_destroy_finish (GP11Object *object, GAsyncResult *result, GError **err); gssize gp11_object_get_size (GP11Object *object, GError **err); gssize gp11_object_get_size_full (GP11Object *object, GCancellable *cancellable, GError **err); void gp11_object_get_size_async (GP11Object *object, GAsyncReadyCallback callback, gpointer user_data); gssize gp11_object_get_size_finish (GP11Object *object, GAsyncResult *result, GError **err); gboolean gp11_object_set (GP11Object *object, GError **err, ...); gboolean gp11_object_set_full (GP11Object *object, GP11Attributes *attrs, GCancellable *cancellable, GError **err); void gp11_object_set_async (GP11Object *object, GP11Attributes *attrs, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean gp11_object_set_finish (GP11Object *object, GAsyncResult *result, GError **err); GP11Attributes* gp11_object_get (GP11Object *object, GError **err, ...); GP11Attributes* gp11_object_get_full (GP11Object *object, const gulong *attr_types, gsize n_attr_types, GCancellable *cancellable, GError **err); void gp11_object_get_async (GP11Object *object, const gulong *attr_types, gsize n_attr_types, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Attributes* gp11_object_get_finish (GP11Object *object, GAsyncResult *result, GError **err); GP11Attribute* gp11_object_get_one (GP11Object *object, gulong attr_type, GError **err); GP11Attribute* gp11_object_get_one_full (GP11Object *object, gulong attr_type, GCancellable *cancellable, GError **err); void gp11_object_get_one_async (GP11Object *object, gulong attr_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GP11Attribute* gp11_object_get_one_finish (GP11Object *object, GAsyncResult *result, GError **err); guchar* gp11_processor_step (GP11Processor *processor, const guchar *input, gsize n_input, gsize *n_result, GError **err); void gp11_processor_step_async (GP11Processor *processor, const guchar *input, gsize n_input, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_processor_step_finish (GP11Processor *processor, GAsyncResult *result, gsize *n_result, GError **err); guchar* gp11_processor_close (GP11Processor *processor, gsize *n_result, GError **err); guchar* gp11_processor_close_async (GP11Processor *processor, GAsyncReadyCallback callback, gpointer user_data); guchar* gp11_processor_close_finish (GP11Processor *processor, GAsyncResult *result, gsize *n_result, GError **err);
GObject +----GP11Module
GObject +----GP11Slot
GObject +----GP11Session
GObject +----GP11Object
"module-path" gchar* : Read / Write / Construct Only "auto-login" gboolean : Read / Write "handle" guint : Read / Write / Construct Only "module" GP11Module* : Read / Write / Construct Only "reuse-sessions" gboolean : Read / Write "handle" guint : Read / Write / Construct Only "module" GP11Module* : Read / Write / Construct Only "slot" GP11Slot* : Read / Write / Construct Only "handle" guint : Read / Write / Construct Only "module" GP11Module* : Read / Write / Construct Only "session" GP11Session* : Read / Write / Construct Only
#define CKR_GP11_MODULE_PROBLEM (CKR_VENDOR_DEFINED | (GP11_VENDOR_CODE + 1))
GQuark gp11_get_error_quark (void);
The error domain for GP11 library errors.
Returns : |
The error domain. |
void gp11_list_unref_free (GList *reflist);
Free a list of GObject based pointers. All objects in the list will be unreffed and then the list itself will be freed.
|
const gchar* gp11_message_from_rv (CK_RV rv);
Get a message for a PKCS11 return value or error code. Do not pass CKR_OK or other such non errors to this function.
|
|
Returns : |
The user readable message. |
gchar* gp11_string_from_chars (const guchar *data, gsize max);
|
|
|
|
Returns : |
typedef struct { gulong type; gpointer parameter; gulong n_parameter; } GP11Mechanism;
void gp11_attribute_init (GP11Attribute *attr, gulong attr_type, gconstpointer value, gsize length);
Initialize a PKCS11 attribute. This copies the value memory into an internal buffer.
When done with the attribute you should use gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
The PKCS11 attribute type to set on the attribute. |
|
The raw value of the attribute. |
|
The length of the raw value. |
void gp11_attribute_init_invalid (GP11Attribute *attr, gulong attr_type);
Initialize a PKCS11 attribute to an 'invalid' or 'not found' state. Specifically this sets the value length to (CK_ULONG)-1 as specified in the PKCS11 specification.
When done with the attribute you should use gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
The PKCS11 attribute type to set on the attribute. |
void gp11_attribute_init_boolean (GP11Attribute *attr, gulong attr_type, gboolean value);
Initialize a PKCS11 attribute to boolean. This will result in a CK_BBOOL attribute from the PKCS11 specs.
When done with the attribute you should use gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
The PKCS11 attribute type to set on the attribute. |
|
The boolean value of the attribute. |
void gp11_attribute_init_date (GP11Attribute *attr, gulong attr_type, const GDate *value);
Initialize a PKCS11 attribute to a date. This will result in a CK_DATE attribute from the PKCS11 specs.
When done with the attribute you should use gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
The PKCS11 attribute type to set on the attribute. |
|
The date value of the attribute. |
void gp11_attribute_init_ulong (GP11Attribute *attr, gulong attr_type, gulong value);
Initialize a PKCS11 attribute to a unsigned long. This will result in a CK_ULONG attribute from the PKCS11 specs.
When done with the attribute you should use gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
The PKCS11 attribute type to set on the attribute. |
|
The ulong value of the attribute. |
void gp11_attribute_init_string (GP11Attribute *attr, gulong attr_type, const gchar *value);
Initialize a PKCS11 attribute to a string. This will result in an attribute containing the text, but not the null terminator. The text in the attribute will be of the same encoding as you pass to this function.
When done with the attribute you should use gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
The PKCS11 attribute type to set on the attribute. |
|
The null terminated string value of the attribute. |
void gp11_attribute_init_copy (GP11Attribute *dest, GP11Attribute *src);
Initialize a PKCS11 attribute as a copy of another attribute. This copies the value memory as well.
When done with the copied attribute you should use
gp11_attribute_clear()
to free the internal memory.
|
An uninitialized attribute. |
|
An attribute to copy. |
GP11Attribute* gp11_attribute_new (gulong attr_type, gpointer value, gsize length);
Create a new PKCS11 attribute. The value will be copied into the new attribute.
|
The PKCS11 attribute type to set on the attribute. |
|
The raw value of the attribute. |
|
The length of the attribute. |
Returns : |
The new attribute. When done with the attribute use
gp11_attribute_free() to free it.
|
GP11Attribute* gp11_attribute_new_invalid (gulong attr_type);
Create a new PKCS11 attribute as 'invalid' or 'not found' state. Specifically this sets the value length to (CK_ULONG)-1 as specified in the PKCS11 specification.
|
The PKCS11 attribute type to set on the attribute. |
Returns : |
The new attribute. When done with the attribute use
gp11_attribute_free() to free it.
|
GP11Attribute* gp11_attribute_new_boolean (gulong attr_type, gboolean value);
Initialize a PKCS11 attribute to boolean. This will result in a CK_BBOOL attribute from the PKCS11 specs.
|
The PKCS11 attribute type to set on the attribute. |
|
The boolean value of the attribute. |
Returns : |
The new attribute. When done with the attribute use
gp11_attribute_free() to free it.
|
GP11Attribute* gp11_attribute_new_date (gulong attr_type, const GDate *value);
Initialize a PKCS11 attribute to a date. This will result in a CK_DATE attribute from the PKCS11 specs.
|
The PKCS11 attribute type to set on the attribute. |
|
The date value of the attribute. |
Returns : |
The new attribute. When done with the attribute use
gp11_attribute_free() to free it.
|
GP11Attribute* gp11_attribute_new_ulong (gulong attr_type, gulong value);
Initialize a PKCS11 attribute to a unsigned long. This will result in a CK_ULONG attribute from the PKCS11 specs.
|
The PKCS11 attribute type to set on the attribute. |
|
The ulong value of the attribute. |
Returns : |
The new attribute. When done with the attribute use
gp11_attribute_free() to free it.
|
GP11Attribute* gp11_attribute_new_string (gulong attr_type, const gchar *value);
Initialize a PKCS11 attribute to a string. This will result in an attribute containing the text, but not the null terminator. The text in the attribute will be of the same encoding as you pass to this function.
|
The PKCS11 attribute type to set on the attribute. |
|
The null terminated string value of the attribute. |
Returns : |
The new attribute. When done with the attribute use
gp11_attribute_free() to free it.
|
gboolean gp11_attribute_is_invalid (GP11Attribute *attr);
Check if the PKCS11 attribute represents 'invalid' or 'not found' according to the PKCS11 spec. That is, having length of (CK_ULONG)-1.
|
The attribute to check. |
Returns : |
Whether the attribute represents invalid or not. |
gboolean gp11_attribute_get_boolean (GP11Attribute *attr);
Get the CK_BBOOL of a PKCS11 attribute. No conversion is performed. It is an error to pass an attribute to this function unless you're know it's supposed to contain a boolean value.
|
The attribute to retrieve value from. |
Returns : |
The boolean value of the attribute. |
gulong gp11_attribute_get_ulong (GP11Attribute *attr);
Get the CK_ULONG value of a PKCS11 attribute. No conversion is performed. It is an error to pass an attribute to this function unless you're know it's supposed to contain a value of the right type.
|
The attribute to retrieve value from. |
Returns : |
The ulong value of the attribute. |
gchar* gp11_attribute_get_string (GP11Attribute *attr);
Get the string value of a PKCS11 attribute. No conversion is performed. It is an error to pass an attribute to this function unless you're know it's supposed to contain a value of the right type.
|
The attribute to retrieve value from. |
Returns : |
A null terminated string, to be freed with g_free() ,
or NULL if the value contained a NULL string.
|
void gp11_attribute_get_date (GP11Attribute *attr, GDate *value);
Get the CK_DATE of a PKCS11 attribute. No conversion is performed. It is an error to pass an attribute to this function unless you're know it's supposed to contain a value of the right type.
|
The attribute to retrieve value from. |
|
The date value to fill in with the parsed date. |
GP11Attribute* gp11_attribute_dup (GP11Attribute *attr);
Duplicate the PKCS11 attribute. All value memory is also copied.
|
The attribute to duplicate. |
Returns : |
The duplicated attribute. Use gp11_attribute_free()
to free it.
|
void gp11_attribute_clear (GP11Attribute *attr);
Clear allocated memory held by a statically allocated attribute.
These are usually initialized with gp11_attribute_init()
or a
similar function.
|
Attribute to clear. |
void gp11_attribute_free (GP11Attribute *attr);
Free an attribute and its allocated memory. These is usually
used with attributes that are allocated by gp11_attribute_new()
or a similar function.
|
Attribute to free. |
GType gp11_attributes_get_boxed_type (void);
Get the boxed type representing a GP11Attributes array.
Returns : |
The boxed type. |
GP11Attributes* gp11_attributes_new (void);
Create a new GP11Attributes array.
Returns : |
The new attributes array. When done with the array
release it with gp11_attributes_unref() .
|
GP11Attributes* gp11_attributes_newv (gulong attr_type, ...);
Create a new GP11Attributes array.
The arguments must be triples of: attribute type, data type, value
The variable argument list should contain:
a) |
The gulong attribute type (ie: CKA_LABEL). |
b) |
The attribute data type (one of GP11_BOOLEAN, GP11_ULONG, GP11_STRING, GP11_DATE) orthe raw attribute value length. |
c) |
The attribute value, either a gboolean, gulong, gchar*, GDate* or a pointer to a raw attribute value. |
The variable argument list should be terminated with GP11_INVALID.
|
|
|
|
Returns : |
The new attributes array. When done with the array
release it with gp11_attributes_unref() .
|
GP11Attributes* gp11_attributes_new_valist (va_list va);
|
|
Returns : |
void gp11_attributes_set_immutable (GP11Attributes *attrs);
|
gboolean gp11_attributes_is_immutable (GP11Attributes *attrs);
|
|
Returns : |
GP11Attribute* gp11_attributes_at (GP11Attributes *attrs, guint index);
Get attribute at the specified index in the attribute array.
Use gp11_attributes_count()
to determine how many attributes are
in the array.
|
The attributes array. |
|
The attribute index to retrieve. |
Returns : |
The specified attribute. |
void gp11_attributes_add (GP11Attributes *attrs, GP11Attribute *attr);
Add the specified attribute to the array.
The value stored in the attribute will be copied.
|
The attributes array to add to |
|
The attribute to add. |
void gp11_attributes_add_data (GP11Attributes *attrs, gulong attr_type, gconstpointer value, gsize length);
Add an attribute with the specified type and value to the array.
The value stored in the attribute will be copied.
|
The attributes array to add to. |
|
The type of attribute to add. |
|
The raw memory of the attribute value. |
|
The length of the attribute value. |
void gp11_attributes_add_invalid (GP11Attributes *attrs, gulong attr_type);
Add an attribute with the specified type and an 'invalid' value to the array.
|
The attributes array to add to. |
|
The type of attribute to add. |
void gp11_attributes_add_boolean (GP11Attributes *attrs, gulong attr_type, gboolean value);
Add an attribute with the specified type and value to the array.
The value will be stored as a CK_BBOOL PKCS11 style attribute.
|
The attributes array to add to. |
|
The type of attribute to add. |
|
The boolean value to add. |
void gp11_attributes_add_string (GP11Attributes *attrs, gulong attr_type, const gchar *string);
Add an attribute with the specified type and value to the array.
The value will be copied into the attribute.
|
The attributes array to add to. |
|
The type of attribute to add. |
|
void gp11_attributes_add_date (GP11Attributes *attrs, gulong attr_type, const GDate *date);
Add an attribute with the specified type and value to the array.
The value will be stored as a CK_DATE PKCS11 style attribute.
|
The attributes array to add to. |
|
The type of attribute to add. |
|
void gp11_attributes_add_ulong (GP11Attributes *attrs, gulong attr_type, gulong value);
Add an attribute with the specified type and value to the array.
The value will be stored as a CK_ULONG PKCS11 style attribute.
|
The attributes array to add to. |
|
The type of attribute to add. |
|
The gulong value to add. |
GP11Attribute* gp11_attributes_find (GP11Attributes *attrs, gulong attr_type);
Find an attribute with the specified type in the array.
|
The attributes array to search. |
|
The type of attribute to find. |
Returns : |
The first attribute found with the specified type, or NULL. |
gboolean gp11_attributes_find_boolean (GP11Attributes *attrs, gulong attr_type, gboolean *value);
Find an attribute with the specified type in the array.
The attribute (if found) must be of the right size to store a boolean value (ie: CK_BBOOL). If the attribute is marked invalid then it will be treated as not found.
|
The attributes array to search. |
|
The type of attribute to find. |
|
The resulting gboolean value. |
Returns : |
Whether a value was found or not. |
gboolean gp11_attributes_find_ulong (GP11Attributes *attrs, gulong attr_type, gulong *value);
Find an attribute with the specified type in the array.
The attribute (if found) must be of the right size to store a unsigned long value (ie: CK_ULONG). If the attribute is marked invalid then it will be treated as not found.
|
The attributes array to search. |
|
The type of attribute to find. |
|
The resulting gulong value. |
Returns : |
Whether a value was found or not. |
gboolean gp11_attributes_find_string (GP11Attributes *attrs, gulong attr_type, gchar **value);
Find an attribute with the specified type in the array.
If the attribute is marked invalid then it will be treated as not found.
The resulting string will be null-terminated, and must be freed by the caller
using g_free()
.
|
The attributes array to search. |
|
The type of attribute to find. |
|
The resulting string value. |
Returns : |
Whether a value was found or not. |
gboolean gp11_attributes_find_date (GP11Attributes *attrs, gulong attr_type, GDate *value);
Find an attribute with the specified type in the array.
The attribute (if found) must be of the right size to store a date value (ie: CK_DATE). If the attribute is marked invalid then it will be treated as not found.
|
The attributes array to search. |
|
The type of attribute to find. |
|
The resulting GDate value. |
Returns : |
Whether a value was found or not. |
gulong gp11_attributes_count (GP11Attributes *attrs);
Get the number of attributes in this attribute array.
|
The attributes array to count. |
Returns : |
The number of contained attributes. |
GP11Attributes* gp11_attributes_ref (GP11Attributes *attrs);
Reference this attributes array.
|
An attribute array |
Returns : |
void gp11_attributes_unref (GP11Attributes *attrs);
Unreference this attribute array.
When all outstanding references are NULL, the array will be freed.
|
An attribute array |
typedef struct { guint8 pkcs11_version_major; guint8 pkcs11_version_minor; gchar *manufacturer_id; gulong flags; gchar *library_description; guint8 library_version_major; guint8 library_version_minor; } GP11ModuleInfo;
void gp11_module_info_free (GP11ModuleInfo *module_info);
Free a GP11ModuleInfo structure.
|
The module info to free, or NULL. |
GP11Module* gp11_module_initialize (const gchar *path, gpointer reserved, GError **err);
Load and initialize a PKCS11 module represented by a GP11Module object.
|
The file system path to the PKCS11 module to load. |
|
Extra arguments for the PKCS11 module, should usually be NULL. |
|
A location to store an error resulting from a failed load. |
Returns : |
The loaded PKCS11 module or NULL if failed. |
GP11ModuleInfo* gp11_module_get_info (GP11Module *module);
Get the info about a PKCS11 module.
|
The module to get info for. |
Returns : |
The module info. Release this with gp11_module_info_free() .
|
GList* gp11_module_get_slots (GP11Module *module, gboolean token_present);
Get the GP11Slot objects for a given module.
|
The module for which to get the slots. |
|
Whether to limit only to slots with a token present. |
Returns : |
The possibly empty list of slots. Release this with gp11_list_unref_free() .
|
typedef struct { gchar *slot_description; gchar *manufacturer_id; gulong flags; guint8 hardware_version_major; guint8 hardware_version_minor; guint8 firmware_version_major; guint8 firmware_version_minor; } GP11SlotInfo;
void gp11_slot_info_free (GP11SlotInfo *slot_info);
Free the GP11SlotInfo and associated resources.
|
The slot info to free, or NULL. |
typedef struct { gchar *label; gchar *manufacturer_id; gchar *model; gchar *serial_number; gulong flags; glong max_session_count; glong session_count; glong max_rw_session_count; glong rw_session_count; glong max_pin_len; glong min_pin_len; glong total_public_memory; glong free_public_memory; glong total_private_memory; glong free_private_memory; guint8 hardware_version_major; guint8 hardware_version_minor; guint8 firmware_version_major; guint8 firmware_version_minor; gint64 utc_time; } GP11TokenInfo;
void gp11_token_info_free (GP11TokenInfo *token_info);
Free the GP11TokenInfo and associated resources.
|
The token info to free, or NULL. |
typedef struct { gulong min_key_size; gulong max_key_size; gulong flags; } GP11MechanismInfo;
void gp11_mechanism_info_free (GP11MechanismInfo *mech_info);
Free the GP11MechanismInfo and associated resources.
|
The mechanism info to free, or NULL. |
#define gp11_mechanisms_at(a, i) (g_array_index(a, CK_MECHANISM_TYPE, i))
|
|
|
#define GP11_SLOT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GP11_TYPE_SLOT, GP11Slot))
|
#define GP11_SLOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GP11_TYPE_SLOT, GP11Slot))
|
#define GP11_IS_SLOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GP11_TYPE_SLOT))
|
#define GP11_SLOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GP11_TYPE_SLOT, GP11SlotClass))
|
CK_SLOT_ID gp11_slot_get_handle (GP11Slot *slot);
Get the raw PKCS11 handle of a slot.
|
The slot to get the handle of. |
Returns : |
The raw handle. |
gboolean gp11_slot_get_reuse_sessions (GP11Slot *slot);
Get the reuse sessions setting. When this is set, sessions
will be pooled and reused if their flags match when
gp11_slot_open_session()
is called.
|
The slot to get setting from. |
Returns : |
Whether reusing sessions or not. |
void gp11_slot_set_reuse_sessions (GP11Slot *slot, gboolean reuse);
When this is set, sessions will be pooled and reused
if their flags match when gp11_slot_open_session()
is called.
|
The slot to set the setting on. |
|
Whether to reuse sessions or not. |
gboolean gp11_slot_get_auto_login (GP11Slot *slot);
Get the auto login setting. When this is set, this slot will emit the 'authenticate-token' signal when a session requires authentication.
|
The slot to get setting from. |
Returns : |
Whether auto login or not. |
void gp11_slot_set_auto_login (GP11Slot *slot, gboolean auto_login);
When this is set, this slot will emit the 'authenticate-token' signal when a session requires authentication.
|
The slot to set the setting on. |
|
Whether auto login or not. |
gint gp11_slot_get_max_pin_length (GP11Slot *slot);
|
|
Returns : |
GP11SlotInfo* gp11_slot_get_info (GP11Slot *slot);
Get the information for this slot.
|
The slot to get info for. |
Returns : |
The slot information. When done, use gp11_slot_info_free()
to release it.
|
GP11TokenInfo* gp11_slot_get_token_info (GP11Slot *slot);
Get the token information for this slot.
|
The slot to get info for. |
Returns : |
The token information. When done, use gp11_token_info_free()
to release it.
|
GP11Mechanisms* gp11_slot_get_mechanisms (GP11Slot *slot);
Get the available mechanisms for this slot.
|
The slot to get mechanisms for. |
Returns : |
A list of the mechanisms for this slot. Use
gp11_mechanisms_free() when done with this.
|
GP11MechanismInfo* gp11_slot_get_mechanism_info (GP11Slot *slot, gulong mech_type);
Get information for the specified mechanism.
|
The slot to get mechanism info from. |
|
The mechanisms type to get info for. |
Returns : |
The mechanism information, or NULL if failed. Use
gp11_mechanism_info_free() when done with it.
|
gboolean gp11_slot_init_token (GP11Slot *slot, const guchar *pin, gsize length, const gchar *label, GError **err);
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_slot_init_token_async (GP11Slot *slot, const guchar *pin, gsize length, const gchar *label, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
gboolean gp11_slot_init_token_finish (GP11Slot *slot, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GP11Session* gp11_slot_open_session (GP11Slot *slot, gulong flags, GError **err);
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.
|
The slot ot open a session on. |
|
The flags to open a session with. |
|
A location to return an error, or NULL. |
Returns : |
A new session or NULL if an error occurs. |
GP11Session* gp11_slot_open_session_full (GP11Slot *slot, gulong flags, GCancellable *cancellable, GError **err);
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.
|
The slot to open a session on. |
|
The flags to open a session with. |
|
Optional cancellation object, or NULL. |
|
A location to return an error, or NULL. |
Returns : |
A new session or NULL if an error occurs. |
void gp11_slot_open_session_async (GP11Slot *slot, gulong flags, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
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.
|
The slot to open a session on. |
|
The flags to open a session with. |
|
Optional cancellation object, or NULL. |
|
Called when the operation completes. |
|
Data to pass to the callback. |
GP11Session* gp11_slot_open_session_finish (GP11Slot *slot, GAsyncResult *result, GError **err);
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.
|
The slot to open a session on. |
|
The result passed to the callback. |
|
A location to return an error or NULL. |
Returns : |
The new session or NULL if an error occurs. |
typedef struct { gulong slot_id; gulong state; gulong flags; gulong device_error; } GP11SessionInfo;
void gp11_session_info_free (GP11SessionInfo *session_info);
Free the GP11SessionInfo structure and all associated memory.
|
Session info to free. |
#define GP11_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GP11_TYPE_SESSION, GP11Session))
|
#define GP11_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GP11_TYPE_SESSION, GP11Session))
|
#define GP11_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GP11_TYPE_SESSION))
|
#define GP11_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GP11_TYPE_SESSION))
|
#define GP11_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GP11_TYPE_SESSION, GP11SessionClass))
|
GP11Session* gp11_session_from_handle (GP11Slot *slot, CK_SESSION_HANDLE handle);
Initialize a GP11Session object from a raw PKCS11 session handle.
Usually one would use the gp11_slot_open_session()
function to
create a session.
|
The slot which the session belongs to. |
|
The raw PKCS11 handle of the session. |
Returns : |
The new GP11Session object. |
CK_SESSION_HANDLE gp11_session_get_handle (GP11Session *session);
Get the raw PKCS11 session handle from a GP11Session object.
|
The session object. |
Returns : |
The raw session handle. |
GP11SessionInfo* gp11_session_get_info (GP11Session *session);
Get information about the session.
|
The session object. |
Returns : |
The session info. Use the gp11_session_info_free() to release
when done.
|
gboolean gp11_session_init_pin (GP11Session *session, const guchar *pin, gsize n_pin, GError **err);
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_init_pin_async (GP11Session *session, const guchar *pin, gsize n_pin, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
gboolean gp11_session_init_pin_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
gboolean gp11_session_set_pin (GP11Session *session, const guchar *old_pin, gsize n_old_pin, const guchar *new_pin, gsize n_new_pin, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_set_pin_async (GP11Session *session, const guchar *old_pin, gsize n_old_pin, const guchar *new_pin, gsize n_new_pin, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
gboolean gp11_session_set_pin_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_get_operation_state (GP11Session *session, gsize *n_result, GError **err);
|
|
|
|
|
|
Returns : |
void gp11_session_get_operation_state_async (GP11Session *session, gsize *n_result, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
guchar* gp11_session_get_operation_state_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
gboolean gp11_session_set_operation_state (GP11Session *session, const guchar *state, gsize n_state, GError **err);
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_set_operation_state_async (GP11Session *session, const guchar *state, gsize n_state, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
gboolean gp11_session_set_operation_state_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
gboolean gp11_session_login (GP11Session *session, gulong user_type, const guchar *pin, gsize n_pin, GError **err);
Login the user on the session. This call may block for an indefinite period.
|
Log into this session. |
|
The type of login user. |
|
The user's PIN, or NULL for protected authentication path. |
|
The length of the PIN. |
|
A location to return an error. |
Returns : |
Whether successful or not. |
gboolean gp11_session_login_full (GP11Session *session, gulong user_type, const guchar *pin, gsize n_pin, GCancellable *cancellable, GError **err);
Login the user on the session. This call may block for an indefinite period.
|
Log into this session. |
|
The type of login user. |
|
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 gp11_session_login_async (GP11Session *session, 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 into this session. |
|
The type of login user. |
|
The user's 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 gp11_session_login_finish (GP11Session *session, GAsyncResult *result, GError **err);
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 gp11_session_logout (GP11Session *session, GError **err);
Log out of the session. This call may block for an indefinite period.
|
Logout of this session. |
|
A location to return an error. |
Returns : |
Whether the logout was successful or not. |
gboolean gp11_session_logout_full (GP11Session *session, GCancellable *cancellable, GError **err);
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 gp11_session_logout_async (GP11Session *session, 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 gp11_session_logout_finish (GP11Session *session, GAsyncResult *result, GError **err);
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. |
GP11Object* gp11_session_create_object (GP11Session *session, GError **err, ...);
Create a new PKCS11 object. This call may block for an indefinite period.
The arguments must be triples of: attribute type, data type, value
The variable argument list should contain:
a) |
The gulong attribute type (ie: CKA_LABEL). |
b) |
The attribute data type (one of GP11_BOOLEAN, GP11_ULONG, GP11_STRING, GP11_DATE) orthe raw attribute value length. |
c) |
The attribute value, either a gboolean, gulong, gchar*, GDate* or a pointer to a raw attribute value. |
The variable argument list should be terminated with GP11_INVALID.
|
The session to create the object on. |
|
A location to store an error. ...: The attributes to create the new object with. |
|
|
Returns : |
The newly created object, or NULL if an error occurred. |
GP11Object* gp11_session_create_object_full (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GError **err);
Create a new PKCS11 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. |
void gp11_session_create_object_async (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Create a new PKCS11 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. |
GP11Object* gp11_session_create_object_finish (GP11Session *session, GAsyncResult *result, GError **err);
Get the result of creating a new PKCS11 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. |
GList* gp11_session_find_objects (GP11Session *session, GError **err, ...);
Find objects matching the passed attributes. This call may block for an indefinite period.
The arguments must be triples of: attribute type, data type, value
The variable argument list should contain:
a) |
The gulong attribute type (ie: CKA_LABEL). |
b) |
The attribute data type (one of GP11_BOOLEAN, GP11_ULONG, GP11_STRING, GP11_DATE) orthe raw attribute value length. |
c) |
The attribute value, either a gboolean, gulong, gchar*, GDate* or a pointer to a raw attribute value. |
The variable argument list should be terminated with GP11_INVALID.
|
The session to find objects on. |
|
A location to return an error or NULL. ...: The attributes to match. |
|
|
Returns : |
A list of the matching objects, which may be empty. |
GList* gp11_session_find_objects_full (GP11Session *session, GP11Attributes *attrs, GCancellable *cancellable, GError **err);
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. |
void gp11_session_find_objects_async (GP11Session *session, GP11Attributes *attrs, 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* gp11_session_find_objects_finish (GP11Session *session, GAsyncResult *result, GError **err);
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. |
GP11Object* gp11_session_generate_key (GP11Session *session, GP11Mechanism *mechanism, GError **err, ...);
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_generate_key_async (GP11Session *session, GP11Mechanism *mechanism, GAsyncReadyCallback callback, gpointer user_data, ...);
|
|
|
|
|
|
|
|
|
GP11Object* gp11_session_generate_key_finish (GP11Session *session, GAsyncResult *result, GError **err, ...);
|
|
|
|
|
|
|
|
Returns : |
gboolean gp11_session_generate_key_pair (GP11Session *session, GP11Mechanism *mechanism, GP11Object **public_key, GP11Object **private_key, GError **err, ...);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_generate_key_pair_async (GP11Session *session, GP11Mechanism *mechanism, GAsyncReadyCallback callback, gpointer user_data, ...);
|
|
|
|
|
|
|
|
|
gboolean gp11_session_generate_key_pair_finish (GP11Session *session, GAsyncResult *result, GP11Object **public_key, GP11Object **private_key, GError **err, ...);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean gp11_session_seed_random (GP11Session *session, const guchar *seed, gsize n_seed, GError **err);
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_seed_random_async (GP11Session *session, const guchar *seed, gsize n_seed, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
gboolean gp11_session_seed_random_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_generate_random (GP11Session *session, gsize n_random, GError **err);
|
|
|
|
|
|
Returns : |
void gp11_session_generate_random_async (GP11Session *session, gsize n_random, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
guchar* gp11_session_generate_random_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_encrypt (GP11Session *session, GP11Object *key, gulong mech, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_encrypt_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_encrypt_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_encrypt (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_encrypt_finish (GP11Session *session, GP11Object *key, GAsyncResult *result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_decrypt (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_decrypt_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_decrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_decrypt_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_decrypt (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_decrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_decrypt_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_digest (GP11Session *session, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_digest_full (GP11Session *session, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_digest_async (GP11Session *session, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_digest_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_digest (GP11Session *session, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_digest_async (GP11Session *session, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_digest_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_digest_encrypt (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_digest_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_digest_encrypt_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_digest_decrypt (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *decrypt_mech, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_digest_decrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *digest_mech, GP11Mechanism *decrypt_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_digest_decrypt_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_decrypt_verify (GP11Session *session, GP11Object *key, GP11Mechanism *decrypt_mech, GP11Mechanism *verify_mech, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_decrypt_verify_async (GP11Session *session, GP11Object *key, GP11Mechanism *decrypt_mech, GP11Mechanism *verify_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_decrypt_verify_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_sign (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_sign_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_sign_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_sign_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_sign (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_sign_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_sign_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GP11Processor* gp11_session_batch_sign_encrypt (GP11Session *session, GP11Object *key, GP11Mechanism *sign_mech, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_sign_encrypt_async (GP11Session *session, GP11Object *key, GP11Mechanism *sign_mechanism, GP11Mechanism *encrypt_mech, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
GP11Processor* gp11_session_batch_sign_encrypt_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_sign_recover (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_sign_recover_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_sign_recover_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_sign_recover_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
gboolean gp11_session_verify (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, const guchar *signature, gsize n_signature, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean gp11_session_verify_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, const guchar *signature, gsize n_signature, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_verify_async (GP11Session *session, GP11Object *key, GP11Mechanism *mechanism, const guchar *input, gsize n_input, const guchar *signature, gsize n_signature, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gboolean gp11_session_verify_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GkrProcessor* gp11_session_batch_verify (GP11Session *session, GP11Object *key, GP11Mechanism *mech_type, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_batch_verify_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GkrProcessor* gp11_session_batch_verify_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_session_verify_recover (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_verify_recover_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, gsize *n_result, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_verify_recover_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_verify_recover_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_session_wrap (GP11Session *session, GP11Object *key, gulong mech_type, GP11Object *wrapped_key, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_wrap_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GP11Object *wrapped_key, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
guchar* gp11_session_wrap_finish (GP11Session *session, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
GP11Object* gp11_session_unwrap (GP11Session *session, GP11Object *key, gulong mech_type, const guchar *input, gsize n_input, GError **err, ...);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_unwrap_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, const guchar *input, gsize n_input, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GP11Object* gp11_session_unwrap_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
GP11Object* gp11_session_derive (GP11Session *session, GP11Object *key, gulong mech_type, GError **err, ...);
|
|
|
|
|
|
|
|
|
|
Returns : |
GP11Object* gp11_session_derive_full (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GError **err, ...);
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_session_derive_async (GP11Session *session, GP11Object *key, GP11Mechanism *mech_args, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
|
|
GP11Object* gp11_session_derive_finish (GP11Session *session, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
#define GP11_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GP11_TYPE_OBJECT, GP11Object))
|
#define GP11_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GP11_TYPE_OBJECT, GP11Object))
|
#define GP11_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GP11_TYPE_OBJECT))
|
#define GP11_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GP11_TYPE_OBJECT))
|
#define GP11_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GP11_TYPE_OBJECT, GP11ObjectClass))
|
GP11Object* gp11_object_from_handle (GP11Session *session, CK_OBJECT_HANDLE handle);
Initialize a GP11Object from a raw PKCS11 handle. Normally you would use
gp11_session_create_object()
or gp11_session_find_objects()
to access objects.
|
The session on which this object is available. |
|
The raw handle of the object. |
Returns : |
The new GP11Object. You should use g_object_unref() when done with this object.
|
GList* gp11_objects_from_handle_array (GP11Session *session, const GP11Attribute *attr);
Initialize a list of GP11Object from raw PKCS11 handles contained inside of an attribute. The attribute must contain contiguous CK_OBJECT_HANDLE handles in an array.
|
The session on which these objects are available. |
|
The raw object handles, contained in an attribute. |
Returns : |
The list of GP11Object. You should use gp11_list_unref_free() when done with
this list.
|
CK_OBJECT_HANDLE gp11_object_get_handle (GP11Object *object);
Get the raw PKCS11 handle of a GP11Object.
|
The object. |
Returns : |
The raw object handle. |
GP11Object* gp11_object_copy (GP11Object *object, GError **err);
|
|
|
|
Returns : |
GP11Object* gp11_object_copy_full (GP11Object *object, GP11Attributes *additional, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
Returns : |
void gp11_object_copy_async (GP11Object *object, GP11Attributes *additional, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
GP11Object* gp11_object_copy_finish (GP11Object *object, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
gboolean gp11_object_destroy (GP11Object *object, GError **err);
Destroy a PKCS11 object, deleting it from storage or the session. This call may block for an indefinite period.
|
The object to destroy. |
|
A location to return an error. |
Returns : |
Whether the call was successful or not. |
gboolean gp11_object_destroy_full (GP11Object *object, GCancellable *cancellable, GError **err);
Destroy a PKCS11 object, deleting it from storage or the session. This call may block for an indefinite period.
|
The object to destroy. |
|
Optional cancellable object, or NULL to ignore. |
|
A location to return an error. |
Returns : |
Whether the call was successful or not. |
void gp11_object_destroy_async (GP11Object *object, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Destroy a PKCS11 object, deleting it from storage or the session. This call will return immediately and complete asynchronously.
|
The object to destroy. |
|
Optional cancellable object, or NULL to ignore. |
|
Callback which is called when operation completes. |
|
Data to pass to the callback. |
gboolean gp11_object_destroy_finish (GP11Object *object, GAsyncResult *result, GError **err);
Get the status of the operation to destroy a PKCS11 object, begun with
gp11_object_destroy_async()
.
|
The object being destroyed. |
|
The result of the destory operation passed to the callback. |
|
A location to store an error. |
Returns : |
Whether the object was destroyed successfully or not. |
gssize gp11_object_get_size (GP11Object *object, GError **err);
|
|
|
|
Returns : |
gssize gp11_object_get_size_full (GP11Object *object, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
Returns : |
void gp11_object_get_size_async (GP11Object *object, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
gssize gp11_object_get_size_finish (GP11Object *object, GAsyncResult *result, GError **err);
|
|
|
|
|
|
Returns : |
gboolean gp11_object_set (GP11Object *object, GError **err, ...);
Set PKCS11 attributes on an object. This call may block for an indefinite period.
The arguments must be triples of: attribute type, data type, value
The variable argument list should contain:
a) |
The gulong attribute type (ie: CKA_LABEL). |
b) |
The attribute data type (one of GP11_BOOLEAN, GP11_ULONG, GP11_STRING, GP11_DATE) orthe raw attribute value length. |
c) |
The attribute value, either a gboolean, gulong, gchar*, GDate* or a pointer to a raw attribute value. |
The variable argument list should be terminated with GP11_INVALID.
|
The object to set attributes on. |
|
A location to return an error. ...: The attributes to set. |
|
|
Returns : |
Whether the call was successful or not. |
gboolean gp11_object_set_full (GP11Object *object, GP11Attributes *attrs, GCancellable *cancellable, GError **err);
Set PKCS11 attributes on an object. This call may block for an indefinite period.
|
The object to set attributes on. |
|
The attributes to set on the object. |
|
Optional cancellable object, or NULL to ignore. |
|
A location to return an error. |
Returns : |
Whether the call was successful or not. |
void gp11_object_set_async (GP11Object *object, GP11Attributes *attrs, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Set PKCS11 attributes on an object. This call will return immediately and completes asynchronously.
|
The object to set attributes on. |
|
The attributes to set on the object. |
|
Optional cancellable object, or NULL to ignore. |
|
Callback which is called when operation completes. |
|
Data to pass to the callback. |
gboolean gp11_object_set_finish (GP11Object *object, GAsyncResult *result, GError **err);
Get the status of the operation to set attributes on a PKCS11 object,
begun with gp11_object_set_async()
.
|
The object to set attributes on. |
|
The result of the destory operation passed to the callback. |
|
A location to store an error. |
Returns : |
Whether the attributes were successfully set on the object or not. |
GP11Attributes* gp11_object_get (GP11Object *object, GError **err, ...);
Get the specified attributes from the object. This call may block for an indefinite period.
Note that the returned attributes are not required to be in the order they were requested.
|
The object to get attributes from. |
|
A location to store an error. |
|
|
Returns : |
The resulting PKCS11 attributes, or NULL if an error occurred. |
GP11Attributes* gp11_object_get_full (GP11Object *object, const gulong *attr_types, gsize n_attr_types, GCancellable *cancellable, GError **err);
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_object_get_async (GP11Object *object, const gulong *attr_types, gsize n_attr_types, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Get the specified attributes from the object. This call returns immediately and completes asynchronously.
|
The object to get attributes from. |
|
The attributes to get. |
|
The number of attributes to get. |
|
Optional cancellation object, or NULL. |
|
A callback which is called when the operation completes. |
|
Data to be passed to the callback. |
GP11Attributes* gp11_object_get_finish (GP11Object *object, GAsyncResult *result, GError **err);
Get the result of a get operation and return specified attributes from the object.
Note that the returned attributes are not required to be in the order they were requested.
|
The object to get attributes from. |
|
The result passed to the callback. |
|
A location to store an error. |
Returns : |
The resulting PKCS11 attributes, or NULL if an error occurred. |
GP11Attribute* gp11_object_get_one (GP11Object *object, gulong attr_type, GError **err);
Get the specified attribute from the object. This call may block for an indefinite period.
|
The object to get an attribute from. |
|
The attribute to get. |
|
A location to store an error. |
Returns : |
The resulting PKCS11 attribute, or NULL if an error occurred. |
GP11Attribute* gp11_object_get_one_full (GP11Object *object, gulong attr_type, GCancellable *cancellable, GError **err);
Get the specified attribute from the object. This call may block for an indefinite period.
|
The object to get an attribute from. |
|
The attribute to get. |
|
Optional cancellation object, or NULL. |
|
A location to store an error. |
Returns : |
The resulting PKCS11 attribute, or NULL if an error occurred. |
void gp11_object_get_one_async (GP11Object *object, gulong attr_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
Get the specified attribute from the object. This call will return immediately and complete asynchronously.
|
The object to get an attribute from. |
|
The attribute to get. |
|
Optional cancellation object, or NULL. |
|
Called when the operation completes. |
|
Data to be passed to the callback. |
GP11Attribute* gp11_object_get_one_finish (GP11Object *object, GAsyncResult *result, GError **err);
Get the result of an operation to get an attribute from an object.
|
The object to get an attribute from. |
|
The result passed to the callback. |
|
A location to store an error. |
Returns : |
The PKCS11 attribute or NULL if an error occurred. |
guchar* gp11_processor_step (GP11Processor *processor, const guchar *input, gsize n_input, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
|
|
Returns : |
void gp11_processor_step_async (GP11Processor *processor, const guchar *input, gsize n_input, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
guchar* gp11_processor_step_finish (GP11Processor *processor, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
guchar* gp11_processor_close (GP11Processor *processor, gsize *n_result, GError **err);
|
|
|
|
|
|
Returns : |
guchar* gp11_processor_close_async (GP11Processor *processor, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
Returns : |
guchar* gp11_processor_close_finish (GP11Processor *processor, GAsyncResult *result, gsize *n_result, GError **err);
|
|
|
|
|
|
|
|
Returns : |
"module-path"
property"module-path" gchar* : Read / Write / Construct Only
Path to the PKCS11 Module.
Default value: NULL
"auto-login"
property"auto-login" gboolean : Read / Write
Auto Login to Token when necessary.
Default value: FALSE
"handle"
property"handle" guint : Read / Write / Construct Only
PKCS11 Slot ID.
Default value: 0
"reuse-sessions"
property"reuse-sessions" gboolean : Read / Write
Reuse sessions?.
Default value: FALSE
"handle"
property"handle" guint : Read / Write / Construct Only
PKCS11 Session Handle.
Default value: 0
"handle"
property"handle" guint : Read / Write / Construct Only
PKCS11 Object Handle.
Default value: 0
"authenticate-token"
signalgboolean user_function (GP11Slot *gp11slot, gpointer arg1, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
Returns : |
"discard-handle"
signalvoid user_function (GP11Session *gp11session, gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |