Request for Reading the CardData and Photo with APDU without using PKCS11

507 views
Skip to first unread message

lchand lak

unread,
Apr 20, 2020, 3:32:06 AM4/20/20
to eid-middl...@googlegroups.com
Hello,

I am new to this Group.  From the Android App, i have to Read the Card Data and Photo.

Without using the PKCS11 library, can we get the actual photo of the card using the Card Reader APDU's and without any Decryption.

From your website, it is mentioned we can get Raw Access of the card with the familiarity of smartcards and ISO-7816.
*  The Card Applet Reference Manual document the APDU commands supported by the card
*  The Card Content document documents the card filesystem, documenting the names and structures of the various EFs on the card.

If not using using PKCS11, if Decryption is required, How to handle the Decryption of the data & Photo on the card.

Thanks in advance.
L. Chand

Frederik Vernelen

unread,
Apr 20, 2020, 3:32:43 AM4/20/20
to lchand lak, eID Middleware Dev
Hello lchand,

The documents you are referring to can be found here:
https://github.com/Fedict/eid-mw/tree/master/doc/sdk/documentation

I'm not sure what you mean by decription, but if you mean parsing of the data you retrieved from the card:

In chapter 6 of the document below, the TLV format of the id and addres files are documented,
as well as a list of tags and encoding of the data.
https://github.com/Fedict/eid-mw/blob/master/doc/sdk/documentation/belgian_electronic_identity_card_content_v2.8.a.pdf

The photo is stored as .jpeg on the card, just read file 4035 (don't forget the chop off the status words (last 2 bytes)), and save it as a binary file.

Wkr,
 Frederik

--
You received this message because you are subscribed to the Google Groups "eID Middleware Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eid-middleware-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eid-middleware-dev/CAG5MVfC4ZPOEDU%3DXNWv2cQaye_%3D6mpf5p%2BgKxLotAFcY9rZprg%40mail.gmail.com.

lchand lak

unread,
Apr 21, 2020, 8:08:42 AM4/21/20
to Frederik Vernelen, eID Middleware Dev
Hi Frederik,

Thank you for your response.

Sorry if am asking the same question.

As i am looking the implementation for Android, Without PKCS11 standard support,  here is it possible to do Pin Verification to extract all the Card details like Card Number, Name, Card Validity ..etc.  

If Pin Verification is not done / not possible,  With Card Reader APDU's still is it possible to get the Card Number, Card Name, National Number and all the card details.

Thank you
L. Chand

Wouter Verhelst

unread,
Apr 21, 2020, 8:16:40 AM4/21/20
to eid-middl...@googlegroups.com
Hi,

Yes, of course; all the data is read from the card, and the PKCS#11 uses APDUs to read the data. Additionally, there is a "GET CARD DATA" command, which allows you to read card number etc data.

The data is stored in files on the card; there is an identity file, an address file, and a photo file. In order to get identity data, you need to read the identity file and then to parse it. The "card content" document tells you which data item is available in which file; the "belpic applet" document tells you how to read files from the card.

Note that this is very low level, and may be complicated if you're not familiar with how smart cards work in general. In that case, I would suggest you talk to someone (e.g., a consultant) who is.

Regards,

lchand lak schreef op di 21-04-2020 om 17:38 [+0530]:

fvernelen

unread,
Apr 21, 2020, 8:33:22 AM4/21/20
to eID Middleware Dev
Hello lchand,

in addition to that, I'd like to mention that it is indeed not needed to verify the PIN in order to read the data files from the card (or to use the getcarddata command).
(They are not PIN protected)

Wkr,
 Frederik

Reply all
Reply to author
Forward
0 new messages