Method and device for dynamic switching between Native and JavaCard

By using compatible system architecture and control instructions in smart cards to achieve dynamic switching between Native COS and JavaCard COS, the problem of low production efficiency caused by two independent hardware processes in smart cards is solved, and efficiency and reusability are improved.

CN113692576BActive Publication Date: 2024-11-08SHENZHEN JETLINK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202080027000.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-23
Publication Date
2024-11-08
Estimated Expiration
2040-12-23

AI Technical Summary

Technical Problem

The smart card production line needs to handle two independent hardware production processes, Native COS and JavaCard COS, resulting in low production efficiency.

Method used

The firmware version developed using a compatible system architecture is used to realize dynamic switching between Native COS and JavaCard COS through control instructions, simplifying the hardware production process.

Benefits of technology

It improves the production efficiency and hardware reusability of the smart card production line, and reduces R&D costs and cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113692576B_ABST
    Figure CN113692576B_ABST
Patent Text Reader

Abstract

A method and device for dynamic switching between Native and JavaCard, including writing a compiled firmware version into a security chip, wherein the firmware version is developed based on a compatible system architecture and includes Native COS and JavaCard COS; obtaining the personalized status of the root security domain in the firmware version; if the personalized status indicates that the root security domain has not been personalized, sending a control instruction to the security chip, so that the security chip can realize the dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction. The dynamic switching between Native COS and JavaCard COS in the firmware version is realized by the control instruction, so that only one set of hardware production process needs to be maintained, which greatly enhances the reusability of the production line hardware, thereby improving the production line production efficiency of smart cards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart cards, and in particular to a method and device for dynamically switching between Native and JavaCard. Background Art

[0002] At present, the operating systems (Chip On System, COS) of smart card security chips mainly include Native COS and JavaCard COS. Among them, Native COS is developed and implemented in C language, with high execution efficiency, small card issuance space consumption and low cost; JavaCard COS has the advantages of flexibility, scalability, and interoperability in accordance with standard specifications. JavaCardCOS supports the pre-installation of Java Applet or dynamic download and installation after leaving the factory, maintaining the independence and friendliness of upper-level Applet application developers, who do not need to care too much about the underlying implementation of JavaCard, and only need to focus on the business logic of the Applet application itself. For example, JavaCard in the telecommunications field supports remote download of Applet for installation and update, and can also download the corresponding Applet application when downloading the code number (Profile); JavaCard in the financial field supports post-installation payment inspection, wallet application, etc., and can support a variety of Applets, including transportation card swiping, wallet, payment, electronic driver's license, etc.

[0003] Native COS and JavaCard COS each have their own advantages and application scenarios. Currently, the two COSs coexist independently in the industry to meet the usage needs of different customers. For smart card production lines, different hardware production processes need to be adopted for Native COS and JavaCardCOS, which will undoubtedly increase the operational burden of the production line and reduce the production efficiency of the production line. Summary of the invention

[0004] The present invention mainly provides a method and device for dynamically switching between Native and JavaCard, which is used to solve the problem of low production efficiency of smart card production line caused by the independent coexistence of two existing COS architectures.

[0005] According to the first aspect, an embodiment provides a method for dynamic switching between Native and JavaCard, including:

[0006] Writing the compiled firmware version into the security chip, wherein the firmware version is developed based on a compatible system architecture including Native COS and JavaCard COS, and the compatible system architecture is compatible with Native and JavaCard in a decoupled manner;

[0007] Obtaining a personalized status of a root security domain in the firmware version;

[0008] If the personalization state indicates that the root security domain has not performed a personalization operation, a control instruction is sent to the security chip, so that the security chip implements dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction.

[0009] According to the second aspect, an embodiment provides an electronic device, including:

[0010] Memory, used to store programs;

[0011] The processor is used to implement the method for dynamic switching between Native and JavaCard described in the first aspect by executing the program stored in the memory.

[0012] According to the third aspect, an embodiment provides a computer-readable storage medium, including a program, wherein the program can be executed by a processor to implement the method for dynamic switching between Native and JavaCard described in the first aspect.

[0013] According to the method and device for dynamic switching between Native and JavaCard in the above-mentioned embodiment, the method and device include writing the compiled firmware version into the security chip, the firmware version is developed based on the compatible system architecture and includes Native COS and JavaCardCOS, and the compatible system architecture is compatible with Native and JavaCard in a decoupled manner; obtaining the personalized status of the root security domain in the firmware version; if the personalized status indicates that the root security domain has not been personalized, sending a control instruction to the security chip so that the security chip can realize the dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction. The dynamic switching between Native COS and JavaCard COS in the firmware version is realized by the control instruction, so that only one set of hardware production process needs to be maintained, which greatly enhances the reusability of the production line hardware, thereby improving the production line production efficiency of smart cards. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flowchart of a method for dynamically switching between Native and JavaCard provided in an embodiment of the present invention;

[0015] Figure 2 A flowchart of a second embodiment of a method for dynamic switching between Native and JavaCard provided by an embodiment of the present invention;

[0016] Figure 3A flowchart of a third embodiment of a method for dynamic switching between Native and JavaCard provided by an embodiment of the present invention;

[0017] Figure 4 A schematic diagram of the structure of a compatible system architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0019] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0020] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0021] First, some terms involved in the present invention are briefly explained:

[0022] JavaCard technology: provides a secure environment for applications running on smart cards (security chips) and other devices with very limited memory and processing power. Multiple applications can be deployed on a card, and new applications can be added to it even after the card is issued to the end user. Applications written in the Java programming language can run securely on cards from different vendors. It is the leading open interoperability platform for smart cards and security tokens. Various JavaCard specifications provide the basis for cross-platform and cross-vendor applet interoperability.

[0023] Java: It is an object-oriented programming language. It not only absorbs the advantages of C++, but also abandons the difficult-to-understand concepts of multiple inheritance and pointers in C++. Therefore, Java has two characteristics: powerful functions and simple and easy to use. As a representative of static object-oriented programming languages, Java has implemented object-oriented theory very well, allowing programmers to perform complex programming with an elegant way of thinking. Java has the characteristics of simplicity, object-oriented, distributed, robust, secure, platform-independent and portable, multi-threaded, and dynamic. Java can be used to write desktop applications, Web site applications, distributed systems, and embedded system applications.

[0024] Applet: application, small program, here refers specifically to the small program that can run on the JavaCard platform, written in Java language, with features such as cross-JavaCard platform and cross-hardware chip.

[0025] SPU: Secure Process Unit, a dedicated security processing unit integrated in the baseband chip.

[0026] eSE: embedded Secure Element, embedded security chip.

[0027] COS: Chip On System, refers to an operating system developed directly on a security chip. It usually refers to a general or industry-specific operating system developed based on the underlying chip capabilities and interfaces in the embedded security chip industry, such as for the telecommunications industry, financial industry, transportation industry and other industries.

[0028] Native: Generally refers to the design and implementation of technology that is implemented in C language and is unrelated to Java, JavaCard, and Java Applet.

[0029] USIM: Universal Subscriber Identity Module, also known as upgraded SIM, is a component of the Universal Mobile Telecommunication System (UMTS) 3G network. In addition to supporting multiple applications, the USIM card has also upgraded the algorithm in terms of security and added the card-to-network authentication function. This two-way authentication can effectively prevent hackers from attacking the card. This technology can be used as another high-speed data service carrier for the Global System for Mobile Communications (GSM) network. It will become a technical support for the smooth transition from the second generation to the third generation mobile communication SIM card. This technology was proposed as a research direction as early as 1991. In addition to supporting some existing fixed and mobile services, UMTS also provides new interactive multimedia services. UMTS uses the frequency bands allocated by the International Telecommunication Union (ITU) for terrestrial and satellite wireless communications. It can be accessed through mobile or fixed, public or private networks, and is compatible with GSM and Internet Protocol (IP).

[0030] eUICC: embedded UICC card, an embedded universal integrated circuit card designated by the Global System for Mobile Communications Alliance (GSMA), dedicated to the telecommunications field, an eSIM card that supports functions such as secure remote Profile download and multi-Profile management.

[0031] Profile: A collection of telecommunication code resources and corresponding data, file systems, and applications.

[0032] RAM: Random Access Memory, also known as main memory, is an internal memory that directly exchanges data with the CPU. It can be read and written at any time (except when refreshed), and the speed is very fast. It is usually used as a temporary data storage medium for operating systems or other running programs. When RAM is working, information can be written (stored) or read (retrieved) from any specified address at any time. The biggest difference between it and read-only memory (ROM) is the volatility of data, that is, once the power is off, the stored data will be lost. RAM is used in computers and digital systems to temporarily store programs, data and intermediate results. Here it mainly refers to the running memory provided in the security chip.

[0033] NVM: Non-volatile memory, non-volatile memory, has the characteristics of non-volatility, byte-by-byte access, high storage density, and low energy consumption. Its read and write performance is close to dynamic random access memory (DRAM), but the read and write speeds are asymmetric and the life span is limited. Here it mainly refers to the storage that can provide data persistence provided by the security chip.

[0034] JCVM: JavaCard Virtual Machine, Java Card virtual machine, the main function is to realize bytecode parsing and processing execution.

[0035] JCRE: JavaCard Runtime Environment, Java Card runtime environment, responsible for related context environment processing, state preservation and switching, and providing required operation support in addition to JCVM.

[0036] GP: GlobalPlatform, an international standards organization, has corresponding standards and specifications for telecommunications, Java cards, finance, etc.

[0037] OPEN: An open environment defined by GP that supports security domain management, Java Applet installation management, permission management, etc.

[0038] HAL: Hardware Abstract Layer, hardware abstraction layer, abstracts and unifies different hardware interfaces.

[0039] Framework: System framework, which is mainly the system layer and provides various system services.

[0040] IO: Input / Output, input and output, here mainly refers to the input and output processing module of the hardware layer.

[0041] SD: Secure Domain.

[0042] ISD-R: Root security domain application, responsible for Profile download process management, information query management, card management, etc. in the eUICC card.

[0043] ISD-P: Profile security domain, responsible for the information management of each individual Profile in the eUICC card, including the Profile's core data, file system, applications, etc.

[0044] ECASD: Security authentication and authorization security domain, responsible for the management of certificates and keys in the eUICC card, as well as corresponding signing, signature verification, encryption and decryption, certificate verification and other functions.

[0045] APDU: application protocol data unit, application protocol data unit, is the communication instruction format definition at the application level in the SIM card.

[0046] API: Application Programming Interface, application programming interface.

[0047] NVMM: NVM Manager, responsible for implementing transaction processing based on NVM.

[0048] Dispatcher: Distribution management, responsible for system-level processing and distribution of instructions.

[0049] Install: Installation, here specifically refers to the installation of JavaCard-related GP functions, such as installing Java Applets.

[0050] JC API: JavaCard API, which is the application programming interface needed to develop Java Applets.

[0051] JC Function Restrict: JavaCard function restrictions.

[0052] AES: A symmetric encryption algorithm used to encrypt APDU command data for communication between PC production line tools and COS.

[0053] RSA: An asymmetric encryption algorithm used to encrypt AES keys.

[0054] Currently, the operating systems of smart card security chips mainly include Native COS and JavaCard COS. Among them, Native COS is developed and implemented using C language, with high execution efficiency, small card issuance space consumption and low cost. For example, the architecture of Native COS can be shown in Table 1 below.

[0055] Table 1

[0056] Native Application: USIM Native Card OS Hardware Driver&Interface SE Chip

[0057] Among them, the bottom layer can be developed based on the SE chip (SE Chip), and the basic bottom-related operations can be completed by using the hardware-based IO, RAM, NVM, Crypto and other operation interfaces provided by the chip itself, and then encapsulated into the hardware driver or hardware interface layer inside the OS; the operating system corresponding to the application scenario is developed based on the hardware interface layer (Hardware Driver & Interface), and different application scenarios may have different requirements for the system services that the operating system needs to provide, such as the telecom USIM needs to have the SIM card file system processing capability, basic encryption and decryption and authentication algorithm capabilities, etc.; the top layer is equivalent to the application layer, which can be SIM, USIM, or custom applications to implement the business logic of specific application scenarios. In specific implementation, the Native Card OS layer is dispatched to specific applications for processing, and the application is responsible for the processing of the entire process, but the specific execution of a certain part of the logic will call the capabilities and services provided by the corresponding Native Card OS and hardware interface.

[0058] However, Native COS is developed and implemented entirely in C language, and may use some assembly language depending on the chip. It does not support post-update applications or Java Applets. Therefore, it is difficult to migrate applications written under the above architecture to different chip platforms, and they are not unified and cannot be interconnected.

[0059] At the same time, the operating system of smart card security chips also includes JavaCard COS. Common USIM cards in the general telecommunications field, and industry application smart cards in the fields of finance and transportation all use JavaCard COS, such as NXP's eSE chip and Qualcomm's baseband chip SPU. JavaCard COS has the advantages of flexibility, scalability, and interoperability in accordance with standard specifications. For example, the architecture of JavaCard COS can be shown in Table 2 below.

[0060] Table 2

[0061]

[0062] The implementation methods and specific functions of the above-mentioned bottom layer (SE Chip) and hardware interface layer (Hardware Driver & Interface) can refer to the relevant descriptions of the bottom layer (SE Chip) and hardware interface layer (Hardware Driver & Interface) in the above-mentioned Native COS architecture; the JavaCard COS OS layer needs to parse, process, and execute bytecodes through JCVM and JCRE, as well as the life cycle management, context environment retention and switching, access control isolation, etc. required by the corresponding Java Applet; at the same time, in order to ensure the universality and security processing of different Java Applets, the GP part and the corresponding OPEN environment system services are implemented and built to handle the installation, key management, access authorization management, selection and channel management instructions of Java Applet and instruction distribution; the top layer is equivalent to the application layer, which can be SIM, USIM, financial wallet application, bus card application, or customized personalized application implemented by JC API, etc., which is used to implement the business logic of specific application scenarios. In eUICC, it will be corresponding applications such as ISD-R, ISD-P, ECASD, etc., or it can be a JavaApplet downloaded later. Java Applet can be implemented using the corresponding packaged JC API, without worrying about the underlying and hardware interfaces; the Applet here can be highly portable and can be installed and run on different JavaCards with just one compilation. In addition, the underlying and middle layers are mostly developed using C language, while the application layer can be developed using Java language based on JavaCard API, and supports post-download Java Applet applications.

[0063] Since Native COS and JavaCard COS each have their own advantages and application scenarios, the two COS currently coexist independently in the industry to meet the usage needs of different customers. For smart card production lines, different hardware production processes need to be adopted for Native COS and JavaCard COS, which will undoubtedly increase the operational burden of the production line and reduce the production efficiency of the production line. In order to solve the problem of low production efficiency of smart card production lines caused by the independent coexistence of the existing two sets of COS architectures, the embodiments of the present invention provide a method and device for dynamic switching between Native and JavaCard, which are described in detail below.

[0064] Figure 1 A flowchart of a method for dynamically switching between Native and JavaCard provided in an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method of this embodiment may include:

[0065] S101, writing the compiled firmware version into the security chip, the firmware version is developed based on the compatible system architecture including Native COS and JavaCard COS, and the compatible system architecture is compatible with Native and JavaCard in a decoupled manner.

[0066] The executor of the embodiment of the present invention is an electronic device. In specific implementation, all functions supported by Native COS and JavaCardCOS are packaged and compiled, and the compiled firmware version is written into the security chip.

[0067] S102: Obtain the personalized status of the root security domain in the firmware version.

[0068] S103: If the personalization state indicates that the root security domain has not performed a personalization operation, a control instruction is sent to the security chip, so that the security chip implements dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction.

[0069] Optionally, if the personalization status indicates that the root security domain has been personalized, the corresponding COS dynamic switching cannot be performed on the security chip.

[0070] The method for dynamic switching between Native and JavaCard provided in an embodiment of the present invention includes writing a compiled firmware version into a security chip, the firmware version includes Native COS and JavaCard COS based on a compatible system architecture, and the compatible system architecture is compatible with Native and JavaCard in a decoupled manner; obtaining the personalized state of the root security domain in the firmware version; if the personalized state indicates that the root security domain has not been personalized, sending a control instruction to the security chip so that the security chip implements dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction. Since the compatible system architecture is compatible with both Native COS and JavaCard COS in a decoupled manner, the same content in Native COS and JavaCardCOS does not need to be repeatedly developed, so that the compatible system architecture has strong scalability, is easy to maintain and upgrade iteratively, thereby improving the COS development efficiency and version iteration speed, and reducing the R&D cost and cycle; and, the dynamic switching between Native COS and JavaCard COS in the firmware version is implemented through the control instruction, which greatly enhances the reusability of the production line production hardware, thereby improving the production line production efficiency of the smart card.

[0071] As an achievable method, the root security domain of the above firmware version may be preset with a JavaCard restriction parameter during compilation, and when the JavaCard restriction parameter takes a first preset value, it is used to indicate that the firmware version adopts JavaCard COS, and when the JavaCard restriction parameter takes a second preset value, it is used to indicate that the firmware version adopts NativeCOS. In addition, the control instruction may adopt an application protocol data unit format, including a first control instruction and a second control instruction, the first control instruction is used to set the JavaCard restriction parameter to the first preset value, and the second control instruction is used to set the JavaCard restriction parameter to the second preset value.

[0072] In specific implementation, when the JavaCard restriction parameter value is the first preset value, the firmware version adopts JavaCard COS. At this time, the control instruction sent by the electronic device may include a second control instruction. Then, the security chip can set the JavaCard restriction parameter to the second preset value according to the second control instruction, thereby realizing the switch from JavaCard COS in the firmware version to Native COS; when the JavaCard restriction parameter value is the second preset value, the firmware version adopts Native COS. At this time, the control instruction sent by the electronic device may include a first control instruction. Then, the security chip can set the JavaCard restriction parameter to the first preset value according to the first control instruction, thereby realizing the switch from Native COS in the firmware version to JavaCard COS.

[0073] The following is an example of a specific implementation method for setting the above JavaCard restriction parameters, as shown in the following Table 3.

[0074] Table 3

[0075]

[0076]

[0077] Among them, Data is the above-mentioned JavaCard restriction parameter. When "XX XX" in Data is set to "0x00 0x00", it indicates that the JavaCard function is disabled, which can correspond to the above-mentioned "second control instruction is used to set the JavaCard restriction parameter to the second preset value", that is, "0x00 0x00" can correspond to the second preset value, and is used to indicate that the firmware version adopts NativeCOS; when "XX XX" in Data is set to "0xFF 0xFF", it indicates that the JavaCard function is enabled, which can correspond to the above-mentioned "first control instruction is used to set the JavaCard restriction parameter to the first preset value", that is, "0xFF 0xFF" can correspond to the first preset value, and is used to indicate that the firmware version adopts JavaCard COS.

[0078] As an implementable manner, the control instruction may further include a third control instruction, and the third control instruction is used to obtain the value of the JavaCard restriction parameter, so as to obtain the COS adopted by the firmware version according to the value of the JavaCard restriction parameter. The third control instruction is illustrated below with an example of a specific implementation manner, as shown in Table 4 below.

[0079] Table 4

[0080]

[0081]

[0082] When "XX XX" in Data is set to "0xFF44", it can represent the value of the JavaCard restriction parameter to be obtained; when "XX XX" in Data is set to "0x00", it can represent the length of the value of the JavaCard restriction parameter to be obtained.

[0083] Optionally, when the security chip receives the third control instruction, assuming that the "XX XX" part in the DATA returned to the electronic device is "0x00 0x00", the value of the JavaCard restriction parameter is the second preset value, that is, the firmware version uses Native COS; assuming that the "XX XX" part in the DATA returned to the electronic device is "0xFF 0xFF", the value of the JavaCard restriction parameter is the first preset value, that is, the firmware version uses JavaCard COS. Specifically, as shown in Table 5 below.

[0084] Table 5

[0085]

[0086] Based on the above embodiment 1, Figure 2 A flowchart of a second embodiment of a method for dynamically switching between Native and JavaCard provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the method of this embodiment may include:

[0087] S201, write the compiled firmware version into the security chip.

[0088] Among them, the firmware version is developed based on the compatible system architecture, including Native COS and JavaCard COS. The compatible system architecture is compatible with Native and JavaCard in a decoupled manner.

[0089] S202: Obtain the personalized status of the root security domain in the firmware version.

[0090] S203: If the personalization status indicates that the root security domain has not performed a personalization operation, a random symmetrically encrypted session key is generated.

[0091] In specific implementation, a key agreement algorithm may be used to generate a random symmetric encryption session key, where the key agreement algorithm may include an elliptic curve key agreement algorithm (Elliptic Curve Diffie-Hellman keyExchange, ECDH) and an RSA algorithm.

[0092] S204: Encrypt the session key using the asymmetric encryption private key.

[0093] S205, sending the session key ciphertext to the security chip, so that the security chip obtains the session key plaintext from the session key ciphertext according to the asymmetric encryption public key corresponding to the asymmetric encryption private key preset in the firmware version.

[0094] S206: Use the session key to encrypt the control instruction.

[0095] S207, sending the control instruction ciphertext to the security chip, so that the security chip decrypts the control instruction ciphertext according to the obtained session key plaintext to obtain the control instruction plaintext, and implements dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction plaintext.

[0096] The method for dynamically switching between Native and JavaCard provided in the embodiment of the present invention strengthens the security of establishing a data channel between the electronic device and the security chip through the above encryption and decryption mechanism, and can effectively avoid problems such as information cloning and replay attacks.

[0097] As a feasible method, in the above-mentioned second embodiment, the physical component of U-shield can be used for encryption and decryption. The physical component of U-shield is used to generate random symmetric encrypted session keys and asymmetric encrypted key pairs. The physical component of U-shield has the security feature of self-destruction of key disassembly to prevent malicious exposure and disassembly to obtain the key stored in the physical component of U-shield, thereby breaking the dynamic switching function of COS by stealing or imitating ciphertext data.

[0098] As an implementable manner, in the above-mentioned second embodiment, the session key may also include an Advanced Encryption Standard AES key, the asymmetric encryption private key includes an RSA private key, and the asymmetric encryption public key includes an RSA public key.

[0099] Based on the above-mentioned second embodiment, Figure 3 A flowchart of a method for dynamically switching between Native and JavaCard provided in an embodiment of the present invention is shown in FIG. Figure 3 As shown, after executing S207, the method of this embodiment may include:

[0100] S301, receiving the execution result ciphertext sent by the security chip.

[0101] The execution result ciphertext may be generated by encrypting the execution result using the session key by the security chip, and the execution result is the execution result of the security chip dynamically switching between Native COS and JavaCard COS in the firmware version according to the control instruction. For example, the execution result may be switching Native COS in the firmware version to JavaCard COS, or the execution result may also be switching JavaCard COS in the firmware version to Native COS.

[0102] S302, decrypt the execution result ciphertext using the session key to obtain the execution result plaintext.

[0103] S303, generating user prompt information in plain text according to the acquired execution result.

[0104] In a specific implementation, when the execution result is to switch the Native COS in the firmware version to the JavaCard COS, the user prompt information may be information indicating that the Native COS in the firmware version has been switched to the JavaCard COS; or, when the execution result is to switch the JavaCard COS in the firmware version to the Native COS, the user prompt information may be information indicating that the JavaCard COS in the firmware version has been switched to the Native COS.

[0105] The method for dynamic switching between Native and JavaCard provided in an embodiment of the present invention receives the execution result ciphertext sent by the security chip; uses the session key to decrypt the execution result ciphertext to obtain the execution result plaintext; generates user prompt information according to the obtained execution result plaintext, and can show the execution result of the COS state in the firmware version to the user.

[0106] As a possible way to achieve this, Figure 4 A schematic diagram of a compatible system architecture provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the compatible system architecture in the embodiment of the present invention may include a hardware abstraction layer, a system layer and an application layer.

[0107] Among them, the hardware abstraction layer can be used to adapt and encapsulate the interface provided by the security chip, and provide the system layer with a unified interface for using the security chip; the system layer can be used to provide system services to the application layer, including the dispatch module, the Native module and the JavaCard module; the application layer can be used to provide industry applications, including Native applications and JavaCard applications. Among them, the dispatch module can be used to dispatch data belonging to the Native application to the Native module for processing, and dispatch data belonging to the JavaCard application to the JavaCard module for processing.

[0108] The following takes two specific security chips as examples to explain the compatible system architecture and the method for dynamic switching between Native and JavaCard in the embodiment of the present invention:

[0109] First, taking the Infineon SLE97 security chip as an example, the eUICC COS is implemented through the compatible system architecture shown in Table 6 below, as shown in Table 6 below.

[0110] Table 6

[0111]

[0112]

[0113] (1) The bottom layer builds the hardware abstraction layer (HAL). After general abstraction, HAL is decoupled into different modules: non-volatile memory NVM, Crypto (a cryptographic library), output processing module IO, random access memory RAM, and log LOG. HAL can provide the system layer with a unified interface for using security chips, which is transparent to the layers above HAL, so that the upper-level OS and applications are unaware of different chip hardware interfaces. The specific implementation of all unified interfaces of HAL is adapted and encapsulated using the interfaces provided by SLE97.

[0114] (2) The middle layer builds the system layer (Framework), which can provide system services, abstract the system services and functions common to telecommunications and eUICC cards to achieve code reuse, and provide the application layer calling interface upward. Among them, the system layer of Native COS includes: Auth, ProfileMgr, PPI, PPE, RFM, OTA, APDU, CAT, Channel, Dispatcher, FileSystem, and NVM manager NVMM; the system layer of JavaCard COS includes: RAM, GP OPEN, GP Amd, GP API, USIM API, JC API, UICC API, JCVM, and JCRE.

[0115] (3) The top layer builds the application layer (Application) to implement the applications required by telecommunications and eUICC. The application layer of Native COS includes: root security domain application ISD-R, UICC card, profile security domain ISD-P, security authentication and authorization security domain ECASD, USIM card and solid state drive (SSD); the application layer of JavaCard COS includes: Java Applet.

[0116] (4) The entry and exit of the lowest level are in the IO of HAL, and then the transport layer communication protocol is parsed and given to the dispatch module Dispatcher implemented by NativeCOS for distribution. If it is determined that Java Applet needs to be supported, the dispatch module Dispatcher will dispatch the data belonging to the JavaCard application to GP OPEN and the corresponding JCVM, JCRE, etc. for processing, otherwise the data will be dispatched to the corresponding module of the Native COS system layer for processing. In the specific implementation, through dynamic switching, the privately defined APDU instruction format is adopted, and the encryption, decryption and signature verification of the corresponding APDU content are added. Only after the signature verification and decryption are successfully passed, can the feature support of the dynamic switch Java Applet be supported from the outside.

[0117] (5) Since the NVM manager NVMM, FileSystem module, application protocol data unit APDU and channel management module Channel may be used regardless of whether Java Applet is supported, the above modules can be reused. And after flexible distinction, if Java Applet needs to be supported, corresponding association calls and additional processing can be performed.

[0118] (6)GP OPEN support is also determined by whether JavaCard is supported and is a decoupled and optional configuration. JCVM, JCRE and the corresponding various API packages and RAM application support are fully decoupled. If Java Applet is not supported, it can be flexibly switched; if Java Applet is supported, it can participate in the operation of the entire business process.

[0119] (7) Supports post-download of Java Applets and loading and installing Applets together with Profile download, and supports installation of security domain SD.

[0120] When implementing eUICC COS through the compatible system architecture shown in Table 6 above, the functions that JavaCard COS can implement mainly include: downloading JavaCard Package, installing JavaCard Applet, and obtaining JavaCard related information through GP related commands. The above JavaCard functions can all be provided by GP standard commands. Specifically, the commands in GP that support the above functions are shown in Table 7 below.

[0121] Table 7

[0122]

[0123] If you need to disable the JavaCard function and only implement Native COS, you can add restrictions on card content management related functions to achieve the purpose of enabling / disabling the JavaCard function. The specific implementation method can be:

[0124] (1) JavaCard restriction parameters are stored in ISD-R and are preset during compilation. They can be modified before the ISD-R is personalized (Personalize), but cannot be modified after Personalize.

[0125] (2) The Store Data command in ISD-R adds support for private TAG (JC Function Restrict) to set and query JC Function Restrict;

[0126] (3) When using the Store Data command to modify, check whether the ISD-R is personalized. If it is personalized, the corresponding error is returned;

[0127] (4) The card content management related implementation adds the judgment of JC Function Restrict. If it is disabled, the command is not allowed to execute.

[0128] The specific disabling process may be:

[0129] 1) Select ISD-R;

[0130] 2) Check the current support status, Store Data (Get JC Function Restrict);

[0131] 3) Send Store Data (Disable JC Function).

[0132] The specific activation process can be:

[0133] 1) Select ISD-R;

[0134] 2) Check the current support status, Store Data (Get JC Function Restrict);

[0135] 3) Send Store Data (Enable JC Function).

[0136] For the private instruction design for dynamically switching JavaCard COS and Native COS on the production line and the security design for dynamically switching JavaCard COS and Native COS on the production line, etc., reference may be made to the relevant description of the aforementioned embodiments.

[0137] Secondly, taking the HuaDa 98M25 security chip as an example, the universal JavaCard COS is implemented through the compatible system architecture shown in Table 8 below.

[0138] Table 8

[0139]

[0140] (1) The bottom layer builds the hardware abstraction layer (HAL). After general abstraction, HAL is decoupled into different modules: NVM, Crypto, IO, RAM, and LOG. HAL can provide the system layer with a unified interface for using security chips. It is transparent to the layers above HAL, so that the upper-layer OS and applications are unaware of the different chip hardware interfaces. The specific implementation of all unified interfaces of HAL is adapted and encapsulated using the interfaces provided by HuaDa 98M25, including C and assembly calls.

[0141] (2) The middle layer builds the system layer (Framework), which can provide system services, abstract the common system services and functions of different industries such as telecommunications to achieve code reuse, and provide a calling interface for the application layer. Among them, the system layer of Native COS includes: financial system services, security services, other services, industry services, APDU, Channel, Dispatcher, FileSystem and NVMM; the system layer of JavaCard COS includes: GP OPEN, GP Amd, GP API, financial API, JC API, telecommunications API, JCVM and JCRE.

[0142] (3) The top layer is the application layer, which implements applications required by telecommunications and other industries. The application layer of Native COS includes finance, telecommunications, transportation, and others; the application layer of JavaCard COS includes JavaApplet.

[0143] (4) The entry and exit of the lowest level are in the IO of HAL, and then the transport layer communication protocol is parsed and distributed to the dispatch module Dispatcher implemented by NativeCOS. If it is determined that Java Applet support is required, the dispatch module Dispatcher will dispatch the data belonging to the JavaCard application to GP OPEN and the corresponding JCVM, JCRE, etc. for processing; otherwise, the data will be dispatched to the corresponding module of the Native COS system layer for processing; in specific implementation, through dynamic switches, a privately defined APDU instruction format is adopted, and encryption, decryption and signature verification of the corresponding APDU content are added. Only after the signature verification and decryption are successful, can the feature support of the dynamic switch Java Applet be supported from the outside. In addition, when JavaCard and Java Applet support are needed, the corresponding code logic can be determined through macro definition and configuration switch. If the version support feature is determined at compile time, the corresponding part of the code can be not compiled in to reduce the space occupied by the final version and reduce redundancy.

[0144] (5) Since the NVM manager NVMM, FileSystem module, application protocol data unit APDU and channel management module Channel may be used regardless of whether Java Applet is supported, the above modules can be reused. And after flexible distinction, if Java Applet needs to be supported, corresponding association calls and additional processing can be performed.

[0145] (6)GP OPEN support is also determined by whether JavaCard is supported and is a decoupled and optional configuration. JCVM, JCRE and the corresponding various API packages and RAM application support are fully decoupled. If Java Applet is not supported, it can be flexibly switched; if Java Applet is supported, it can participate in the operation of the entire business process.

[0146] (7) Supports post-download of Java Applets and loading and installing Applets together with Profile download, and supports installation of security domain SD.

[0147] (8) Different implementations can be provided at the system layer and application layer for application scenarios in different industries. For example, since the requirements of GP in the telecommunications and financial industries are different, different implementations are needed, that is, different APIs need to be provided for Java Applet to call. Correspondingly, the system layer, application layer, Java API part, and Java Applet part all require implementations of their respective industries.

[0148] For the main design of disabling the JavaCard function, the private instruction design of dynamically switching JavaCard COS and Native COS, the security design of dynamically switching JavaCard COS and Native COS on the production line, etc., please refer to the relevant description of the aforementioned embodiments.

[0149] In addition, corresponding to the method for dynamic switching between Native and JavaCard provided in the above embodiment, an embodiment of the present invention further provides an electronic device, which may include: a memory for storing programs; a processor for implementing the method for dynamic switching between Native and JavaCard provided in the embodiment of the present invention by executing the programs stored in the memory.

[0150] In addition, corresponding to the method for dynamic switching between Native and JavaCard provided in the above embodiment, the embodiment of the present invention also provides a computer-readable storage medium, which includes a program, and the program can be executed by a processor to implement the method for dynamic switching between Native and JavaCard provided in the embodiment of the present invention.

[0151] This document is described with reference to various exemplary embodiments. However, those skilled in the art will recognize that changes and modifications may be made to the exemplary embodiments without departing from the scope of this document. For example, various operating steps and components for performing the operating steps may be implemented in different ways (e.g., one or more steps may be deleted, modified, or incorporated into other steps) depending on the specific application or considering any number of cost functions associated with the operation of the system.

[0152] In addition, as will be appreciated by those skilled in the art, the principles of the present invention may be reflected in a computer program product on a computer-readable storage medium, which is pre-installed with a computer-readable program code. Any tangible, non-temporary computer-readable storage medium may be used, including magnetic storage devices (hard disks, floppy disks, etc.), optical storage devices (CD-ROMs, DVDs, Blu Ray disks, etc.), flash memory, and / or the like. These computer program instructions may be loaded onto a general-purpose computer, a special-purpose computer, or other programmable data processing device to form a machine, so that these instructions executed on a computer or other programmable data processing device may generate a device that implements a specified function. These computer program instructions may also be stored in a computer-readable memory, which may instruct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory may form a manufactured product, including an implementation device that implements a specified function. The computer program instructions may also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device may provide steps for implementing a specified function.

[0153] Although the principles of this invention have been shown in various embodiments, many modifications of structures, arrangements, proportions, elements, materials and components particularly suitable for specific environments and operational requirements can be used without departing from the principles and scope of this invention. The above modifications and other changes or amendments will be included in the scope of this invention.

[0154] The foregoing specific description has been described with reference to various embodiments. However, those skilled in the art will recognize that various modifications and changes can be made without departing from the scope of the present disclosure. Therefore, the consideration of the present disclosure will be illustrative rather than restrictive, and all these modifications will be included in its scope. Similarly, the advantages, other advantages and solutions to the problems of various embodiments have been described above. However, the benefits, advantages, solutions to the problems and any elements that can produce these, or make them more clear, should not be interpreted as critical, necessary or necessary. The term "include" and any other variants used in this article are all non-exclusive inclusions, so that the process, method, article or device including the list of elements not only includes these elements, but also includes other elements that are not explicitly listed or do not belong to the process, method, system, article or device. In addition, the term "coupled" and any other variants used in this article refer to physical connections, electrical connections, magnetic connections, optical connections, communication connections, functional connections and / or any other connections.

[0155] Those skilled in the art will appreciate that many changes may be made to the details of the above-described embodiments without departing from the basic principles of the invention. Therefore, the scope of the invention should be determined from the following claims.

Claims

1. A method for dynamically switching between Native and JavaCard, characterized in that: include: Writing the compiled firmware version into the security chip, wherein the firmware version is developed based on a compatible system architecture and includes Native COS and JavaCard COS, and the compatible system architecture is compatible with Native and JavaCard in a decoupled manner; a JavaCard restriction parameter is preset in the root security domain of the firmware version during compilation, and when the JavaCard restriction parameter takes a first preset value, it is used to indicate that the firmware version adopts JavaCard COS, and when the JavaCard restriction parameter takes a second preset value, it is used to indicate that the firmware version adopts Native COS; Obtaining a personalized status of a root security domain in the firmware version; If the personalization status indicates that the root security domain has not been personalized, generating a random symmetric encrypted session key, and encrypting the session key using an asymmetric encrypted private key; Sending the session key ciphertext to the security chip, so that the security chip obtains the session key plaintext from the session key ciphertext according to the asymmetric encryption public key corresponding to the asymmetric encryption private key preset in the firmware version; The control instruction is encrypted using the session key; the control instruction adopts an application protocol data unit format, including a first control instruction, a second control instruction and a third control instruction, the first control instruction is used to set the JavaCard restriction parameter to the first preset value, the second control instruction is used to set the JavaCard restriction parameter to the second preset value, and the third control instruction is used to obtain the value of the JavaCard restriction parameter; Sending a control instruction ciphertext to the security chip, so that the security chip decrypts the control instruction ciphertext according to the acquired session key plaintext to obtain the control instruction plaintext, and implements dynamic switching between Native COS and JavaCard COS in the firmware version according to the control instruction plaintext; receiving an execution result ciphertext sent by the security chip, wherein the execution result ciphertext is generated by encrypting the execution result by the security chip using the session key, and the execution result is an execution result of the security chip dynamically switching between Native COS and JavaCard COS in the firmware version according to the plain text of the control instruction; Decrypt the execution result ciphertext using the session key to obtain the execution result plaintext; Generate user prompt information in plain text according to the obtained execution result; Among them, a U-shield physical component is used for encryption and decryption. The U-shield physical component is used to generate a random symmetric encryption session key and an asymmetric encryption key pair. The U-shield physical component has the security feature of disassembling the key and self-destructing.

2. The method according to claim 1, characterized in that The session key includes an Advanced Encryption Standard AES key, the asymmetric encryption private key includes an RSA private key, and the asymmetric encryption public key includes an RSA public key.

3. The method according to any one of claims 1 to 2, characterized in that: The compatible system architecture includes a hardware abstraction layer, a system layer and an application layer; The hardware abstraction layer is used to adapt and encapsulate the interface provided by the security chip, and provide the system layer with a unified interface for using the security chip; The system layer is used to provide system services to the application layer, including a dispatch module, a Native module and a JavaCard module; The application layer is used to provide industry applications, including Native applications and JavaCard applications; The distribution module is used to distribute the data belonging to the Native application to the Native module for processing, and distribute the data belonging to the JavaCard application to the JavaCard module for processing.

4. An electronic device, characterized in that: include: Memory, used to store programs; A processor, configured to implement the method for dynamic switching between Native and JavaCard according to any one of claims 1 to 3 by executing the program stored in the memory.

5. A computer-readable storage medium, characterized in that: The method comprises a program which can be executed by a processor to implement the method for dynamic switching between Native and JavaCard as claimed in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for realizing smart card multi-service application

    CN101739755A

  • Security chip COS firmware updating method, server side, terminal and system

    CN106227503A

  • Application verification method and application verification system based on Java card

    CN106712964A

  • System architecture for Java+Native applications

    CN108664327A

  • Security of Java Card key objects

    DE102018115758A1