The length of the attribute. May be [constINVALID]
if the
attribute is invalid.
The attribute type, such as CKA_LABEL
.
The value of the attribute. May be %NULL.
Clear allocated memory held by a #GckAttribute.
This attribute must have been allocated by a Gck library function, or the results of this method are undefined.
The type of the attribute will remain set.
Dump the specified attribute using g_printerr().
Free an attribute and its allocated memory. These is usually
used with attributes that are allocated by [ctorAttribute
.new]
or a similar function.
Get the CK_BBOOL of a PKCS#11 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.
Get the raw value in the attribute.
This is useful from scripting languages. C callers will generally access the #GckAttribute struct directly.
This function will %NULL if the attribute contains empty or invalid
data. The returned data must not be modified and is only valid
as long as this attribute
.
Get the string value of a PKCS#11 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.
Get the CK_ULONG value of a PKCS#11 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.
Hash an attribute for use in GHashTable
keys.
Check if the PKCS#11 attribute represents 'invalid' or 'not found' according to the PKCS#11 spec. That is, having length of (CK_ULONG)-1.
Initialize a PKCS#11 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 PKCS#11 attribute type to set on the attribute
the null-terminated string value of the 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.