Full introduction to Ubuntu/MAC smart card operation 2-Java card tour

Source: Internet
Author: User

Full introduction to Ubuntu/MAC smart card operation 2 -- Java card tour

The previous introduction introduced how to access the card reader from Linux and how to send and receive APDU at the lowest level. Now let's go to the javacard environment:

For building a javacard Development Environment on Ubuntu, refer to my previous blog-http://blog.csdn.net/caesarzou/article/details/7534493, this article mainly talks about the javacard application download environment: GP related tools.

PreviousArticleIn ubuntu 11.10, ant has been upgraded in 12.04, and jre1.5 is no longer supported. So make minor corrections first.

1. In ~ /. Delete the java_home definition in bashrc and use the default JRE: openjdk icetea.

2. Modify ~ Add attributes to the javac compilation task in/javacard/samples/build_samples.xml: fork = "true" executable = "/usr/lib/JVM/Java-1.5.0-sun" or add target = "1.5" to use sun's 1.5jdk compilation or use the current JDK Compilation the bytecode of version 1.5.

3. The installation of jcop 3.1.1b Eclipse plug-in on Ubuntu is described earlier, but only virtual cards are supported. Now we have connected pcsc, and now let this plug-in operate the real card.

# Open eclipse first. We find that the pcsc part of DEBUG configuration is gray and you cannot select a card reader.

# Go To The plug-in Directory

CD/usr/lib/Eclipse/plugins/COM. IBM. bluez. jcop. eclipse_3.1.1. B/

Ls

# We can see the supported directories of the operating system.

Cd OS/Linux/x86

Ls

# I can see the dynamic library file libjpcsc. So OF THE pcsc interface in Linux. Why is it ineffective? Let's analyze it.

LDD libjpcsc. So

We can see that libpcsclite. so.0 cannot be found in a dynamic library that this dynamic library depends on.

# Is it very familiar. That's right. This is the official pcsclite library. The link may fail because the library version of the connected pcsclite library does not match the current system version when libjpcsc. So is compiled.

# The pcsclite library we installed is GNU, so we came to the directory

I386-linux-gnu/CD/usr/lib/

Ls libpcsclite *

# You can find the system's pcsclite library file libpcsclite. So (it may change with different versions. For details, refer to the libtools description in libpcsclite. La)

Sudo ln-P libpcsclite. So ../libpcsclite. so.0

# Create a hard link for the library file. Check libjpcsc. So again to see that the link is successful.

# Re-open eclipse, open debug deployments, and create a Java card application configuration. You can see that the card reader column has been activated. Select the card reader, configure ISD and key, and click debug.

The familiar jcshell is opened!

Globalplatform's own open-source project gpshell also has a version for Linux, but compilation always fails after it is down. If you have done it, please give us some advice.

The main development and download environments of anyway and javacard have been set up. The javacard applet can be migrated from windows. Cos developers also need to complete cross-Compilation of GCC ~~~ I am trying to get a quick start.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.