Attribute list format

The attributes of an object can be the input and the output of a service. The format of the attributes is shown here and applies to all PKCS #11 callable services. For the token record list service, the search_template has the same format as an attribute list. The lengths in the attribute list and attribute structures are unsigned integers.

An attribute_list is a structure in this format:
Number of attributes Attribute Attribute
2 bytes 4 + 2 + length of value bytes 4 + 2 + length of value bytes
Each attribute is a structure in this format:
Attribute name Length of value (n) Value
4 bytes 2 bytes n bytes