italia / cie-nis-python-sdk

SDK for reading the NIS code from an Italian Electronic Identity Card (CIE) using Python
BSD 3-Clause "New" or "Revised" License
30 stars 11 forks source link

Develop a library for reading the NIS code with PKCS#11 #2

Open alranel opened 7 years ago

alranel commented 7 years ago

Each card has an unique number (NIS) which can be read easily, without the need for the more complex middleware and also without entering the card PIN. It would be very useful to provide a minimal and portable (?) SDK for reading such code using PKCS#11. The SDK could be easily embedded in applications and devices.

The NIS code can be mapped to the person's Codice Fiscale just by querying a web service operated by the Government (not available yet). Such feature allows third parties to use CIE cards for access turnstiles (offices, gyms, etc.) because users can be mapped to a local database using the Codice Fiscale.

Example code for this task is available: https://github.com/italia/cie-middleware/tree/master/EsempioPKCS11 We basically need to turn it into a library, in both C++ and C#. The C++ version should also target MacOS X and Linux, since they provide PKCS#11. During development it's not required to make a single multi-platform library; distinct implementations can be developed for convenience.

Peppub commented 7 years ago

We'd like to map the NIS code through a web service, but how? Seems the connection element is missing.

How we can solve this?

kipters commented 7 years ago

I'd like to help, but I think I won't be able to request a CIE card for a long time. Is there any way to get "test" cards?

alranel commented 7 years ago

@Peppub, I know this answer is very late (sorry!). The web service for mapping the NIS code to the Fiscal Code is active but it can only be accessed by public bodies after signing an agreement.

@kipters, sadly there's currently no way to get test cards. It's definitely a priority we are working on.

alranel commented 6 years ago

I'm leaving this issue open because the new great Python implementation only uses low-level commands (APDUs) and still lacks PCKS#11 code.