This is an example project / template for building applications for the Fidesmo card. It's using the Fidesmo gradle plugin.
- Download the JavaCard Development Kit in Version 2.2.2 from Oracle
- Unzip the Javacard Development Kit and also the zipfiles it contains
- Set the environment variable
JC_HOME
to the folder containg the JavaCard Development Kit (usually namedjava_card_kit-2_2_2
)
Before you can interact with the Fidesmo servers, you need to add your appId and appKey to your gradle.properties. If you don't have created an application yet, you can do so on the developer portal.
echo 'fidesmoAppId: yourAppID' >> $HOME/.gradle/gradle.properties
echo 'fidesmoAppKey: yourAppKey' >> $HOME/.gradle/gradle.properties
The fidesmo plugin installs per default to the aid a00000061700[fidesmoAppID]0101.
./gradlew build
- Build the application and create the CAP-file../gradlew installToLocalCard
- Build the application and install it on a Fidesmo card connected to a local reader../gradlew deleteFromLocalCard
- Remove application from a Fidesmo card connected to a local reader../gradlew uploadExecutableLoadFile
- Upload the application to the Fidesmo Service. You can verify that the application has been correctly uploaded using the executableLoadFiles operation of the Fidesmo API
Instead of a card reader you can now also use your NFC enabled Android phone to communicate with the card.
Start up the APDU console built in to the SDK using the following
command (--no-daemon
is required for it to work properly):
./gradlew --no-daemon -q console
Then first select the application using the SELECT (00A404000CA00000061700E26B8F120101) command and then send a command with a test payload (80CA000004DEADBEEF00). Your session should look like this:
> send 00A404000CA00000061700E26B8F120101
==> ApduCommand(00A404000CA00000061700E26B8F120101)
<== ApduResponse(48656C6C6F2046696465736D6F219000)
> send 80ca000004deadbeef00
==> ApduCommand(80CA000004DEADBEEF00)
<== ApduResponse(48656C6C6F2046696465736D6F219000)
>