[Android] Comment récupérer une information simple sur une eID belge ? / How to retrieve a simple data from belgian eID ?

505 views
Skip to first unread message

Fabble

unread,
Nov 7, 2017, 3:09:00 AM11/7/17
to eID Middleware Dev
Bonjour à tous,

J'aimerais, via une application mobile Android et grâce à un lecteur de carte, récupérer depuis une carte d'identité belge (Belgian eID) une donnée simple (comme le nom de la personne).

Le problème étant que je ne sais pas si c'est possible via Android et surtout, je ne sais pas comment faire (J'ai regardé sur ce pdf : https://downloads.services.belgium.be/eid/UPD_Developers_Guide.pdf mais je n'ai pas trouvé mon bonheur).

Merci d'avance pour votre aide.

---

Hello,

I would like, with a Android mobile app and with a smart card reader, retrieve from a belgian id card (Belgian eID) a simple data (like the fullname of the person).

The issue is that I don't know if it's possible with Android and the most annoying is that I don't know how to do it. (I read this PDF : https://downloads.services.belgium.be/eid/UPD_Developers_Guide.pdf but I dind't find a solution).

In advance, thank you.

Frederik Vernelen

unread,
Nov 7, 2017, 3:12:37 AM11/7/17
to Fabble, eID Middleware Dev
Hello,

I'm afraid that for reading out the belgian eID card on android, we currently do not offer a solution.
You could write your own application starting from usb level, but that will be quite some work.
You could also search for android apps of third party vendors that offer the possibility to communicate with a smart card (reader), I know there are some, but we never tested them.
The commands you can send to the eID card (reader) can be found here:


The PDF you referenced is about an older version of our SDK (3.5), but also the new version of our SDK (4) offers no support for android.

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-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fabble

unread,
Nov 7, 2017, 6:03:27 AM11/7/17
to eID Middleware Dev
Hello Frederik,

I'm a really big new beginner for this but could you please tell me n explanation of how can I do a simple task, like retrieve a simple data (for exemple: the national register number from the belgian eID) with APDU command ? Which ADPU command use ? What send in paramaters ?

In advance, thank you.

Wouter Verhelst

unread,
Nov 7, 2017, 6:08:32 AM11/7/17
to eid-middl...@googlegroups.com
For that, you need to read out the identity file and parse it.

Which file is found where, and what their contents are, is documented in
a different document,
https://github.com/Fedict/eid-mw/blob/master/doc/sdk/documentation/Belgian%20Electronic%20Identity%20Card%20content%20v4%2001.pdf

To read a particular file, you use the "SELECT FILE" command to select
the file you want, followed by a "READ BINARY" command to get its data.
These are documented in the "public belpic applet" document in sections
6.3 and 6.4.

Regards,
> eid-middleware-...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> 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
> <mailto:eid-middleware-...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Wouter Verhelst

Fabble

unread,
Nov 7, 2017, 8:09:29 AM11/7/17
to eID Middleware Dev
Ok thank you, i'll certainly test this in a few weeks.

And if someone has others things to help me, he is welcome.

Fabble

unread,
Nov 10, 2017, 3:12:49 AM11/10/17
to eID Middleware Dev
A question for Wouter Verhelst or an other person, can I have an example of the exact APDU command to send to have for example the national register number ? Because I'm really in trouble with this documentation.

In advance, thank you.

Frederik Vernelen

unread,
Nov 10, 2017, 4:04:14 AM11/10/17
to Fabble, eID Middleware Dev
Hello,

You could have a look at our pkcs11 library to see how we form these APDU's.

What might also help is to have a look at the loggings of our pkcs11 module: the p11.logs contain most of the APDU's we send
How to setup these logs can be found here:

Wkr,
 Frederik



On Fri, Nov 10, 2017 at 9:12 AM, Fabble <fabfe...@gmail.com> wrote:
A question for Wouter Verhelst or an other person, can I have an example of the exact APDU command to send to have for example the national register number ? Because I'm really in trouble with this documentation.

In advance, thank you.

--
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-dev+unsub...@googlegroups.com.

vincent neuts

unread,
Jan 29, 2018, 11:02:11 AM1/29/18
to eID Middleware Dev
Hi Wouter

I'm new to the eID and the commands are a bit confusing at first. Can you maybe give an example command for the "SELECT FILE" and "READ BINARY" for selecting the Name of the card?

Kind regards,

Vincent Neuts
>         eid-middleware-dev+unsub...@googlegroups.com <javascript:>.
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
> --
> 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

Frederik Vernelen

unread,
Jan 29, 2018, 11:06:24 AM1/29/18
to vincent neuts, eID Middleware Dev
Hello Vincent,

These APDU commands are a bit low level, if you are developing for one of the platforms our SDK supports (Windows/macOS/Linux), it will be easier to just use our SDK, which can be found at:

Wkr,
 Frederik


Vincent Neuts
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
> --
> 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
> For more options, visit https://groups.google.com/d/optout.

--
Wouter Verhelst

--
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-dev+unsub...@googlegroups.com.

vincent neuts

unread,
Jan 29, 2018, 11:24:07 AM1/29/18
to eID Middleware Dev

Hello Frederik 

I'm writing a Application for an android device, Unfortunately that is not supported. 

I made a bluetooth connection with a cardreader and can send commands to it and I also get a response back just not the one that I want.

I'm only interested in the identification file( name, birthdate, country..). So first I have to select that file with an APDU command and afterwards I need to readBinary. 


King regards, 

Vincent Neuts
Vincent Neuts
>         eid-middleware-dev+unsub...@googlegroups.com <javascript:>.
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
> --
> 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
> For more options, visit https://groups.google.com/d/optout.

--
Wouter Verhelst

vincent neuts

unread,
Jan 29, 2018, 12:57:27 PM1/29/18
to eID Middleware Dev
Hello Frederik

I found it ,thanks for helping me!

kind regards,

Vincent Neuts

Frederik Vernelen

unread,
Jan 30, 2018, 3:21:33 AM1/30/18
to vincent neuts, eID Middleware Dev
Hello Vincent,

There you can find how to form the byte arrays to send to the card.

To find the paths of the files on the eID, please check this document: (paragraph 4)

E.g. the identity file (EF(ID#RN))can be found at: 3F00DF014031

So you could use as APDU{0x00, 0xA4, 0x08, 0x0C, 0x3f, 0x00, 0xdf, 0x01, 0x40, 0x31} to select the identity file.


To read out this file, please have a look at function BeidReadFile in https://github.com/Fedict/eid-mw/blob/master/cardcomm/minidriver/src/SmartCard.c

Wkr,
 Frederik


Vincent Neuts
>         For more options, visit https://groups.google.com/d/optout
>         <https://groups.google.com/d/optout>.
>
>
> --
> 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
> For more options, visit https://groups.google.com/d/optout.

--
Wouter Verhelst

--
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-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

Rémy LAVERGNE

unread,
Nov 16, 2018, 3:02:30 AM11/16/18
to eID Middleware Dev
Salut,

Tu avais trouvé une solution au problème ?

J'arrive à communiquer avec la carte, à récupérer l'ATR, mais aucune commande APDU ne fonctionne. Lorsque j'ai un retour positif, j'ai "6D 00" en réponse...

Merci d'avance en espérant que tu puisses m'aider :)

Bonne journée.
Reply all
Reply to author
Forward
0 new messages