Java Card Package Cross-Import via Native Bridge
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Java Card applications face a linker error due to the prohibition of cross-importing Java packages that extend each other, which is necessary for managing BER TLV files through specific APIs, hindering the execution of third-party applications on embedded universal integrated circuit cards.
Innovation Solution
Implementing native methods, preferably in C, to allow the execution of Java Card applications by calling and executing native methods from one package and then pushing Java Card method tokens onto the stack to execute methods from another package, thereby bypassing security restrictions and enabling the use of packages that extend each other.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If Java Card applications use packages that extend to each other (cross-import), then the functionality for managing BER TLV files is enabled, but a Java linker error occurs due to security restrictions
Solution Approach 1:
The patent introduces a bridge class that acts as an intermediary between the two packages. This bridge class is placed in a neutral package and provides static methods that internally call methods from both the first and second packages. By using this intermediary, the system enables cross-package functionality without direct cross-imports, thus avoiding the Java linker error while maintaining the ability to manage BER TLV files.
2Reliability
If Java Card applications enforce strict package import rules, then security and compilation stability are improved, but the ability to implement complex APIs like BER TLV file management is hindered
Solution Approach 1:
The patent segments the API implementation into multiple components: the first package, the second package, and a bridge class in a neutral package. Each segment maintains its own import restrictions and is compiled independently. The bridge class is divided into static methods that separately interact with each package, allowing each segment to be compiled and verified independently while collectively providing the full API functionality.
3Ease of manufacture
If Java Card applications allow cross-import of extending packages, then the ease of implementing BER TLV file management is improved, but Java linker errors occur during compilation
Solution Approach 1:
The bridge class serves as a mediator that simplifies the implementation of BER TLV file management. Developers can call methods on the bridge class without needing to understand or directly import from multiple extending packages. The bridge class handles all the cross-package interactions internally, reducing the complexity of the compilation process while maintaining ease of implementation for the intended functionality.
Data Source
Figure 1~2

AI summary
According to one aspect, it is proposed a method of executing on an integrated circuit a Java card application (APLT) that requires to use a first package (PCK1) and a second package (PCK2) that extend to each other of an application programming interface (API), the method comprising, starting from a class of said first package (PCK1): - calling and executing (20)a native method (NTVM) implementing a function of a Java card method (JCM) of said class of the first package (PCK1), then - calling (21) a Java card method (JCM) of a class of the second package (PCK2) from said native method (NTVM), then - executing (22) said Java card method (JCM) with a Java card virtual Machine (JCVM).