Skip to content

vletoux/GidsApplet

Repository files navigation

GidsApplet

Generic Identity Device Specification (GIDS) smart card is the only PKI smart card whose driver is integrated on each Windows since Windows 7 SP1 and which can be used read and write. No Windows driver installation is required and this card can be used instantly.

My Smart Logon is providing free of charge a javacard applet to transform a java card into a GIDS smart card and its integration in OpenSC for other operating systems (Linux, MacOSX, …).

3 years of use without any bug reported!

General requirements

  • Card requirements
    • Java Card version 2.2.1 or above (see the list of tested cards)
    • Implementation of the "requestObjectDeletion()"-mechanism of the Java Card API is recommended to be able to properly delete files.
  • Requirements to use the card
    • Windows 7 SP1 / 2008 R2 or later for the "minidriver"
    • OpenSC (any platform) for pkcs11

Download

Download GidsApplet.cap

Installation on the smart card

Install the CAP-file (GidsApplet.cap) to your Java Card smartcard (e.g. with GlobalPlatformPro). The release section includes compiled version of the applet.

Most of the time, the applet can be installed with the command:

gp --install GidsApplet.cap --default

Some cards require additional switch like for G&D -emv or Gemalto -visa2 -key. See this page for more details. MANY UNSUCCESSFUL GP COMMANDS (approx 10) CAN BRICK YOUR CARD. Contact your manufacturer for more information.

Building

General instructions

You can use the card SDK to build the applet or ant-javacard.

The continuous integration platform script (.travis.yml) can be executed to build the applet.

You will need to use JDK 11 to build.

Building using VSCode

Install VSCode

292740193-882d2611-0ff9-458e-90f8-43c19379c592

Copy the code to a directory. Make sure you are downloading the submodules inside the ext directory. Aka run git submodule update --init --recursive. If you download the source code as a .zip directly, the submodules will not be downloaded.

go to (https://aka.ms/vscode-java-installer-win) and run the installer to add the Coding Pack for java

292740378-4fceff39-8176-48fe-a11c-860a90079952

Once VSCode reloaded, install a JDK

292740449-c0182143-bf51-4ceb-bdbf-35b0e0122cab

Select 11 Lts

292740469-1432d82a-b2e0-4e7e-94cc-4a6eb4561cd2

and install it. Make sure JAVA_HOME will be populated.

292740483-23853cdb-b962-47f4-b7ba-59a99a5a20e0

Install the extension Ant Target Runner

Right click on the dist target on the Ant Target Runner at the bottom left and build

image

The applet will be built automatically

293085824-2d9d8bd2-b43b-4eb5-b828-1c3dbaa5b567

Note: the ant build script will automatically download the packages that are needed to build the code

Running unit tests

Click on the "Lab" icon to display the unit test section of VSCode

image

Select JUnit as the unit test framework

image

The JUnit package will be automatically downloaded, and that will fixes the missing JUnit imports in the code.

image

Known problems when building using VSCode

Getting a SDK mismatch

The ant complains about another SDK being used

image

Solution:

You can change the runtime version when compiling

293044417-9af1a705-29d2-4fad-974f-e5a720faa289

You can also make sure that the JAVA_HOME environment variable points to the JDK 11. Here is a way to be sure that the variable is correctly set (don't forget to reboot vscode after any change).

293085729-3b899b7d-1160-441a-82d7-0613b10e04ad

The import javax.smartcardio cannot be resolved

The module java.smartcardio and javax.xml may not be found.

image

TODO: provide a step by step solution

Reference