|  |  |  | Gck Library Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
GckAttributes; #define GCK_TYPE_ATTRIBUTES GckAttributes * gck_attributes_new (void); GckAttributes * gck_attributes_new_empty (gulong attr_type,...); GckAttribute * gck_attributes_at (GckAttributes *attrs,guint index); GckAttribute * gck_attributes_add (GckAttributes *attrs,GckAttribute *attr); GckAttribute * gck_attributes_add_data (GckAttributes *attrs,gulong attr_type,gconstpointer value,gsize length); GckAttribute * gck_attributes_add_invalid (GckAttributes *attrs,gulong attr_type); GckAttribute * gck_attributes_add_empty (GckAttributes *attrs,gulong attr_type); GckAttribute * gck_attributes_add_boolean (GckAttributes *attrs,gulong attr_type,gboolean value); GckAttribute * gck_attributes_add_string (GckAttributes *attrs,gulong attr_type,const gchar *value); GckAttribute * gck_attributes_add_date (GckAttributes *attrs,gulong attr_type,const GDate *value); GckAttribute * gck_attributes_add_ulong (GckAttributes *attrs,gulong attr_type,gulong value); void gck_attributes_add_all (GckAttributes *attrs,GckAttributes *from); GckAttribute * gck_attributes_find (GckAttributes *attrs,gulong attr_type); gboolean gck_attributes_find_boolean (GckAttributes *attrs,gulong attr_type,gboolean *value); gboolean gck_attributes_find_ulong (GckAttributes *attrs,gulong attr_type,gulong *value); gboolean gck_attributes_find_string (GckAttributes *attrs,gulong attr_type,gchar **value); gboolean gck_attributes_find_date (GckAttributes *attrs,gulong attr_type,GDate *value); gulong gck_attributes_count (GckAttributes *attrs); GckAttributes * gck_attributes_ref (GckAttributes *attrs); void gck_attributes_unref (GckAttributes *attrs); gboolean gck_attributes_contains (GckAttributes *attrs,GckAttribute *match); void gck_attributes_dump (GckAttributes *attrs); GType gck_attributes_get_boxed_type (void); GckAttributes * gck_attributes_new_full (GckAllocator allocator); gpointer (*GckAllocator) (gpointer data,gsize length);
A set of GckAttribute structures. These attributes contain information
about a PKCS11 object. Use gck_object_get() or gck_object_set() to set and retrieve
attributes on an object.
#define GCK_TYPE_ATTRIBUTES (gck_attributes_get_boxed_type ())
Boxed type for GckAttributes
GckAttributes *     gck_attributes_new                  (void);
Create a new GckAttributes array.
| Returns : | The new attributes array. When done with the array
release it with gck_attributes_unref(). | 
GckAttributes * gck_attributes_new_empty (gulong attr_type,...);
Creates an GckAttributes array with empty attributes. The arguments should be values of attribute types, terminated with gck_INVALID.
| 
 | The first attribute type to add as empty. | 
| 
 | The arguments should be values of attribute types, terminated with gck_INVALID. | 
| Returns : | The new attributes array. When done with the array
release it with gck_attributes_unref(). | 
GckAttribute * gck_attributes_at (GckAttributes *attrs,guint index);
Get attribute at the specified index in the attribute array.
Use gck_attributes_count() to determine how many attributes are
in the array.
| 
 | The attributes array. | 
| 
 | The attribute index to retrieve. | 
| Returns : | The specified attribute. | 
GckAttribute * gck_attributes_add (GckAttributes *attrs,GckAttribute *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. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_data (GckAttributes *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. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_invalid (GckAttributes *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. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_empty (GckAttributes *attrs,gulong attr_type);
Add an attribute with the specified type, with empty data.
| 
 | The attributes array to add. | 
| 
 | The type of attribute to add. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_boolean (GckAttributes *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 PKCS#11 style attribute.
| 
 | The attributes array to add to. | 
| 
 | The type of attribute to add. | 
| 
 | The boolean value to add. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_string (GckAttributes *attrs,gulong attr_type,const gchar *value);
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. | 
| 
 | The null terminated string value to add. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_date (GckAttributes *attrs,gulong attr_type,const GDate *value);
Add an attribute with the specified type and value to the array.
The value will be stored as a CK_DATE PKCS#11 style attribute.
| 
 | The attributes array to add to. | 
| 
 | The type of attribute to add. | 
| 
 | The GDate value to add. | 
| Returns : | The attribute that was added. | 
GckAttribute * gck_attributes_add_ulong (GckAttributes *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 PKCS#11 style attribute.
| 
 | The attributes array to add to. | 
| 
 | The type of attribute to add. | 
| 
 | The gulong value to add. | 
| Returns : | The attribute that was added. | 
void gck_attributes_add_all (GckAttributes *attrs,GckAttributes *from);
Add all attributes in from to attrs.
| 
 | A set of attributes | 
| 
 | Attributes to add | 
GckAttribute * gck_attributes_find (GckAttributes *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 gck_attributes_find_boolean (GckAttributes *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 gck_attributes_find_ulong (GckAttributes *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 gck_attributes_find_string (GckAttributes *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 gck_attributes_find_date (GckAttributes *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              gck_attributes_count                (GckAttributes *attrs);
Get the number of attributes in this attribute array.
| 
 | The attributes array to count. | 
| Returns : | The number of contained attributes. | 
GckAttributes *     gck_attributes_ref                  (GckAttributes *attrs);
Reference this attributes array.
| 
 | An attribute array | 
| Returns : | The attributes. | 
void                gck_attributes_unref                (GckAttributes *attrs);
Unreference this attribute array.
When all outstanding references are NULL, the array will be freed.
| 
 | An attribute array | 
gboolean gck_attributes_contains (GckAttributes *attrs,GckAttribute *match);
Check whether the attributes contain a certain attribute.
| 
 | The attributes to check | 
| 
 | The attribute to find | 
| Returns : | TRUEif the attributes contain the attribute. | 
void                gck_attributes_dump                 (GckAttributes *attrs);
Dump the attributes using g_printerr().
| 
 | The attributes | 
GType               gck_attributes_get_boxed_type       (void);
Get the boxed type representing a GckAttributes array.
| Returns : | The boxed type. | 
GckAttributes *     gck_attributes_new_full             (GckAllocator allocator);
Create a new GckAttributes array.
| 
 | Memory allocator for attribute data, or NULL for default. | 
| Returns : | The new attributes array. When done with the array
release it with gck_attributes_unref(). | 
gpointer (*GckAllocator) (gpointer data,gsize length);
An allocator used to allocate data for the attributes in this GckAttributes set.
This is a function that acts like g_realloc. Specifically it frees when length is set to zero, it allocates when data is set to NULL, and it reallocates when both are valid.
| 
 | Memory to allocate or deallocate. | 
| 
 | New length of memory. | 
| Returns : | The allocated memory, or NULL when freeing. |