Hello, Mark. Looking at the checking, I see the following validations:
Before we send a request to the card:
If subject_private_key_identifier_length is negative, 0, or more than 3500, fail with 8/2004
If subject_name_length is negative, 0, or more than 400, fail with 8/2004
If extensions_length is more than 1000, fail with 8/2004
If certificate_length is negative, 0, or more than 3500, fail with 8/2004
If any of reserved1_length, reserved2_length, reserved3_length, reserved6_length are non-zero, fail with 8/2004
After we send a request to the card:
If the returned certificate length is larger than certificate_length, fail with 8/2004
Since you are using a label, the subject_private_key_identifier_length must be 64 (as you tried) as all labels are exactly 64 bytes long, left-justified and padded with blanks. Can you send a list of all the parms with any sensitive values redacted?
I'm wondering if one of the lengths is not a 32-bit integer. That is a common cause for the 8/2004 that you are seeing (such as passing a 16-bit integer instead).
------------------------------
Eric Rossman
------------------------------