I am using a smartcard with JCOP 4.7 Java applet on it. I want to create an authentication object, for example a UserID. The writeUserID command Has the below arguments: CLA, INS, P1, P2, Lc, TLV[TAG_POLICY], TLV[TAG_MAX_ATTEMPTS], TLV[TAG_1], TLV[TAG_2].
I know TLV takes TAG, LENGTH and VALUE arguments. My question is How can I get bytes for TLV[TAG_MAX_ATTEMPTS] if I want to set maximum number of attempts to to 3 for USERID that I am creating?
[TAG_MAX_ATTEMPTS] has a value 0x12 and the applet description document says it takes 2-byte maximum number of attempts. In this case what would be my APDU byte for TLV[TAG_MAX_ATTEMPTS]?
For example: I know that TLV[TAG_1] is a 4-byte object identifier then its corresponding byte would be "41047FFF0001" where "41" is the value for [TAG_1] "04" is Length and "7FFF0001" is the 4-byte object identifier.
As per my understanding I am giving "12020003" where "12" is value of [TAG_MAX_ATTEMPTS], "02" length and "0003" 2-byte value.
When I pass this value in my APDU, i get an error "6985" which means conditions not satisfied.
Can someone tell me where am I going wrong?