I am trying to read a smart card and i have been able to get some data from the smart card. The issue i am facing now is how to get the CardHolder name from the smart card.
i have
if(emv_is_tag_present(0x5F20) >=0){
tagDataLength = emv_get_tag_data(0x5F20, tagData, tagData.length);
if(debug)Log.d(APP_TAG, "Carder "+ tagDataLength);
appState.trans.setuserName(StringUtil.toString(AppUtil.removeTailF(ByteUtil.bcdToAscii(tagData,0, tagDataLength))));
}
I do not really know the format to use in getting this field from the card while trying to use 5F20 Cardholder Name Indicates cardholder name according to ISO 7813 Card ans 2-26 '70' or '77' 2 26 primitive which i got from here
This is the output i am getting 3030303030333830D160222101..but, whenever i try to convert that into a String...it gives back 00000380Ñ`"! which is not really the name of the Cardholder.
Reading through the document (which link is posted there), i am not sure if i am using the correct format in getting my data. cos, in the document, i have ans 2-26. I do not really understand what it means.
Tag 5F20 - CARD HOLDER NAME, if CARD returning the value of this tag, value will be hex string - Hex value of ASCII characters , what you need to do is to convert value to string and you will get the value personalized in the card.
in the document, i have ans 2-26. I do not really understand what it means.
sometimes we avoid to personalize card holder name inside the card and then we personalize " /" - space followed by / = 2 char. It is the minimum value for tag 5F20 defined in different EMV specification. Max value is 26 therefore 2-26 used for Tag 5F20.
Hope this information will help you..