Home

Awesome

JavaCard Tutorial

Build Status Coverage Status

Examples from Eric VĂ©tillard's tutorial re-arranged in a Gradle project using JavaCard gradle plugin with additional tests

Each example is referenced as a Gradle module with :

It's also possible :

Setup

git clone git@github.com:bertrandmartel/javacard-tutorial.git
cd javacard-tutorial
git submodule update --init

Build all examples

./gradlew build

jc101-1c : basic applet

http://javacard.vetilles.com/2006/09/17/hello-world-smart-card/

install

The following will build, delete applet if existing, install the applet :

./gradlew :jc101-1c:build :jc101-1c:installJavaCard

run simulation tests

./gradlew :jc101-1c:test

run tests on smartcard

./gradlew :jc101-1c:test -DtestMode=smartcard

send apdu

From gradle script task :

./gradlew :jc101-1c:sendHello

jc101-2c : a simple counter

http://javacard.vetilles.com/2006/10/30/jc101-2c-a-simple-counter-for-smart-card-developers/

install

The following will build, delete applet if existing, install the applet :

./gradlew :jc101-2c:build :jc101-2c:installJavaCard

run simulation tests

./gradlew :jc101-2c:test

run tests on smartcard

./gradlew :jc101-2c:test -DtestMode=smartcard

send apdu

From gradle script task :

./gradlew :jc101-2c:balance
./gradlew :jc101-2c:credit
./gradlew :jc101-2c:debit

jc101-password : password application

install

The following will build, delete applet if existing, install the applet :

./gradlew :jc101-password:build :jc101-password:installJavaCard

run simulation tests

./gradlew :jc101-password:test

run tests on smartcard

./gradlew :jc101-password:test -DtestMode=smartcard

send apdu

From gradle script task :

./gradlew :jc101-password:addPassword
./gradlew :jc101-password:removePassword
./gradlew :jc101-password:listPassword

jc101-password-pin : password application with PIN security

install

The following will build, delete applet if existing, install the applet :

./gradlew :jc101-password-pin:build :jc101-password-pin:installJavaCard

run simulation tests

./gradlew :jc101-password-pin:test

run tests on smartcard

./gradlew :jc101-password-pin:test -DtestMode=smartcard

send pin code apdu

./gradlew :jc101-password-pin:setPinCode

send apdu

From gradle script task :

./gradlew :jc101-password-pin:addPassword
./gradlew :jc101-password-pin:removePassword
./gradlew :jc101-password-pin:listPassword