Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
public:smartcard:javacardcompilation [2010-10-18 12:23] – xkur | public:research:smartcard:javacardcompilation [2016-12-01 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== JavaCard applet development ====== | ||
+ | ~~NOTOC~~ | ||
+ | <note tip>The description in section ' | ||
- | ====== JavaCard applet development with NetBeans IDE ====== | + | ===== JavaCard applet development with AppletPlayground/ |
- | (c) 2010 by LaBAK FI MUNI | + | |
+ | * Use AppletPlayground for compilation and conversion into JavaCard applet (by Martin Paljak): https:// | ||
+ | * Use GlobalPlatformPro for upload of converted applets onto real cards (by Martin Paljak): https:// | ||
+ | * Read slides with JavaCard development tutorial (by Petr Svenda): {{: | ||
+ | * Use JCardSim simulator to develop even without real smart card: https:// | ||
+ | * Consult JCAlgTest project for properties (supported algorithms, performance) of real smart card if you plan to buy one: https:// | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== (OUTDATED) | ||
+ | (c) 2010-2011 by LaBAK FI MUNI (contact us at http:// | ||
+ | |||
+ | {{scripttemplates.zip|Download script templates}} for common smart cards. | ||
{{: | {{: | ||
+ | |||
+ | {{JavaCard_tutorial_2011.pdf | Download slides with JavaCard tutorial.}} To be used with Ubuntu VirtualBox image. | ||
+ | |||
+ | [[https:// | ||
===== Installation process ===== | ===== Installation process ===== | ||
Line 11: | Line 32: | ||
* Apache Ant 1.7 or later (http:// | * Apache Ant 1.7 or later (http:// | ||
* GPShell 1.4.2 or later (http:// | * GPShell 1.4.2 or later (http:// | ||
- | * Java Card Development Kit 2.1.2 (http:// | + | * Java Card Development Kit 2.1.2 (http:// |
- | * Java Card Ant Tasks (binary and docs can be found in Java Card Development Kit 2.2.2, subdirectory " | + | * Java Card Ant Tasks (binary and docs can be found in Java Card Development Kit 2.2.2, subdirectory " |
- Install NetBeans | - Install NetBeans | ||
Line 20: | Line 41: | ||
- Create new Java project in NetBeans (File-> | - Create new Java project in NetBeans (File-> | ||
- Create a " | - Create a " | ||
- | - Set configuration parameters in " | + | - Set configuration parameters in " |
* jc.home - path to Java Card Development Kit | * jc.home - path to Java Card Development Kit | ||
- | * jc.export_files | + | * jc.export_files |
* gpshell.home | * gpshell.home | ||
* gpshell.cmd | * gpshell.cmd | ||
Line 181: | Line 202: | ||
card_connect | card_connect | ||
select -AID a000000003000000 | select -AID a000000003000000 | ||
- | #select -AID A000000018434D00 | ||
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel | open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel | ||
Line 212: | Line 232: | ||
* When compilation is done (compiled files are in build/ | * When compilation is done (compiled files are in build/ | ||
* Testing executes script " | * Testing executes script " | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | |||
+ | * Problem: Compilation fails with error: cannot find symbol XY (e.g., symbol: variable KeyAgreement) | ||
+ | * Correct JavaCard SDK was not added to libraries. | ||
+ | * If you get error for all JavaCard classes, then add library for your target card (e.g., 2.2.1) | ||
+ | * if you get this error only for few classes (but not all), then you are using JC SDK without supprt for this classes (e.g., KeyAgreement, | ||
+ | |||
+ | * Problem: Convert fails with: Error: Could not find or load main class com.sun.javacard.converter.Converter | ||
+ | * Compilation was successful, but Converter was not found. Check if your //jc.home// path is correctly set in nbproject\project.properties file. Note that you must use double \ in path (e.g., d: | ||