CN110366161A - Open chucking method, device, relevant device and storage medium - Google Patents

Open chucking method, device, relevant device and storage medium Download PDF

Info

Publication number
CN110366161A
CN110366161A CN201810319863.3A CN201810319863A CN110366161A CN 110366161 A CN110366161 A CN 110366161A CN 201810319863 A CN201810319863 A CN 201810319863A CN 110366161 A CN110366161 A CN 110366161A
Authority
CN
China
Prior art keywords
card
smart card
terminal
type
message format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810319863.3A
Other languages
Chinese (zh)
Other versions
CN110366161B (en
Inventor
陈国华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810319863.3A priority Critical patent/CN110366161B/en
Publication of CN110366161A publication Critical patent/CN110366161A/en
Application granted granted Critical
Publication of CN110366161B publication Critical patent/CN110366161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/183Processing at user equipment or user record carrier
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/20Transfer of user or subscriber data
    • H04W8/205Transfer to or from user equipment or user record carrier
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support
    • H04W8/265Network addressing or numbering for mobility support for initial activation of new user

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses one kind to open chucking method, device, terminal, smart card and storage medium.Wherein, the described method includes: correspondence native applications Program Interfaces (API) of the terminal by the calling terminal operating system, and the message format based on the case2 type in Application Protocol Data Unit (APDU) order, authentication information is obtained from smart card;The authentication information is sent to platform;The authentication information is for authenticating the smart card;Receive the card data that the platform is sent;The card data are sent after the platform is successful to the smart card authentication;By calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu smart card sends the card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein, the terminal can be by calling the API and the smart card to establish secure connection;The interaction of the terminal and smart card is realized by the secure connection established.

Description

Open chucking method, device, relevant device and storage medium
Technical field
The present invention relates in communication field of intelligent cards more particularly to one kind open chucking method, device, terminal, smart card and Storage medium.
Background technique
Subscriber identification module card (including UIM (User Identity Module) card and SIM (Subscriber Identity Module) card), it is the important physical mark of the mobile identity of user and the valuable source that operator grasps.With Family identification module card is an independent safety barrier, thereon can bearing safety relevant card application, as card shield ((i.e. by U-shield Function is realized on card) etc..
Currently, user self-help opens the mode of card, there are mainly two types of:
The first, utilizes User Identification Application Development Tools (STK) function of smart card (can be UIM card or SIM card) It carries out writing card, however there are security risks for this mode.
It second, carries out writing card using Open Mobile API, however this mode needs terminal to be integrated with Open Mobile API, however most of terminal is not integrated Open Mobile API, therefore is unfavorable for promoting.
In conclusion there is certain defect in the card mode of opening of the relevant technologies.
Summary of the invention
To solve existing technical problem, the embodiment of the present invention provides one kind and opens chucking method, device, terminal, intelligence Card and storage medium.
The technical solution of the embodiment of the present invention is achieved in that
The embodiment of the invention provides one kind to open chucking method, is applied to terminal, which comprises
By the correspondence native applications Program Interfaces (API, the Application that call the terminal operating system Programming Interface), and it is based on Application Protocol Data Unit (APDU, Application Protocol Data Unit) the message format of the case2 type in order obtains authentication information from smart card;
The authentication information is sent to platform;The authentication information is for authenticating the smart card;
Receive the card data that the platform is sent;The card data are sent out after the platform is successful to the smart card authentication It send;
By calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu smart card hair Send the card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The terminal and smart card Interaction by establish secure connection realize.
In above scheme, the message format based on the case2 type in APDU order obtains certification letter from smart card Breath, comprising:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;Institute It states initialization and writes card instruction and be used to indicate the smart card and enter the certification letter write card initialization state, and obtain the smart card Breath;
Receive the authentication information that the smart card is sent.
It is described to pass through the message format based on the case3 type in APDU order, Xiang Suoshu smart card hair in above scheme Send the card data, comprising:
Based on the message format of the case3 type in APDU order, Xiang Suoshu smart card, which is sent, carries the card data Write the instruction of card message.
In above scheme, the method also includes:
Receive the smart card return writes card execution state;The card execution state of writing that the smart card returns is to be based on What the message format of the case3 type in APDU order generated;
When it is described write card execute state representation described in writing smart card success when, based on the case2 type in APDU order Message format, Xiang Suoshu smart card send obtain writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
The embodiment of the invention also provides one kind to open chucking method, is applied to smart card, which comprises
Based on the message format of the case2 type in APDU order, authentication information is provided for terminal;The authentication information is used It is authenticated in the smart card;
Based on the message format of the case3 type in APDU order, the card data that the terminal is sent are received;
Using the card data, writing operation is carried out.
In above scheme, the message format based on the case2 type in APDU order provides certification letter for terminal Breath, comprising:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and return to the certification to the terminal and believe Breath.
In above scheme, the message format based on the case3 type in APDU order receives what the terminal was sent Card data, comprising:
Based on the message format of the case3 type in APDU order, the carrying card data that the terminal is sent are received Write card message instruction.
In above scheme, the method also includes:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;It is described to write Card executes the success of writing smart card described in state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card-like state Order;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
The embodiment of the present invention provides one kind again and opens card device, comprising:
Acquiring unit, for the primary API of correspondence by calling the terminal operating system, and based in APDU order The message format of case2 type obtains authentication information from smart card;The authentication information is sent to platform;The certification letter Breath is for authenticating the smart card;And receive the card data that the platform is sent;The card data are the platforms pair It is sent after the smart card authentication success;
First writes card unit, for by calling the API, and the message lattice based on the case3 type in APDU order Formula, Xiang Suoshu smart card send the card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The terminal and smart card Interaction by establish secure connection realize.
In above scheme, the acquiring unit is specifically used for:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;Institute It states initialization and writes card instruction and be used to indicate the smart card and enter the certification letter write card initialization state, and obtain the smart card Breath;
Receive the authentication information that the smart card is sent.
In above scheme, described first writes card unit, is specifically used for:
Based on the message format of the case3 type in APDU order, Xiang Suoshu smart card, which is sent, carries the card data Write the instruction of card message.
In above scheme, described first writes card unit, is also used to:
Receive the smart card return writes card execution state;The card execution state of writing that the smart card returns is to be based on What the message format of the case3 type in APDU order generated;
When it is described write card execute state representation described in writing smart card success when, based on the case2 type in APDU order Message format, Xiang Suoshu smart card send obtain writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
The embodiment of the invention also provides one kind to open card device, comprising:
Unit is provided and provides authentication information for the message format based on the case2 type in APDU order for terminal; The authentication information is for authenticating the smart card;
Second writes card unit, for the message format based on the case3 type in APDU order, receives the terminal and sends Card data;And the card data are utilized, carry out writing operation.
In above scheme, the offer unit is specifically used for:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and return to the certification to the terminal and believe Breath.
In above scheme, described second writes card unit, is specifically used for:
Based on the message format of the case3 type in APDU order, the carrying card data that the terminal is sent are received Write card message instruction.
In above scheme, described second writes card unit, is also used to:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;It is described to write Card executes the success of writing smart card described in state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card-like state Order;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
The embodiment of the present invention provides a kind of terminal again, comprising: first processor and for store can be described first The first memory of the computer program run on processor,
Wherein, the first processor is for executing when running the computer program:
By calling the primary mouth API of correspondence of the terminal operating system, and based on the case2 type in APDU order Message format obtains authentication information from smart card;
The authentication information is sent to platform;The authentication information is for authenticating the smart card;
Receive the card data that the platform is sent;The card data are sent out after the platform is successful to the smart card authentication It send;
By calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu smart card hair Send the card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The terminal and smart card Interaction by establish secure connection realize.
In above scheme, the first processor when for running the computer program, is executed:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;Institute It states initialization and writes card instruction and be used to indicate the smart card and enter the certification letter write card initialization state, and obtain the smart card Breath;
Receive the authentication information that the smart card is sent.
In above scheme, the first processor when for running the computer program, is executed:
Based on the message format of the case3 type in APDU order, Xiang Suoshu smart card, which is sent, carries the card data Write the instruction of card message.
In above scheme, the first processor when being also used to run the computer program, is executed:
Receive the smart card return writes card execution state;The card execution state of writing that the smart card returns is to be based on What the message format of the case3 type in APDU order generated;
When it is described write card execute state representation described in writing smart card success when, based on the case2 type in APDU order Message format, Xiang Suoshu smart card send obtain writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
The embodiment of the invention also provides a kind of smart cards, comprising: second processor and can be described for storing The second memory of the computer program run on two processors,
Wherein, the second processor is for executing when running the computer program:
Based on the message format of the case2 type in APDU order, authentication information is provided for terminal;The authentication information is used It is authenticated in the smart card;
Based on the message format of the case3 type in APDU order, the card data that the terminal is sent are received;
Using the card data, writing operation is carried out.
In above scheme, the second processor when for running the computer program, is executed:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and return to the certification to the terminal and believe Breath.
In above scheme, the second processor when for running the computer program, is executed:
Based on the message format of the case3 type in APDU order, the carrying card data that the terminal is sent are received Write card message instruction.
In above scheme, the second processor when being also used to run the computer program, is executed:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;It is described to write Card executes the success of writing smart card described in state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card-like state Order;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
The embodiment of the present invention provides a kind of storage medium again, is stored thereon with computer program, the computer program The step of above-mentioned terminal side either method is realized when being executed by processor, or realize the step of above-mentioned smart card side either method Suddenly.
Provided in an embodiment of the present invention to open chucking method, device, terminal, smart card and storage medium, terminal is by calling institute The primary API of correspondence of terminal operating system, and the message format based on the case2 type in APDU order are stated, is obtained from smart card Take authentication information;The authentication information is sent to platform by the terminal;And receive the card data that the platform is sent;Here, The card data are the platforms to sending after smart card authentication success, and the terminal is by calling the API, and base The message format of case3 type in APDU order, Xiang Suoshu smart card send the card data;The smart card receives card After data, writing operation is carried out using card data.Scheme provided in an embodiment of the present invention, by the primary of terminal operating system API realizes the interaction with smart card, and this interactive process has the protection of security mechanism, so, it is possible to guarantee to write to snap past journey Information do not obtained to other application, distort and delete, improve the safety for writing card, and using being widely popularized.Meanwhile passing through Card process is write in the combination realization of case2 and case3 type instruction, and case2 and case3 type instruction can be by the base band of terminal Chip accurately identifies, so that APP can accurately obtain implementing result from smart card, so, it is possible to greatly improve and writes card Success rate.
Detailed description of the invention
Fig. 1 is that chucking method flow diagram is opened in the terminal of that embodiment of the invention side;
Fig. 2 is that chucking method flow diagram is opened in smart card of embodiment of the present invention side;
Fig. 3 is that the embodiment of the present invention opens chucking method flow diagram;
Fig. 4 is that Application Example of the present invention opens card flow diagram;
Fig. 5 is Application Example intelligent card state schematic diagram of the present invention;
Fig. 6 one kind of the embodiment of the present invention opens card device structural schematic diagram;
Fig. 7 is that another kind of the embodiment of the present invention opens card device structural schematic diagram;
Fig. 8 is the terminal of that embodiment of the invention structural schematic diagram;
Fig. 9 is smart card architecture of embodiment of the present invention schematic diagram;
Figure 10 is subscriber identity module activating system of embodiment of the present invention structural schematic diagram.
Specific embodiment
The present invention is described in further detail again with reference to the accompanying drawings and embodiments.
Utilize smart card (can be UIM card or SIM)) the STK function process that carries out writing card include: using on smart card The address book function of STK, the application program (APP) of terminal write card instruction in the address list of STK, and then smart card obtains This is write card and instructs and execute writing operation, and writes communication specific region card result is write after the completion of writing card;The area APP Zai Conggai Domain obtains and writes card result.In this method, card and acquisition are write the result is that asynchronous process, APP needs periodically to obtain, and STK's is logical News record allows other APP to access, and there are other applications to obtain, deletes and distort the risk write card instruction and write card result.Also It is that there are security risks for book.
It is specifically included that using the process that Open Mobile API write card
The smart card (can be UIM card or SIM card) that Open Mobile API is provided sends the interface of APDU instruction, can To be supplied to third-party application calling, by calling Open Mobile API transmission to write card instruction, completion, which is write, snaps past journey;But Open Mobile API is third party's scheme of open source, needs to integrate in systems before terminal is dispatched from the factory, that is to say, that terminal Prefabricated Open Mobile API is needed before factory.Near-field communication (NFC, Near Field is removed on Vehicles Collected from Market Communication) terminal, most of terminal do not have Open Mobile API, therefore this card mode of opening is unfavorable for pushing away extensively Extensively.
On the other hand, the included API of some operating systems is capable of providing access smart card ((can be UIM card or SIM card) Deng) interface, in this way, third-party application can by call the API of these standards to smart card send APDU instruction realize with The interactive operation of card so, it is possible to solve the problems, such as that Open Mobile needs terminal to dispatch from the factory prefabricated and STK asynchronous interactive behaviour Make.
Meanwhile these interfaces are capable of providing forced symmetric centralization (ACE, Access Control Enforce) mechanism, i.e., Security mechanism is provided, in this mechanism, the APP that only authorizes on smart cards could by the API Access smart card, in this way, It is able to solve the existing risk for being obtained, deleting and being distorted instruction and result during writing card by other application of STK, that is, It says, can be improved the safety for writing card by this mechanism.
The third aspect needs to consider to improve the success rate for writing card, APDU order can be used to realize and write card.Wherein, APDU order there are four types of type format, be respectively: case1, case2, case3 and case4.Below to these four type commands It is analyzed.
There is no data to be sent to smart card in the order of case1 type, returns to terminal from smart card without data, so yet And have data interaction during writing card, between terminal and smart card, it is snapped past so such order is not suitable for writing Cheng Zhong.
There is no data to be sent in smart card in the order of case2 type, there are data to return from smart card, and the base of terminal Microarray strip platform can correctly handle the APDU instruction of case2 type.
There are data to be sent in smart card in the order of case3 type, is returned from smart card without data, and the base of terminal Microarray strip platform can correctly handle the APDU instruction of case3 type.
Existing data are sent in intelligent card in the order of Case4 type, also have data to return to terminal from smart card.It is right In such order, since the baseband chip of terminal is when handling the order of case4 type, the baseband chip of each manufacturer is deposited In individual difference, some baseband chips can not correctly handle the order of the type, so that APP can not be by prefabricated from intelligence Acquisition instruction implementing result on card, and then cause to be unable to complete writing operation using the instruction of case4 type.
Based on above-mentioned analysis, in various embodiments of the present invention: using the operating system for being capable of providing security mechanism API goes to interact with smart card, writes card process by the combination realization of case2 and case3 type instruction.
Scheme provided in an embodiment of the present invention is sticked into using the API and intelligence for the operating system for being capable of providing security mechanism Row interaction, so, it is possible to guarantee to write and snaps past the information of journey and do not obtain, distort and delete to other application, improve the safety for writing card Property, and utilize and be widely popularized.Meanwhile card process is write by the combination of case2 and case3 type instruction realization, and case2 and Case3 type instruction can be accurately identified by the baseband chip of terminal, so that APP can accurately obtain execution from smart card As a result, so, it is possible to greatly improve the success rate for writing card.
The embodiment of the invention provides a kind of card writing methods, are applied to terminal, as shown in Figure 1, this method comprises:
Step 101: the primary API of correspondence by calling the terminal operating system, and based on the case2 in APDU order The message format of type obtains authentication information from smart card;
Specifically, the message format based on the case2 type in APDU order, Xiang Suoshu smart card send initialization and write card Instruction;The initialization, which writes card instruction and is used to indicate smart card entrance, writes card initialization state, and obtains the smart card Authentication information.
Receive the authentication information that the smart card is sent.
That is, the message format that the format that card instructs is case2 type is write in the initialization.
Here, due to the message format that the format that the terminal is sent to the order of smart card is case2 type, The data structure for the authentication information that the smart card is sent be also it is corresponding with the message format of case2 type, can also manage Solution matches.
The terminal is with the avenues of communication of the smart card: the terminal calls the corresponding primary of itself operating system API is interacted by primary API with the baseband chip of the terminal, and baseband chip and the smart card communications.
The primary API can be understood as included (existing) API of the operating system.
Wherein, when practical application, the operating system can be Android (Android) or iOS etc..
When practical application, the smart card is blank card.
Step 102: the authentication information is sent to platform;
Here, the authentication information is for authenticating the smart card.
When practical application, the authentication information may include the empty calorie sequence number of the smart card, write card random number etc..
Step 103: receiving the card data that the platform is sent;
Here, the card data are sent after the platform is successful to the smart card authentication.
When practical application, the card data that the platform returns are encryptions, and the card data of encryption are sent to by the terminal Smart card is decrypted by the card to card data of intelligence, and carries out writing operation.
Step 104: by calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu Smart card sends the card data.
Here, the card data of transmission are used to carry out writing operation for the smart card.
It should be understood that the terminal can be by calling the API and the smart card to establish secure connection;It is described Terminal and the above-mentioned interactive process of smart card are realized by the secure connection established.
When practical application, as long as operating system is capable of providing security access mechanism.When practical application, this safe machine System can be it is diversified, such as: when calling the API, operating system the testing the APP for calling the API of terminal Card information is sent to smart card, and smart card verifies corresponding APP using verification information, after being proved to be successful, operating system Corresponding APP is allowed to call the API.
For another example: access control rule is stored on smart card, operating system obtains access control rule from smart card, when When calling the API, whether operating system judges to call the corresponding APP of the API to have pair using the access control rule obtained The access authority of smart card allows when determining that the corresponding APP has the access authority to smart card according to access control rule The corresponding APP calls the API.
Terminal and smart card are shown when operating system allows corresponding APP to call the API for above two example Between secure connection have built up.
It should be understood that security mechanism can also be that other way realizes that the embodiment of the present invention is to this when practical application It is not construed as limiting.
In one embodiment, message format of the terminal based on the case3 type in APDU order, Xiang Suoshu smart card Send carry the card data write the instruction of card message, with to the smart card sending card data.
That is, the format for writing the instruction of card message is the message format of case3 type.
When practical application, the smart card can be fed back to the terminal writes card execution state, whether to notify the terminal Write card success.
Based on this, in one embodiment, this method can also include:
What the terminal received that the smart card returns writes card execution state;What the smart card returned writes card execution state It is that the message format based on the case3 type in APDU order generates;
When it is described write card execute state representation described in writing smart card success when, the terminal is based in APDU order The message format of case2 type, Xiang Suoshu smart card, which sends to obtain, writes card status command;
The terminal receive the smart card based on it is described acquisition write card status command return write card-like state.
Here, the data structure for writing card-like state that the smart card returns is also opposite with the message format of case2 type It answers.
Accordingly, the embodiment of the invention also provides a kind of card writing methods, are applied to terminal, as shown in Fig. 2, this method packet It includes:
Step 201: the message format based on the case2 type in APDU order provides authentication information for terminal;
Specifically, the message format based on the case2 type in APDU order receives the initialization that the terminal is sent and writes Card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and return to the certification to the terminal and believe Breath.
That is, the smart card receive initialization write card instruction after, into card initialization state is write, to wait The corresponding order of card data for stating terminal transmission, becomes a shareholder and receives other orders, then the smart card then enters idle (idle) State.
Here, the authentication information is for authenticating the smart card.
Step 202: the message format based on the case3 type in APDU order receives the card data that the terminal is sent;
Specifically, the message format based on the case3 type in APDU order receives described in the carrying that the terminal is sent Card data write the instruction of card message.
When practical application, the received card data of smart card are encryptions, need that the card data of encryption are decrypted, Then writing operation is carried out again.
Step 203: utilizing the card data, carry out writing operation.
When practical application, the smart card can be fed back to the terminal writes card execution state, whether to notify the terminal Write card success.
Based on this, in one embodiment, this method can also include:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;It is described to write Card executes the success of writing smart card described in state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card-like state Order;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
The embodiment of the invention also provides a kind of card writing methods, as shown in figure 3, this method comprises:
Step 301: terminal passes through the primary API of correspondence for calling the terminal operating system, and based in APDU order The message format of case2 type obtains authentication information from smart card;
In other words, message format of the smart card based on the case2 type in APDU order, provides certification for terminal Information.
Step 302: the authentication information is sent to platform by the terminal;
Here, the authentication information is for authenticating the smart card.
Step 303: the terminal receives the card data that the platform is sent;
Here, the card data are sent after the platform is successful to the smart card authentication.
Step 304: the terminal is by calling the API, and the message lattice based on the case3 type in APDU order Formula, Xiang Suoshu smart card send the card data;
Step 305: after the smart card receives card data, carrying out writing operation using card data.
Wherein, the terminal can be by calling the API and the smart card to establish secure connection;The terminal and intelligence The interaction that can block is realized by the secure connection established.
It should be understood that terminal and the concrete processing procedure of smart card are as detailed above, which is not described herein again.
Provided in an embodiment of the present invention to open chucking method, terminal passes through the primary API of correspondence for calling the terminal operating system, And the message format based on the case2 type in APDU order, authentication information is obtained from smart card;The terminal is by the certification Information is sent to platform;And receive the card data that the platform is sent;Here, the card data are the platforms to the intelligence What card was sent after authenticating successfully, the terminal is by calling the API, and the message based on the case3 type in APDU order Format, Xiang Suoshu smart card send the card data;After the smart card receives card data, carry out writing card behaviour using card data Make.Scheme provided in an embodiment of the present invention realizes the interaction with smart card, and this by the primary API of terminal operating system Kind of interactive process has the protection of security mechanism, so, it is possible to guarantee to write the information for snapping past journey do not obtained to other application, distort and It deletes, improves the safety for writing card, and utilize and be widely popularized.Meanwhile it being realized by the combination of case2 and case3 type instruction Card process is write, and case2 and case3 type instruction can be accurately identified by the baseband chip of terminal, so that APP can be from Smart card accurately obtains implementing result, so, it is possible to greatly improve the success rate for writing card.
In addition, in the whole process, smart card only receives specifically to instruct and just goes to carry out corresponding operation, in this way, into One step ensure that the safety for writing card.
The present invention is described in more detail below with reference to an Application Example.
In this application embodiment, illustrate by taking android system (Android5.1 or more) as an example.The embodiment of the present invention Scheme be to be realized by way of software, in this application embodiment, referred to as APP.Smart card can be SIM card, It can be UIM card etc..
It should be understood that APP has passed through the API of android system and smart card is established and pacified before carrying out writing card Full connection, that is to say, that the APP is the APP authorized on smart card, i.e., with the APP of access authority, android system permission APP calls API.
This application embodiment writes the process of card, as shown in Figure 4, comprising the following steps:
Step 401:APP writes card instruction to the initialization that smart card sends case2 type format;
Wherein, card instruction (APDU instruction)-B5010000 instruction format definition such as table are write in the initialization of case2 type format Shown in 1:
Table 1
Step 402: after smart card receives the instruction, into writing card initialization state, and the card for writing card needs is returned to APP Piece information;
Here, the card image for writing card needs is authentication information.
When practical application, the card image may include: empty calorie sequence number, write card random number etc..
The data structure that smart card accordingly returns to card image is as shown in table 2:
Table 2
Here, when practical application, smart card can utilize empty calorie sequence number and write the two dispersion factors of card random number and card The skey of piece generate write the encryption of card packet name write card session code key, be used for subsequent decryption card data.
After step 403:APP receives card image, to the card image for writing card platform transmission smart card;
Step 404: writing after card platform receives card image, the skey of the smart card, and benefit are found according to empty calorie sequence number Session code key is generated with empty calorie sequence number and the skey for writing two dispersion factors of card random number and the smart card, utilizes reply code key Add card for writing in invisibleness message, is then sent to APP;
Step 405:APP receive plus card for writing in invisibleness message after, to smart card send case3 type format card message of writing refer to It enables;
Here, it sends after writing the instruction of card message, shows that smart card enters and write card-like state.
Wherein the card message instruction-A50000XX+Data format of writing of case3 type format defines as shown in table 3:
Table 3
Code It is worth (Hex)
INS 0xA5
P1 0x00
P2 0x00
P3 0xXX:XX is the length of Data data
Data (Data) What encryption generated writes card message
Step 406: smart card receives write the instruction of card message after, the card data issued according to the instruction complete writing operation;
Specifically, smart card judges the 0xXX the byte whether length of Data in the instruction is P3, if writing card message Length is correct, is completed with the card data of the part Data in the session code key decryption command of generation in card data write-in smart card Writing operation.
Step 407: after smart card completes writing operation, writing card execution state to APP return;
Here, card is accordingly write to execute shown in status data structure table 4:
Table 4
Step 408: after APP receives 9E0X, APP writes card-like state life to the acquisition that smart card sends case2 type format It enables;
Here, card status command-A900000X is write in the acquisition of case2 type format, and wherein X just refers to the X in 9E0X, generation Table card returns the byte number accordingly returned.
Step 409: smart card receives after acquisition writes card status command, writes card-like state to APP return.
Here, it is as shown in table 5 that card status data structure is write accordingly:
Table 5
Return value Meaning
0x00+MAC check value Write card success
0x02+MAC check value It is wrong to write card data MAC
0x03+MAC check value Write card data exception (tag mistake etc.)
So far, it completes to write card process.In this process, APP is sticked by the API of calling android system with intelligence Row interaction.
In addition, in this process, as shown in figure 5, there are three states for smart card tool, specifically,
First state, after electrifying startup, smart card enters IDLE state;
Second state receives specific instruction in IDLE state smart card and (writes card initialization status command, specially B5010000 instruction) and after the completion of executing, into writing card initialization state;
Into after writing card initialization state, when card message instruction (i.e. A50000XX+Data instruction) is write in reception, write Card operation, enters third state after the completion.
If receiving other instructions, smart card returns to IDLE state.
Third state receives specific instruction when writing card initialization state and (writes the instruction of card message, i.e. A50000XX+ Data instruction), enter after the completion of executing and writes card completion status.
Wherein, when writing card completion status and receiving specific instruction (card status command, i.e. A900000X instruction are write in acquisition), It is available to writing card result.Card result loss is write after intelligent card power failure is restarted.
View of the above, it will be seen that scheme provided in an embodiment of the present invention, passes through case2 and case3 command in combination Mode realize and write card process;In this process, the security mechanism provided using operating system guarantees that APP is interacted with smart card The safety of information in the process does not need preset other third party's schemes before terminal is dispatched from the factory, so that it may realize the safety of the two Interaction, avoids distorting, deleting for information, in this way, using being widely popularized.And pass through case2 and case3 command in combination Mode, which is realized, writes card, entirely writes and snaps past the state protection mechanism that journey has rigorous interactive process and smart card, in this way, greatly improving Write the success rate of card.
The method of embodiment to realize the present invention, the embodiment of the invention also provides one kind to open card device, is arranged in terminal On, as shown in fig. 6, described device includes:
Acquiring unit 61, for the primary API of correspondence by calling the terminal operating system, and based in APDU order Case2 type message format, from smart card obtain authentication information;The authentication information is sent to platform;The certification Information is for authenticating the smart card;And receive the card data that the platform is sent;The card data are the platforms To what is sent after smart card authentication success;
First writes card unit 62, for by calling the API, and the message based on the case3 type in APDU order Format, Xiang Suoshu smart card send the card data;The card data of transmission are used to carry out writing operation for the smart card;Its In,
The terminal can be by calling the API and the smart card to establish secure connection;The terminal and smart card Interaction by establish secure connection realize.
Wherein, the terminal is with the avenues of communication of the smart card: the terminal calls the corresponding of itself operating system Primary API is interacted by primary API with the baseband chip of the terminal, and baseband chip and the smart card communications.
The primary API can be understood as included (existing) API of the operating system.
In one embodiment, the acquiring unit 61, is specifically used for:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;Institute It states initialization and writes card instruction and be used to indicate the smart card and enter the certification letter write card initialization state, and obtain the smart card Breath;
Receive the authentication information that the smart card is sent.
That is, the message format that the format that card instructs is case2 type is write in the initialization.
In one embodiment, described first card unit is write, is specifically used for:
Based on the message format of the case3 type in APDU order, Xiang Suoshu smart card, which is sent, carries the card data Write the instruction of card message.
That is, the format for writing the instruction of card message is the message format of case3 type.
When practical application, the smart card can be fed back to the terminal writes card execution state, whether to notify the terminal Write card success.
Based on this, in one embodiment, described first writes card unit 62, is also used to:
Receive the smart card return writes card execution state;The card execution state of writing that the smart card returns is to be based on What the message format of the case3 type in APDU order generated;
When it is described write card execute state representation described in writing smart card success when, based on the case2 type in APDU order Message format, Xiang Suoshu smart card send obtain writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
When practical application, the acquiring unit 61, first, which write card unit 62, to be realized by opening the processor in card device.
It should be understood that card device provided by the above embodiment of opening is when carrying out out card, only with above-mentioned each program module Division progress for example, in practical application, can according to need and distribute above-mentioned processing complete by different program modules At the internal structure of device being divided into different program modules, to complete all or part of processing described above.Separately Outside, provided by the above embodiment to open card device and open chucking method embodiment and belong to same design, the specific implementation process side of being detailed in Method embodiment, which is not described herein again.
The method of embodiment to realize the present invention, the embodiment of the invention also provides one kind to open card device, is arranged in intelligence On card, as shown in fig. 7, described device includes:
Unit 71 is provided, for the message format based on the case2 type in APDU order, provides certification letter for terminal Breath;The authentication information is for authenticating the smart card;
Second writes card unit 72, for the message format based on the case3 type in APDU order, receives the terminal hair The card data sent;And the card data are utilized, carry out writing operation.
In one embodiment, the offer unit 71, is specifically used for:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and return to the certification to the terminal and believe Breath.
In one embodiment, described second card unit 72 is write, is specifically used for:
Based on the message format of the case3 type in APDU order, the carrying card data that the terminal is sent are received Write card message instruction.
When practical application, the smart card can be fed back to the terminal writes card execution state, whether to notify the terminal Write card success.
Based on this, in one embodiment, described second writes card unit 72, is also used to:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;It is described to write Card executes the success of writing smart card described in state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card-like state Order;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
When practical application, the offer unit 71, second, which write card unit 72, to be realized by opening the processor in card device.
It should be understood that card device provided by the above embodiment of opening is when carrying out out card, only with above-mentioned each program module Division progress for example, in practical application, can according to need and distribute above-mentioned processing complete by different program modules At the internal structure of device being divided into different program modules, to complete all or part of processing described above.Separately Outside, provided by the above embodiment to open card device and open chucking method embodiment and belong to same design, the specific implementation process side of being detailed in Method embodiment, which is not described herein again.
Hardware realization based on above-mentioned apparatus, and in order to realize that the present invention implements the method for terminal side, the embodiment of the present invention A kind of terminal is additionally provided, as shown in figure 8, the terminal 80 includes:
First communication interface 81 can carry out information exchange with other equipment;
First processor 82 is connect with the first communication interface 81, information exchange is carried out with other equipment to realize, for transporting When row computer program, the method that above-mentioned terminal side one or more technical solution provides is executed.And it can be at described first The computer program run on reason device 82 is stored on first processor 81.
Specifically, the first processor 82 is for executing when running the computer program:
By calling the primary mouth API of correspondence of the terminal operating system, and based on the case2 type in APDU order Message format obtains authentication information from smart card;
The authentication information is sent to platform;The authentication information is for authenticating the smart card;
Receive the card data that the platform is sent;The card data are sent out after the platform is successful to the smart card authentication It send;
By calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu smart card hair Send the card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The terminal and smart card Interaction by establish secure connection realize.
In one embodiment, the first processor 82 when for running the computer program, executes:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;Institute It states initialization and writes card instruction and be used to indicate the smart card and enter the certification letter write card initialization state, and obtain the smart card Breath;
Receive the authentication information that the smart card is sent.
In one embodiment, the first processor 82 when for running the computer program, executes:
Based on the message format of the case3 type in APDU order, Xiang Suoshu smart card, which is sent, carries the card data Write the instruction of card message.
In one embodiment, the first processor 82 when being also used to run the computer program, executes:
Receive the smart card return writes card execution state;The card execution state of writing that the smart card returns is to be based on What the message format of the case3 type in APDU order generated;
When it is described write card execute state representation described in writing smart card success when, based on the case2 type in APDU order Message format, Xiang Suoshu smart card send obtain writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
The concrete processing procedure of the first processor 82 can refer to method to understand, which is not described herein again.
Certainly, when practical application, the terminal 80 can also include: user interface 84.Each group in the terminal 80 Part is coupled by bus system 85.It is understood that bus system 85 is for realizing the connection communication between these components.Always Linear system system 85 further includes power bus, control bus and status signal bus in addition in addition to including data/address bus.But in order to clear For the sake of explanation, various buses are all designated as bus system 85 in fig. 8.
Wherein, the number of the first processor 82 is at least one.
User interface 84 may include button, touch-sensitive plate or touch screen etc..
First memory 83 in the embodiment of the present invention is for storing various types of data to support the operation of terminal 80. The example of these data includes: any computer program for operating in terminal 80.
The method that the embodiments of the present invention disclose can be applied in the first processor 82, or by described first Processor 82 is realized.The first processor 82 may be a kind of IC chip, the processing capacity with signal.It is realizing In the process, each step of the above method can pass through the integrated logic circuit or software of the hardware in the first processor 82 The instruction of form is completed.The above-mentioned first processor 82 can be general processor, digital signal processor (DSP, Digital Signal Processor) either other programmable logic device, discrete gate or transistor logic, point Vertical hardware component etc..The first processor 82 may be implemented or execute disclosed each method, step in the embodiment of the present invention Rapid and logic diagram.General processor can be microprocessor or any conventional processor etc..In conjunction with the embodiment of the present invention The step of disclosed method, hardware decoding processor can be embodied directly in and execute completion, or in decoding processor Hardware and software module combination execute completion.Software module can be located in storage medium, which is located at the first storage The step of device 83, the first processor 82 reads the information in first memory 83, completes preceding method in conjunction with its hardware.
In the exemplary embodiment, terminal 80 can by one or more application specific integrated circuit (ASIC, Application Specific Integrated Circuit), DSP, programmable logic device (PLD, Programmable Logic Device), Complex Programmable Logic Devices (CPLD, Complex Programmable Logic Device), scene Programmable gate array (FPGA, Field-Programmable Gate Array), general processor, controller, microcontroller (MCU, Micro Controller Unit), microprocessor (Microprocessor) or other electronic components are realized, are used In execution preceding method.
Hardware realization based on above-mentioned apparatus, and in order to realize that the present invention implements the method for smart card side, the present invention is implemented Example additionally provides a kind of smart card, as shown in figure 9, the smart card 90 includes:
Second processor 91 and second depositing for storing the computer program that can be run in the second processor Reservoir 92,
Wherein, the second processor 91 is for executing when running the computer program:
Based on the message format of the case2 type in APDU order, authentication information is provided for terminal;The authentication information is used It is authenticated in the smart card;
Based on the message format of the case3 type in APDU order, the card data that the terminal is sent are received;
Using the card data, writing operation is carried out.
In one embodiment, the second processor 91 when for running the computer program, executes:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and return to the certification to the terminal and believe Breath.
In one embodiment, the second processor 91 when for running the computer program, executes:
Based on the message format of the case3 type in APDU order, the carrying card data that the terminal is sent are received Write card message instruction.
In one embodiment, the second processor 91 when being also used to run the computer program, executes:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;It is described to write Card executes the success of writing smart card described in state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card-like state Order;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
The concrete processing procedure of the second processor 91 can refer to method to understand, which is not described herein again.
Certainly, when practical application, the smart card 90 can also include the second communication interface 93, interact with terminal. Various components in the smart card 90 are coupled by bus system 94.It is understood that bus system 94 is for realizing this Connection communication between a little components.Bus system 94 further includes power bus, control bus and shape in addition to including data/address bus State signal bus.But for the sake of clear explanation, various buses are all designated as bus system 94 in Fig. 9.
Second memory 92 in the embodiment of the present invention is for storing various types of data to support the behaviour of smart card 90 Make.The example of these data includes: any computer program for operating on smart card 90.
The method that the embodiments of the present invention disclose can be applied in the second processor 91, or by described second Processor 91 is realized.The second processor 91 may be a kind of IC chip, the processing capacity with signal.It is realizing In the process, each step of the above method can pass through the integrated logic circuit or software of the hardware in the second processor 91 The instruction of form is completed.The above-mentioned second processor 91 can be general processor, DSP or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..The second processor 91 may be implemented or execute Disclosed each method, step and logic diagram in the embodiment of the present invention.General processor can be microprocessor or any Conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processing Device executes completion, or in decoding processor hardware and software module combination execute completion.Software module, which can be located at, deposits In storage media, which is located at second memory 92, and the second processor 91 reads the information in second memory 92, The step of completing preceding method in conjunction with its hardware.
In the exemplary embodiment, smart card 90 can be by one or more ASIC, DSP, PLD, CPLD, FPGA, general Processor, controller, MCU, Microprocessor or other electronic components are realized, for executing preceding method.
It is appreciated that the memory (first memory 83 and second memory 92) of the embodiment of the present invention can be volatibility Memory or nonvolatile memory may also comprise both volatile and non-volatile memories.Wherein, non-volatile memories Device can be read-only memory (ROM, Read Only Memory), programmable read only memory (PROM, Programmable Read-Only Memory), Erasable Programmable Read Only Memory EPROM (EPROM, Erasable Programmable Read- Only Memory), electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), magnetic RAM (FRAM, ferromagnetic random Access memory), flash memory (Flash Memory), magnetic surface storage, CD or CD-ROM (CD-ROM, Compact Disc Read-Only Memory);Magnetic surface storage can be magnetic disk storage or magnetic tape storage.It is volatile Property memory can be random access memory (RAM, Random Access Memory), be used as External Cache.It is logical It crosses exemplary but is not restricted explanation, the RAM of many forms is available, such as static random access memory (SRAM, Static Random Access Memory), synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), dynamic random access memory (DRAM, Dynamic Random Access Memory), synchronous dynamic Random access memory (SDRAM, Synchronous Dynamic Random Access Memory), Double Data Rate are same Walk dynamic random access memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), synchronized links dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), direct rambus random access memory (DRRAM, Direct Rambus Random Access Memory).The embodiment of the present invention description memory be intended to include but be not limited to these and it is any other It is suitble to the memory of type.
The method of embodiment to realize the present invention, the embodiment of the invention also provides a kind of subscriber identity module activating systems, as shown in Figure 10, The system includes:
Terminal 101, for the primary API of correspondence by calling the terminal operating system, and based in APDU order The message format of case2 type obtains authentication information from smart card 102;The authentication information is sent to platform;The certification Information is for authenticating the smart card;Receive the card data that the platform is sent;The card data are the platforms pair It is sent after the smart card authentication success;And by calling the API, and based on the case3 type in APDU order Message format, Xiang Suoshu smart card 102 send the card data;
The smart card 102 carries out writing operation using card data after receiving card data.
It should be understood that terminal 101 and the concrete processing procedure of smart card 102 are as detailed above, it is no longer superfluous here It states.
In the exemplary embodiment, the embodiment of the invention also provides a kind of storage medium, i.e. computer storage medium, tools Body is computer readable storage medium, and the first memory 83 for example including storage computer program, above-mentioned computer program can It is executed by the first processor 82 of terminal 80, to complete step described in preceding method.It for another example include storage computer program Second memory 92, above-mentioned computer program can be executed by the second processor 91 of smart card 90, to complete described in preceding method Step.Computer readable storage medium can be FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface and deposit The memories such as reservoir, CD or CD-ROM.
It should be understood that between technical solution documented by the embodiment of the present invention, in the absence of conflict, Ke Yiren Meaning combination.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.

Claims (25)

1. one kind opens chucking method, which is characterized in that be applied to terminal, which comprises
By calling the correspondence native applications Program Interfaces API of the terminal operating system, and it is based on application protocol data The message format of case2 type in unit AP DU order obtains authentication information from smart card;
The authentication information is sent to platform;The authentication information is for authenticating the smart card;
Receive the card data that the platform is sent;The card data are sent after the platform is successful to the smart card authentication 's;
By calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu smart card sends institute State card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The friendship of the terminal and smart card Mutually realized by the secure connection established.
2. the method according to claim 1, wherein the message based on the case2 type in APDU order Format obtains authentication information from smart card, comprising:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;It is described first Beginningization, which writes card instruction and is used to indicate the smart card and enters, writes card initialization state, and obtains the authentication information of the smart card;
Receive the authentication information that the smart card is sent.
3. the method according to claim 1, wherein described by based on the case3 type in APDU order Message format, Xiang Suoshu smart card send the card data, comprising:
Based on the message format of the case3 type in APDU order, the Xiang Suoshu smart card transmission carrying card data write card Message instruction.
4. the method according to claim 1, wherein the method also includes:
Receive the smart card return writes card execution state;What the smart card returned, which writes card execution state, is ordered based on APDU What the message format of the case3 type in order generated;
When it is described write card execute state representation described in writing smart card success when, based on disappearing for the case2 type in APDU order Format is ceased, Xiang Suoshu smart card, which sends to obtain, writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
5. one kind opens chucking method, which is characterized in that be applied to smart card, which comprises
Based on the message format of the case2 type in APDU order, authentication information is provided for terminal;The authentication information for pair The smart card is authenticated;
Based on the message format of the case3 type in APDU order, the card data that the terminal is sent are received;
Using the card data, writing operation is carried out.
6. according to the method described in claim 5, it is characterized in that, the message based on the case2 type in APDU order Format provides authentication information for terminal, comprising:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and to the terminal return authentication information.
7. according to the method described in claim 5, it is characterized in that, the message based on the case3 type in APDU order Format receives the card data that the terminal is sent, comprising:
Based on the message format of the case3 type in APDU order, writing for the carrying card data that the terminal is sent is received The instruction of card message.
8. according to the method described in claim 5, it is characterized in that, the method also includes:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;The card of writing is held The success of writing smart card described in row state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card status command;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
9. one kind opens card device, which is characterized in that described device includes:
Acquiring unit, for the primary API of correspondence by calling the terminal operating system, and based in APDU order The message format of case2 type obtains authentication information from smart card;The authentication information is sent to platform;The certification letter Breath is for authenticating the smart card;And receive the card data that the platform is sent;The card data are the platforms pair It is sent after the smart card authentication success;
First writes card unit, calls the API for passing through, and the message format based on the case3 type in APDU order, to The smart card sends the card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The friendship of the terminal and smart card Mutually realized by the secure connection established.
10. device according to claim 9, which is characterized in that the acquiring unit is specifically used for:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;It is described first Beginningization, which writes card instruction and is used to indicate the smart card and enters, writes card initialization state, and obtains the authentication information of the smart card;
Receive the authentication information that the smart card is sent.
11. device according to claim 9, which is characterized in that described first writes card unit, is specifically used for:
Based on the message format of the case3 type in APDU order, the Xiang Suoshu smart card transmission carrying card data write card Message instruction.
12. device according to claim 9, which is characterized in that described first writes card unit, is also used to:
Receive the smart card return writes card execution state;What the smart card returned, which writes card execution state, is ordered based on APDU What the message format of the case3 type in order generated;
When it is described write card execute state representation described in writing smart card success when, based on disappearing for the case2 type in APDU order Format is ceased, Xiang Suoshu smart card, which sends to obtain, writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
13. one kind opens card device, which is characterized in that described device includes:
Unit is provided and provides authentication information for the message format based on the case2 type in APDU order for terminal;It is described Authentication information is for authenticating the smart card;
Second writes card unit, for the message format based on the case3 type in APDU order, receives the card that the terminal is sent Data;And the card data are utilized, carry out writing operation.
14. device according to claim 13, which is characterized in that the offer unit is specifically used for:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and to the terminal return authentication information.
15. device according to claim 13, which is characterized in that described second writes card unit, is specifically used for:
Based on the message format of the case3 type in APDU order, writing for the carrying card data that the terminal is sent is received The instruction of card message.
16. device according to claim 13, which is characterized in that described second writes card unit, is also used to:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;The card of writing is held The success of writing smart card described in row state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card status command;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
17. a kind of terminal, which is characterized in that the terminal includes: first processor and can be at described first for storing The first memory of the computer program run on reason device,
Wherein, the first processor is for executing when running the computer program:
By calling the primary mouth API of correspondence of the terminal operating system, and the message based on the case2 type in APDU order Format obtains authentication information from smart card;
The authentication information is sent to platform;The authentication information is for authenticating the smart card;
Receive the card data that the platform is sent;The card data are sent after the platform is successful to the smart card authentication 's;
By calling the API, and the message format based on the case3 type in APDU order, Xiang Suoshu smart card sends institute State card data;The card data of transmission are used to carry out writing operation for the smart card;Wherein,
The terminal can be by calling the API and the smart card to establish secure connection;The friendship of the terminal and smart card Mutually realized by the secure connection established.
18. terminal according to claim 17, which is characterized in that the first processor, for running the computer When program, execute:
Based on the message format of the case2 type in APDU order, Xiang Suoshu smart card sends initialization and writes card instruction;It is described first Beginningization, which writes card instruction and is used to indicate the smart card and enters, writes card initialization state, and obtains the authentication information of the smart card;
Receive the authentication information that the smart card is sent.
19. terminal according to claim 17, which is characterized in that the first processor, for running the computer When program, execute:
Based on the message format of the case3 type in APDU order, the Xiang Suoshu smart card transmission carrying card data write card Message instruction.
20. terminal according to claim 17, which is characterized in that the first processor is also used to run the calculating When machine program, execute:
Receive the smart card return writes card execution state;What the smart card returned, which writes card execution state, is ordered based on APDU What the message format of the case3 type in order generated;
When it is described write card execute state representation described in writing smart card success when, based on disappearing for the case2 type in APDU order Format is ceased, Xiang Suoshu smart card, which sends to obtain, writes card status command;
Receive the smart card based on it is described acquisition write card status command return write card-like state.
21. a kind of smart card, which is characterized in that the smart card includes: second processor and can be described for storing The second memory of the computer program run on two processors,
Wherein, the second processor is for executing when running the computer program:
Based on the message format of the case2 type in APDU order, authentication information is provided for terminal;The authentication information for pair The smart card is authenticated;
Based on the message format of the case3 type in APDU order, the card data that the terminal is sent are received;
Using the card data, writing operation is carried out.
22. smart card according to claim 21, which is characterized in that the second processor, for running the calculating When machine program, execute:
Based on the message format of the case2 type in APDU order, receives the initialization that the terminal is sent and write card instruction;
It responds the initialization and writes card instruction, into writing card initialization state, and to the terminal return authentication information.
23. smart card according to claim 21, which is characterized in that the second processor, for running the calculating When machine program, execute:
Based on the message format of the case3 type in APDU order, writing for the carrying card data that the terminal is sent is received The instruction of card message.
24. smart card according to claim 21, which is characterized in that the second processor is also used to run the meter When calculation machine program, execute:
Based on the message format of the case3 type in APDU order, card execution state is write in the return of Xiang Suoshu terminal;The card of writing is held The success of writing smart card described in row state representation;
Based on the message format of the case2 type in APDU order, receives the acquisition that the smart card is sent and write card status command;
It responds the acquisition and writes card status command, card-like state is write in the return of Xiang Suoshu terminal.
25. a kind of storage medium, is stored thereon with computer program, which is characterized in that the computer program is held by processor The step of any one of Claims 1-4 the method is realized when row, or realize any one of claim 5 to 8 the method Step.
CN201810319863.3A 2018-04-11 2018-04-11 Card opening method and device, related equipment and storage medium Active CN110366161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810319863.3A CN110366161B (en) 2018-04-11 2018-04-11 Card opening method and device, related equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810319863.3A CN110366161B (en) 2018-04-11 2018-04-11 Card opening method and device, related equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110366161A true CN110366161A (en) 2019-10-22
CN110366161B CN110366161B (en) 2023-01-03

Family

ID=68214346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810319863.3A Active CN110366161B (en) 2018-04-11 2018-04-11 Card opening method and device, related equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110366161B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116170794A (en) * 2023-04-25 2023-05-26 深圳市微付充科技有限公司 Online idle issuing system and method for smart card

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104918230A (en) * 2014-03-11 2015-09-16 中国移动通信集团内蒙古有限公司 Card writing method, device and system
CN105825134A (en) * 2016-03-16 2016-08-03 中国联合网络通信集团有限公司 Intelligent card processing method, intelligent card management server and terminal
CN106709727A (en) * 2016-12-07 2017-05-24 深圳市久和久科技有限公司 Intelligent card management method and system thereof, terminal and card service management apparatus
CN106856465A (en) * 2015-12-08 2017-06-16 中国电信股份有限公司 Methods, devices and systems for realizing mobile authentication
CN107613487A (en) * 2017-11-07 2018-01-19 恒宝股份有限公司 A kind of eSIM cards and its method of work

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104918230A (en) * 2014-03-11 2015-09-16 中国移动通信集团内蒙古有限公司 Card writing method, device and system
CN106856465A (en) * 2015-12-08 2017-06-16 中国电信股份有限公司 Methods, devices and systems for realizing mobile authentication
CN105825134A (en) * 2016-03-16 2016-08-03 中国联合网络通信集团有限公司 Intelligent card processing method, intelligent card management server and terminal
CN106709727A (en) * 2016-12-07 2017-05-24 深圳市久和久科技有限公司 Intelligent card management method and system thereof, terminal and card service management apparatus
CN107613487A (en) * 2017-11-07 2018-01-19 恒宝股份有限公司 A kind of eSIM cards and its method of work

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116170794A (en) * 2023-04-25 2023-05-26 深圳市微付充科技有限公司 Online idle issuing system and method for smart card
CN116170794B (en) * 2023-04-25 2023-08-08 深圳市微付充科技有限公司 Online idle issuing system and method for smart card

Also Published As

Publication number Publication date
CN110366161B (en) 2023-01-03

Similar Documents

Publication Publication Date Title
US8391837B2 (en) Method, system and trusted service manager for securely transmitting an application to a mobile phone
CN103455349B (en) Application program accesses the method and apparatus of smart card
CN100533459C (en) Data safety reading method and safety storage apparatus thereof
CN106162517A (en) The management method of a kind of virtual SIM card and system
EP2048594A1 (en) Method for communication, communication device and secure processor
CN103812649B (en) Method and system for safety access control of machine-card interface, and handset terminal
CN101422058A (en) Method of securing access to a proximity communication module in a mobile terminal
CN102883047A (en) Method and system for realizing data security of intelligent mobile terminals
US20170286873A1 (en) Electronic ticket management
RU2015114703A (en) TELECOMMUNICATION CHIP CARD
CN110022552A (en) User identification module method for writing data, equipment, platform and storage medium
EP2048591A1 (en) Method for communication, communication device and secure processor
Schamberger et al. Components for an interoperable NFC mobile payment ecosystem
CN111191252A (en) Encryption and decryption method and device for smart card operating system and storage medium
WO2017076202A1 (en) Smart card, mobile terminal, and method for using smart card to implement network identity authentication
CN110366161A (en) Open chucking method, device, relevant device and storage medium
Roland et al. Comparison of the usability and security of NFC's different operating modes in mobile devices.
CN105103180B (en) Method for handling the distribution of mobile credit card
CN112422281A (en) Method and system for changing secret key in security module
CN110351703A (en) One kind opening chucking method, device, relevant device and storage medium
CN104134025A (en) Mobile terminal locking method and device based on SIM cards and mobile terminal
KR100963920B1 (en) Method for Outputting Student ID Card in Security and Program Recording Medium
CN110830831B (en) Method for effectively protecting safety of prepaid account of IPTV set top box
WO2024108933A1 (en) Communication method of wearable device, wearable device, and machine-readable storage medium
WO2022143056A1 (en) Identity card-based hardware wallet fingerprint authentication method and system, and hardware wallet

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant