0

While trying to personalize a card whith a DGI of 256 bytes (including DGI label), tried to split DGI in 2 STORE DATA commands but receive the following error:

Exception in thread "main" javax.smartcardio.CardException: sun.security.smartcardio.PCSCException: Unknown error 0x8010002f
    at java.smartcardio/sun.security.smartcardio.ChannelImpl.doTransmit(ChannelImpl.java:225)
    at java.smartcardio/sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:89)

APDU sent is as follows:

80 E2 08 00 FF 0201FE7081FB9081F8 ... and 246 bytes more to complete 255 bytes of the first STORE command.

Also tried with P1 as 00 with the same results , and also tried with smaller message (100 or 200 bytes) with the same results.

I'm using a PC/SC terminal Identiv uTrust 4701 reader on windows 10.

The program works fine for dgi that fit into 1 message.

My card does not support extended APDU :(.

Any suggestion? Thanks

wrbp
  • 870
  • 1
  • 3
  • 9
  • 80 E2 is probably the command APPEND RECORD. There is no way, which I know of, which allows to append a partial record, with the necessity to update the record size once again with the sercond data part. A card will of course reject the command for a fixed record file if you provide a different one. One possibility is, that your card supports odd instruction UPDATE RECORD to be used with an offset DO or any proprietary solution to achieve this. (Actually this is a reason, that some specifications prefer BINARY files for easier offset operations.) – guidot Aug 15 '21 at 20:59
  • @guidot Acccording to EMV CPS book. 3.2.7.4 If the card does NOT implement extended APDU command data length and the final length of an intended STORE DATA command data field (data grouping(s) and possible MAC) would be more that 255 bytes, then the DGI or grouped DGIs must be sent to the card in multiple STORE DATA commands as follows .... – wrbp Aug 16 '21 at 03:02
  • • The first APDU contains a STORE DATA command according to Table 20, truncated at the maximum allowable length (Lc equals 255 bytes including possible MAC). • The subsequent APDU contains a STORE DATA command with any remaining data as command data, possibly again truncated at the maximum allowable length (Lc less than or equal to 255 bytes including possible MAC). This is what i´m trying to do but it fails. – wrbp Aug 16 '21 at 03:05
  • Have you taken 3.2.7.6 into account and incremented P2 with each STORE DATA command? – ALe Aug 17 '21 at 13:09
  • @Ale Tks, the code is considering that but the exception is thrown at the first STORE DATA command. – wrbp Aug 17 '21 at 15:42

0 Answers0