Top |
Functions
GckObject * | gck_object_from_handle () |
GList * | gck_objects_from_handle_array () |
gboolean | gck_object_equal () |
guint | gck_object_hash () |
GckModule * | gck_object_get_module () |
gulong | gck_object_get_handle () |
GckSession * | gck_object_get_session () |
gboolean | gck_object_destroy () |
void | gck_object_destroy_async () |
gboolean | gck_object_destroy_finish () |
gboolean | gck_object_set () |
void | gck_object_set_async () |
gboolean | gck_object_set_finish () |
GckAttributes * | gck_object_get () |
void | gck_object_get_async () |
GckAttributes * | gck_object_get_finish () |
guchar * | gck_object_get_data () |
guchar * | gck_object_get_data_full () |
void | gck_object_get_data_async () |
guchar * | gck_object_get_data_finish () |
GckAttributes * | gck_object_get_full () |
GckAttributes * | gck_object_get_template () |
void | gck_object_get_template_async () |
GckAttributes * | gck_object_get_template_finish () |
gboolean | gck_object_set_template () |
void | gck_object_set_template_async () |
gboolean | gck_object_set_template_finish () |
Properties
gulong | handle | Read / Write / Construct Only |
GckModule * | module | Read / Write / Construct Only |
GckSession * | session | Read / Write / Construct Only |
Description
A GckObject holds a handle to a PKCS11 object such as a key or certificate. Token objects are stored on the token persistently. Others are transient and are called session objects.
Functions
gck_object_from_handle ()
GckObject * gck_object_from_handle (GckSession *session
,gulong object_handle
);
Initialize a GckObject from a raw PKCS#11 handle. Normally you would use
gck_session_create_object()
or gck_session_find_objects()
to access objects.
gck_objects_from_handle_array ()
GList * gck_objects_from_handle_array (GckSession *session
,gulong *object_handles
,gulong n_object_handles
);
Initialize a list of GckObject from raw PKCS#11 handles. The handles argument must contain contiguous CK_OBJECT_HANDLE handles in an array.
Parameters
session |
The session for these objects |
|
object_handles |
The raw object handles. |
[array length=n_object_handles] |
n_object_handles |
The number of raw object handles. |
Returns
The list of GckObject
objects. You should use gck_list_unref_free()
when done with this
list.
[transfer full][element-type Gck.Object]
gck_object_equal ()
gboolean gck_object_equal (gconstpointer object1
,gconstpointer object2
);
Checks equality of two objects. Two GckObject objects can point to the same underlying PKCS#11 object.
gck_object_hash ()
guint
gck_object_hash (gconstpointer object
);
Create a hash value for the GckObject.
This function is intended for easily hashing a GckObject to add to a GHashTable or similar data structure.
gck_object_get_module ()
GckModule *
gck_object_get_module (GckObject *self
);
Get the PKCS#11 module to which this object belongs.
gck_object_get_handle ()
gulong
gck_object_get_handle (GckObject *self
);
Get the raw PKCS#11 handle of a GckObject.
gck_object_get_session ()
GckSession *
gck_object_get_session (GckObject *self
);
Get the PKCS#11 session assigned to make calls on when operating on this object.
This will only return a session if it was set explitly on this object. By default an object will open and close sessions appropriate for its calls.
gck_object_destroy ()
gboolean gck_object_destroy (GckObject *self
,GCancellable *cancellable
,GError **error
);
Destroy a PKCS#11 object, deleting it from storage or the session. This call may block for an indefinite period.
gck_object_destroy_async ()
void gck_object_destroy_async (GckObject *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Destroy a PKCS#11 object, deleting it from storage or the session. This call will return immediately and complete asynchronously.
gck_object_destroy_finish ()
gboolean gck_object_destroy_finish (GckObject *self
,GAsyncResult *result
,GError **error
);
Get the status of the operation to destroy a PKCS#11 object, begun with
gck_object_destroy_async()
.
gck_object_set ()
gboolean gck_object_set (GckObject *self
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Set PKCS#11 attributes on an object. This call may block for an indefinite period.
If the attrs
GckAttributes is floating, it is consumed.
gck_object_set_async ()
void gck_object_set_async (GckObject *self
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Set PKCS#11 attributes on an object. This call will return immediately and completes asynchronously.
If the attrs
GckAttributes is floating, it is consumed.
gck_object_set_finish ()
gboolean gck_object_set_finish (GckObject *self
,GAsyncResult *result
,GError **error
);
Get the status of the operation to set attributes on a PKCS#11 object,
begun with gck_object_set_async()
.
gck_object_get ()
GckAttributes * gck_object_get (GckObject *self
,GCancellable *cancellable
,GError **error
,...
);
Get the specified attributes from the object. This call may block for an indefinite period.
gck_object_get_async ()
void gck_object_get_async (GckObject *self
,const gulong *attr_types
,guint n_attr_types
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Get the specified attributes from the object. The attributes will be cleared
of their current values, and new attributes will be stored. The attributes
should not be accessed in any way except for referencing and unreferencing
them until gck_object_get_finish()
is called.
This call returns immediately and completes asynchronously.
Parameters
self |
The object to get attributes from. |
|
attr_types |
the types of the attributes to get. |
[array length=n_attr_types] |
n_attr_types |
the number of attr_types |
|
cancellable |
optional cancellation object, or |
|
callback |
A callback which is called when the operation completes. |
|
user_data |
Data to be passed to the callback. |
gck_object_get_finish ()
GckAttributes * gck_object_get_finish (GckObject *self
,GAsyncResult *result
,GError **error
);
Get the result of a get operation and return specified attributes from the object.
No extra references are added to the returned attributes pointer.
gck_object_get_data ()
guchar * gck_object_get_data (GckObject *self
,gulong attr_type
,GCancellable *cancellable
,gsize *n_data
,GError **error
);
Get the data for the specified attribute from the object. For convenience the returned data has a null terminator.
This call may block for an indefinite period.
gck_object_get_data_full ()
guchar * gck_object_get_data_full (GckObject *self
,gulong attr_type
,GckAllocator allocator
,GCancellable *cancellable
,gsize *n_data
,GError **error
);
Get the data for the specified attribute from the object. For convenience the returned data has an extra null terminator, not included in the returned length.
This call may block for an indefinite period.
[skip]
Parameters
self |
The object to get attribute data from. |
|
attr_type |
The attribute to get data for. |
|
allocator |
An allocator with which to allocate memory for the data, or NULL for default. |
|
cancellable |
Optional cancellation object, or NULL. |
|
n_data |
The length of the resulting data. |
|
error |
A location to store an error. |
gck_object_get_data_async ()
void gck_object_get_data_async (GckObject *self
,gulong attr_type
,GckAllocator allocator
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Get the data for the specified attribute from the object.
This call will return immediately and complete asynchronously.
Parameters
self |
The object to get attribute data from. |
|
attr_type |
The attribute to get data for. |
|
allocator |
An allocator with which to allocate memory for the data, or NULL for default. |
[skip] |
cancellable |
Optional cancellation object, or NULL. |
|
callback |
Called when the operation completes. |
|
user_data |
Data to be passed to the callback. |
gck_object_get_data_finish ()
guchar * gck_object_get_data_finish (GckObject *self
,GAsyncResult *result
,gsize *n_data
,GError **error
);
Get the result of an operation to get attribute data from an object. For convenience the returned data has an extra null terminator, not included in the returned length.
gck_object_get_full ()
GckAttributes * gck_object_get_full (GckObject *self
,const gulong *attr_types
,guint n_attr_types
,GCancellable *cancellable
,GError **error
);
Get the specified attributes from the object. This call may block for an indefinite period.
No extra references are added to the returned attributes pointer. During this call you may not access the attributes in any way.
gck_object_get_template ()
GckAttributes * gck_object_get_template (GckObject *self
,gulong attr_type
,GCancellable *cancellable
,GError **error
);
Get an attribute template from the object. The attr_type must be for an attribute which returns a template.
This call may block for an indefinite period.
gck_object_get_template_async ()
void gck_object_get_template_async (GckObject *self
,gulong attr_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Get an attribute template from the object. The attr_type must be for an attribute which returns a template.
This call will return immediately and complete asynchronously.
gck_object_get_template_finish ()
GckAttributes * gck_object_get_template_finish (GckObject *self
,GAsyncResult *result
,GError **error
);
Get the result of an operation to get attribute template from an object.
gck_object_set_template ()
gboolean gck_object_set_template (GckObject *self
,gulong attr_type
,GckAttributes *attrs
,GCancellable *cancellable
,GError **error
);
Set an attribute template on the object. The attr_type must be for an attribute which contains a template.
If the attrs
GckAttributes is floating, it is consumed.
This call may block for an indefinite period.
gck_object_set_template_async ()
void gck_object_set_template_async (GckObject *self
,gulong attr_type
,GckAttributes *attrs
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Set an attribute template on the object. The attr_type must be for an attribute which contains a template.
If the attrs
GckAttributes is floating, it is consumed.
This call will return immediately and complete asynchronously.
gck_object_set_template_finish ()
gboolean gck_object_set_template_finish (GckObject *self
,GAsyncResult *result
,GError **error
);
Get the result of an operation to set attribute template on an object.
Types and Values
struct GckObjectClass
struct GckObjectClass { GObjectClass parent; };
The class for a GckObject.
If the attribute_types
field is set by a derived class, then the a
GckEnumerator which has been setup using gck_enumerator_set_object_type()
with this derived type will retrieve these attributes when enumerating. In
this case the class must implement an 'attributes' property of boxed type
GCK_TYPE_ATTRIBUTES.
Property Details
The “handle”
property
“handle” gulong
The raw PKCS11 handle for this object.
Flags: Read / Write / Construct Only
The “module”
property
“module” GckModule *
The GckModule that this object belongs to.
Flags: Read / Write / Construct Only
The “session”
property
“session” GckSession *
The PKCS11 session to make calls on when this object needs to perform operations on itself.
If this is NULL then a new session is opened for each operation,
such as gck_object_get()
, gck_object_set()
or gck_object_destroy()
.
Flags: Read / Write / Construct Only