template_flatten
rc = template_flatten(obj->template, buf + offset);
CK_RV template_flatten(TEMPLATE *, CK_BYTE *);