Attribute
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "gck_attribute_get_type ()" ) ]
[ Compact ]
public class Attribute
This structure represents a PKCS#11 `CK_ATTRIBUTE`.
These attributes contain information about a PKCS#11 object. Use [methodObject.get
] or [methodObject.set
] to
set and attributes on an object.
Although you are free to allocate a `GckAttribute` in your own code, no functions in this library will operate on such an attribute.
Content:
Creation methods:
- public Attribute (ulong attr_type, uint8 value, size_t length)
Create a new PKCS#11 attribute.
- public Attribute.boolean (ulong attr_type, bool value)
Initialize a PKCS#11 attribute to boolean.
- public Attribute.date (ulong attr_type, Date value)
Initialize a PKCS#11 attribute to a date.
- public Attribute.empty (ulong attr_type)
Create a new PKCS#11 attribute with empty data.
- public Attribute.invalid (ulong attr_type)
Create a new PKCS#11 attribute as 'invalid' or 'not found' state.
- public Attribute.string (ulong attr_type, string value)
Initialize a PKCS#11 attribute to a string.
- public Attribute.ulong (ulong attr_type, ulong value)
Initialize a PKCS#11 attribute to a unsigned long.
Methods:
- public void clear ()
Clear allocated memory held by a Attribute.
- public void dump ()
Dump the specified attribute using printerr
.
- public Attribute dup ()
Duplicate the PKCS#11 attribute.
- public bool equal (Attribute attr2)
Compare two attributes.
- public void free ()
Free an attribute and its allocated memory.
- public bool get_boolean ()
Get the CK_BBOOL of a PKCS#11 attribute.
- public unowned uint8[] get_data ()
Get the raw value in the attribute.
- public void get_date (Date value)
Get the CK_DATE of a PKCS#11 attribute.
- public string? get_string ()
Get the string value of a PKCS#11 attribute.
- public ulong get_ulong ()
Get the CK_ULONG value of a PKCS#11 attribute.
- public uint hash ()
Hash an attribute for use in GHashTable
keys.
- public void init_copy (Attribute src)
Initialize a PKCS#11 attribute as a copy of another attribute.
- public bool is_invalid ()
Check if the PKCS#11 attribute represents 'invalid' or 'not found'
according to the PKCS#11 spec.
Fields: