Home - martinpaljak/JCardEngine GitHub Wiki

Welcome!

JCardEngine is designed as a rapid development and testing aid for JavaCard applets, providing lightweight ephemeral JavaCard environments to run applet code on a traditional JVM and exchange APDU-s with it. It does this by simulating (mocking) the JavaCard framework packages (javacard*.framework.*) and system classes (JCSystem, GPSystem etc) and taking care of applet initialization and registration via your Applet.install() method. Cryptography is provided via Bouncy Castle. See Java Code Tutorial, Beginner.

It also comes as a command line utility jcard.jar to quickly fire up existing applet .cap files (that include Java .class files, do not use strip="true" with ant-javacard) and expose them via PC/SC adapter(s) to existing applications. See Command Line Tutorial, Beginner.

Features

  • seamless use from command line wiht jcard
  • supports Global Platform with SCP03 secure channel
  • programmatic components for PC/SC adapters
  • simulator state introspection (JavaCard, GlobalPlatform)

JCardEngine vs Oracle JavaCard SDK Simulator

JCardEngine Oracle Notes for JCardEngine
JavaCard API 3.0.5 (WIP) 3.2
Works from classpath yes no
Support for CAP files no yes
GlobalPlatform support yes* (WIP) yes (2.3) will embed GlobalPlatformPro
code coverage for applets yes, jacoco no
PC/SC interface yes* yes, on Linux via vsmartcard
javax.smartcardio yes yes
architecture any* x86 pure Java
open source yes no Apache 2.0 license

Notes:

Areas of focus for JCardEngine

Issues with jcardsim and focus of the fork is split as follows:

  • "core" and platform correctness
    • JC API revision conformance (transient keys, OneShot etc)
    • internal structures and interfaces (not visible to users)
    • build scaffolding (Maven, ASM, GHA, repo etc)
    • threading assumptions
  • algorithm completeness and correction
    • PACE_GM, bugs etc
  • interfacing and DX
    • virtual readers (javax.smartcardio, VSmartCard/BixVReader, Oracle PC/SC)
    • explicit composition of card (applets) vs indirect properties + instantiation
    • command line tool (not unlike GlobalPlatformPro)
    • interfacing to Oracle Simulator from same framework
  • new features
    • GPSystem support via GlobalPlatformPro

[!NOTE] JCardEngine is a fork/rewrite of @licel/jcardsim from April 3, 2024 revision aa60a02f042c18211e4d0f0aef75f27b0e5cf873.