JAVA card technology overview

Keywords: JAVA

JavaCard technology allows programs written in Javanese language to be executed on smart cards and other resource-constrained devices. This article will give you an overview of Java Card technology, including the structure and components of the system. The purpose of this overview is to give you a holistic understanding of Java Card technology and to introduce the key points and basic concepts of the Java Card system for the programmer to design the program.
First, the Java Card technology components Java Card technology includes the following parts:
* Streamlined Java programming language and virtual machine for smart card applications (JavaCardVirtualMachine, JCVM) definition * Core Java Application Interface (API) and its extensions * Java Card runtime environment (JavaCardRuntimeEnvironment, JCRE)
The Java Card application interface and execution time environment are designed based on the smart card industry standard ISO7816. Therefore, the Java Card platform can easily support smart card systems and applications compatible with ISO7816 Parts 1 through 6.
The Java Card app is called applets. The Java Card platform supports multi-application environments. The Java Card app is processed and executed within Java's execution time environment.
Second, the streamlined Java card language If the smart card program can be written using the Java programming language all functions are of course best, but for smart cards and other resource-constrained devices, due to limited computing resources, it is impossible to fully support the Java programming language. Unrealistic things. Generally, smart cards are available in 1K random access memory (RAM), 16K non-volatile memory (EEPROM or RAM) and 24K read-only memory (ROM) specifications. Therefore, the Java card platform can only support carefully selected and A Java language that has been standardized and has a streamlined function. This streamlined Java language includes features for designing smart cards and other small device programs while preserving the object-oriented capabilities of the Java programming language. It is much easier to explain the features that are not supported by the Java programming language than to explain the features that it can support. The Java Card platform does not support:
* Large basic data types: long integers, double floating point, floating point * characters and strings * multiple arrays * dynamic category loading * security manager * garbage collection and termination * threading * object copying these unsupported features keywords Naturally it will be omitted from the Java language. Partial Javanese Smart Cards provide garbage collection to activate the Java Card app removal feature. The deleted application space may or may not be used, but it depends on the scope of the garbage collector used on the smart card. In general, if a language feature is not clearly indicated as unsupported, it is a supported streamlined feature.
Third, the Java card platform structure Java programming language was originally designed for a system with a lot of computing resources. Although the Java Card platform supports a standardized and simplified Java programming language, it is not suitable to install the entire Java Card platform on a smart card with limited memory and processing power. Even if you can do it, the class library or application will have no space available. An important feature of the Java Card platform is that it is a distributed system. In fact, it is a system that is scattered between smart cards and desktop computers in space and time.

Many processing tasks that are not restricted by the execution period, such as classloading, verification, resolution and linking, and bytecode optimization, are mainly offcard. The system components that are executed in the personal computer environment operate. Often resources are not the focus of consideration in personal computers. The system components on the card are tighter and are also suitable for the smart card memory model. The Java Card Execution Environment (JCRE) consists of these components. JCRE is responsible for the execution of the application and drives the oncard system and application to execute securely. Figure 1 shows the structure of the Java Card platform system.
JCRE is based on smart card hardware and basic operating system conventions. JCRE includes Java Card Virtual Machine (bit code interpreter), Java Card Application Architecture Classes (APIs), specific industry extensions, and JCRE system services. The API and JCRE system services are modeled on the ISO7816 smart card standard and assist the application in compatibility with ISO7816.
JCRE separates the Java Card application from the smart card vendor's proprietary technology and also provides standard system and API interfaces to the application. As a result, applications are smaller, easier to write, and can be transferred to different smart card architectures.
The bottom layer of JCRE contains the Java Card Virtual Machine (JCVM). JCVM will execute the bit code and determine Java language security. The JCVM in the above figure only has the part of the bytecode interpreter of the virtual machine. Another part of the JCVM is embedded in a component called a converter. The converter is implemented outside the card, which will be further explained below.
The system classes are the performers of JCRE who are responsible for managing the ongoing and temporary behavior of objects, supporting detailed operations and transactions, and managing communication between the host and the Java Card application, controlling the creation, selection, and deselection of applications. . In order to complete the task, the system category usually activates the local method (nativemethod) service.
The Java Card application framework defines the application design interface. This architecture contains the center and extensions of the four API packages. The API category is quite tight, and its specifications are set for developing smart card applications. The biggest advantage of this architecture is that it is extremely easy to build a Java Card app. Program developers can focus most of their energy on the application, not on the underlying architecture of the smart card system. The Java Card app is a JCRE service through the API category.
Specific industries or businesses can use additional application databases to provide additional services or to improve security and system models. For example, the Whiskey Open Platform (VisaOpenPlatform) extends the JCRE service to meet the specific security needs of whisky. These additional features enhance the card issuer's control over the credit card issued, as well as a set of standard instructions for credit card personalization.
The Java Card app can be downloaded (downloadable). They can be attached to the card after the Java smart card has been produced. The installer is responsible for loading and installing the Java Card application. Usually the installer will use the help of the out-of-card installer to complete the task of installing the application. Since JCRE is not required to support dynamic application installation, the installer is just an optional component of JCRE. If there is no installer, the application must be placed on the card when the smart card is manufactured, and no additional applications can be attached to the card after the manufacturing.
The Java Card app is of course written in the Java programming language. The application is managed by JCRE. The Java Card execution environment includes a Java Card system component that resides on the card. The Java Card Converter and the Card Outer Installer form the rest of the Java Card platform. This part is performed in a personal computer environment. The converter pre-processes the classfiles that make up the Java package and creates a compact binary file called the CAP file. The CAP file is a downloadable component. The out-of-card installer takes the CAP file and passes it to the card installer.
The main difference between the Java Card Virtual Machine (JCVM) and the Java Virtual Machine (JVM) is that the JCVM is constructed as two different parts, as shown in Figure 2.
The in-card portion of the JCVM includes a Java card bit code interpreter. The Java Card Converter is executed on a personal computer or workstation. This converter is the external part of the JCVM. The combination of the two supports virtual machine functionality, including loading Java class files and executing them in a special syntax. The converter pre-processes the class files and performs validation, resolution, preparation, and bit-code optimization, which are performed during the class loading period in the Java virtual machine. The output of the converter is a CAP file. This CAP file is then placed on the Java Smart Card and executed by the interpreter.

1. Java Card Converter does not handle a category at a time like Java Virtual Machine, the loading and conversion unit of Java Card Converter is a parcel. The converter pre-processes the class files that make up the Java wrap and converts the parcel into a CAPn. During the conversion process, the converter performs the following steps:
*Verify and streamline Java language check: Confirm that the loading image of the category is properly formed, and check the Java Card Lite language for any violations.
*Links and Resolutions: Decompose symbolic references (category, methods, and regions) into more compact forms so that they can be processed more efficiently on the card.
* Bitcode optimization: Optimize its bitcode with information obtained during the category loading and linking period.
*Prepare and initialize: arrange storage space for different categories and build VM data structure; initialize static variables at the same time.
The input to the converter includes not only the category file to be converted, but also one or more output files (exportfiles). The output file contains the name and link information of the package content entered via the converted category. In addition to generating a CAP file, the converter also produces an output file for the converted package.
2. The CAP file and the output file CAP are abbreviations of the converted application (convertedapplet). A CAP file usually refers to a package that defines one or more Java Card applications. However, a package does not necessarily define an application. In this case, the CAP file can represent a database package that provides the general categories and services shared by the application. For example, Java Card Architecture API packages are all database packages.
One of the Java programs is written everywhere (writeoncerunanywhere) is perhaps the most important feature of the Java platform. In Java technology, the category file is the central part of the Java structure. It defines the Java platform binary code compatibility (binarycompatibility) standard. Due to the decentralized nature of the Java Card virtual machine architecture, the CAP file can be used to set the standard file format for the Java platform to implement code compatibility. The CAP file format is a special form in which the software can be loaded on a smart card that performs the Java Card execution environment.
The output file is not loaded on the smart card, so the Java Card Interpreter is not used directly. Conversely, the output file is generated and used by the converter for the purpose of the connection. The output file can be thought of as a header file in the C language. The output file contains the public API information for the entire category package (category name and link information, interfaces, methods, and areas in the package), and the program developer is free to send the output file to potential users of the application.
3. Java Card Interpreter The Java Card Interpreter itself does not load or manipulate the CAP file. It only executes the Java Card application found in the CAP file, and the CAP file is loaded by the installer. The functional division between the Java Card Interpreter and the installer makes the interpreter small and at the same time makes the installer extremely flexible.
The Java Card Interpreter plays an important role in implementing security during the execution period. For example, the interpreter controls access to JCRE services and internal communication of applications via the firewall function of the application.
So far, this article has been to say that the Java Card Virtual Machine contains converters and interpreters. However, traditionally Java Card Virtual Machines are defined as the upper part of the virtual machine. The virtual machine is the interpreter in our current definition. In many early publications, this traditional statement has been unshakable. Therefore, in the remainder of this article, the Java Card Interpreter and the Java Card Virtual Machine are also defined by this definition unless specifically stated in the article.
V. Java Card Execution Period Environment In a personal computer or workstation, the Java virtual machine is executed as an operating system process. When the COS process ends, the Java application and its objects are automatically destroyed.
Conversely, the Java Card virtual machine is executed in the Java Card execution time environment. JCRE is initialized during card initialization. JCRE initialization will only be executed once during the lifetime of the card. In the process, JCRE initializes the virtual machine and builds objects to provide JCRE services and manage applications. Once the application is installed, JCRE will create the application entity (appletinstances), and the application will also create objects to store the data.
Most of the information stored on the card must be saved even when the card is dead. Non-volatile memory technologies (like EEPROM) allow smart cards to store information when power is not being available. Since JCRE and the objects created on the card are often used to represent continuous application information, the lifetime of the JCRE is the same as the lifetime of the card. When the power supply is interrupted, the JCRE can be considered to operate in an infinitely long clock cycle.
The next time the card gets energy, the JCRE will wake up and start the execution of the virtual machine. However, it is worth noting here that JCRE will not return to the operation of the virtual machine when it loses power. The virtual machine will be reset (reset) and will be executed from the beginning of the main loop. JCRE resetting and initializing is different because it saves the applications and objects built on the card. During the reset process, if a trading action has not been completed previously, JCRE will perform any necessary cleanup actions to bring the JCRE into a consistent state.
Six, Java Card API
The Java Card API is a set of specially planned categories designed to design smart card applications based on the ISO7816 model. The center of the category and its extensions are tighter and cleaner than the categories on the Java platform, while providing basic services to the Java Card app.
The Java Card API contains three core packages and an extended package. The three core packages are java.lang, javacard.framework and javacard.security. The extension package is javacardx.crypto. In addition to the categories in the java.lang package, programmers familiar with the Java platform do not necessarily know most of the Java card categories. This is because many Java classes support GUI interfaces and networks, as well as desktop file system IO. Smart cards do not have a display, and they use different network protocols and file system structures.
1.java.lang package In general, no Java API category is supported in the Java Card API. However, some categories from the java.lang package provide basic Java language support. This class is Object, Throwable, and some exception classes associated with VMs. The Object class defines the root of the Java Card class hierarchy, while the Throwable class provides all the exceptions for a common ancestor. When an error occurs due to a violation of the Java language, the supported exception category ensures that the Java language is correct. For example, a Java virtual machine and a Java virtual machine will have a NullPointerException when accessing a null-reference. The categories supported on the Java Card platform are listed in Table 1.
Table 1 Java card java.lang package
Object Throwable Exception
Runtime Exception Arithmetic Excep-tion Array Index out Of Bounds Exception
Array Stor Exception Class Cast Excep-tion Index Out Of Bounds Exception
NullPointerException SecurityException NegativeArraySizeException
Java.lang package is a lite version of java.lang that is equivalent to it on the Java platform. The Java Card applet is upward compatible due to the categories supported in the java.lang package. The Java Card applet can be executed in a desktop Java environment when the Java Card category required in the category path is available.
2.javacard.framework package javacard.framework is a basic package. It provides architectural categories and interfaces for the core functionality of the Java Card application. Most importantly, it defines a base application category that has the same role as the Java application category. The base category "applet" provides an architecture for the execution of the application during the life of the application, while also providing interaction with JCRE. A consumer application category must extend from the underlying "applet category and will override the methods in the applet category to implement the functionality of the application.
Another important category in the javacard.framework package is the APDU category. APDU is an abbreviation of applicationprotocoldataunits, which is a data package exchanged between a smart card application and a host application. Each APDU contains an instruction from the host to the smart card application, or a response from the application back to the host. Application developers can use the methods provided in the APDU category to handle APDU instructions more easily.
The java.lang.System category is not supported. The Java Card platform will provide an interface to the javacard.framework.JCSystem category of system behavior. The JCSystem category includes a set of methods to control application execution, resource management, transaction management, and object sharing between applications and applications on the Java Card platform.
Other categories supported in the javacard.framework package are the personal identification number (PIN), utility, and exceptions categories.
3. javacard.security package javacard.security package provides architecture to the cryptographic functions supported on the Java Card platform. Its design is based on the java.security package.
The javacard.security package defines a key category of keyBuilder and various interfaces. These interfaces represent cryptographic keys used in symmetric (DES) or asymmetric (DSA and RSA) calculus. It also supports the abstract base classes RandomData, Signature, and MessageDigest. These categories are used to generate random data and to calculate digests and signatures.
4.javacardx.crypto package javacardx.crypto package is an extension package. It contains the cryptographic categories and functional interfaces controlled by the output. The javacardx.crypto package defines the abstract base class Cipher that supports encoding and decoding.
The javacard.security and javacardx.crypto packages define the API interface for the application to call cryptography services. However, they do not provide any implementation. JCRE providers need to supply classes that implement key interfaces, and categories that extend from the abstract classes RandomData, Signature, MessageDigest, and Cipher. A separate cryptographic auxiliary processor is usually stored on the smart card to perform cryptographic calculations.
Seven, Java Card App The Java Card app is called an applet. It is just like application processing or user space in other computer operating system environments.
You shouldn't confuse the Java Card app with the Java app just because they have an application in their name. The Java Card app is a Java program that adheres to a set of specifications and can therefore be executed within the Java Card execution time environment. The Java Card app is not expected to execute in a browser environment.
The reason for choosing an application to name the Java Card application is that the Java Card application can load the Java Card execution time environment after the card is produced. That is, unlike many embedded systems, applications have to be embedded in ROM. Instead, they can be dynamically downloaded to the card at a later time.
The Java Card implementation environment supports a multiple application environment. Each application is uniquely identified by an AID. An application can also have multiple instances. For example, you can create an example of a wallet app to support the US dollar and create an e-wallet application instance for the pound.
Application categories must extend from the javacard.framework.Applet category. The base applet category is the super category of all apps on the Java Card. It defines the general methods that an application must support in order to interact with JCRE during the life of the application.
Eight, the application development process Java card application development begins with any other Java program, that is, the program developer writes one or more Java classes, and edits the source code with the Java encoder, as shown in Figure 3. , generating one or more category files. An application is organized into a package or a set of packages. The smallest application is a single category of parcels derived from the javacard.framework.Applet category.
First, the application is executed, tested, and wormed in the Java environment of a personal computer or workstation. This process uses existing Java development tools to test the functionality of the application. However, in this step, some features of the Java Card platform cannot be tested, such as the application firewall, and the temporary and persistent behavior of the object cannot be tested.
Next, the application is tested in a simulation environment. The emulator simulates the Java Card execution time environment on a personal computer or workstation. The behavior that an application performs in the emulator should be the same as it does in a real card. In this development phase, not only will the application be further tested, but the application's execution time behavior will also be tested.

Usually, the emulator and the bugger are together. The bugger allows you to set a breakpoint, or turn the program into a single step, and see the execution state of the application changes in the simulated Java runtime environment.
Finally, when the application is ready to be downloaded into a real card, the category files that make up the application are converted to CAP files using the Java Card Converter. The application conversion process is shown in Figure 4. The input to the converter includes not only the category file to be converted, but also one or more output files. When the application is wrapped in a conversion, the converter also produces an output file for the package. A CAP file or an output file represents a Java wrap. After the conversion, the application represented by one or several CAP files will be loaded and installed on the Java Smart Card.

The currently recognized plastics that can be used to make tableware are made from PS. What you are looking for? Party Tableware, party container, kitchenware, take away box, Food Packaging Box etc? Please contact us, we have your covered. In order to meet the need of the majority of consumers, they are mainly used in the fast food industry or other food packaging industry. We would show you partial Plastic Round Tableware here, please contact us for more products. 

Ps Plastic Tableware

sushi round pan

Plastic Round Tableware

Plastic Round Tableware,Plastic Tray,Food Packaging Box,Ps/Pp Box

Taishan Yuexin Group , http://www.yuexingroup.com