This is a pure cen-xfs thing so having just C++ knowledge is not enough.
All lpszExtra fields of XFS structures are special formatted C strings.
So the correct way to fill lpszExtra field of a xfs capabilities struct is to use double NULL terminated and NULL separated string.
And as all of these fields are key value pairs so the format is:
"key1=value1\0key2=value2\0...\0keyN=valueN\0\0"
Note here "keyX" does NOT mean PINPAD key definition, but the way all XFS lpszExtra field data is formatted so first key_name =-sign key_value.
How you handle those strings are up to you, but I like to use normal newlines instead of '\0' as key-value pair separators and then just convert to/from that to the XFS specific NULL char separated and double NULL terminated format.
That way you can use normal C string methods for manipulation in your own code.
Easy conversion is allocate memory, make copy and swap '\n' to '\0' and '\0' to "\0\0" while copying from C string to XFS and reverse when converting from XFS to C string.
Note this is aplicable only for those lpszExtra fields in XFS structs.