CN104407845A - Method and device for negotiating and selecting application of terminal and intelligent card - Google Patents

Method and device for negotiating and selecting application of terminal and intelligent card Download PDF

Info

Publication number
CN104407845A
CN104407845A CN201410591616.0A CN201410591616A CN104407845A CN 104407845 A CN104407845 A CN 104407845A CN 201410591616 A CN201410591616 A CN 201410591616A CN 104407845 A CN104407845 A CN 104407845A
Authority
CN
China
Prior art keywords
application
reply data
current
candidate list
smart card
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
CN201410591616.0A
Other languages
Chinese (zh)
Other versions
CN104407845B (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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201410591616.0A priority Critical patent/CN104407845B/en
Publication of CN104407845A publication Critical patent/CN104407845A/en
Application granted granted Critical
Publication of CN104407845B publication Critical patent/CN104407845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a method and a device for negotiating and selecting application of a terminal and an intelligent card. The method comprises the following steps: obtaining a short file identifier and initializing a current record number by the terminal; sending a record reading instruction according to the short file identifier and the current record number, receiving second response data and updating an application candidate list if an application catalogue file in the second response data is matched with a preset application serial number; obtaining a first application serial number in an application serial number list and taking the first application serial number as a current application serial number by the terminal; sending a second selection instruction according to the current application serial number, receiving third response data, updating the application candidate list if a special file name in the third response data is matched with the current application serial number, selecting application information in the application candidate list by the terminal, sending a fourth selection instruction, receiving fifth response data, successfully selecting the application if the fifth response data accords with a first preset requirement, saving a processing option data object list in the fifth response data and ending.

Description

A kind of terminal and smart card consult the method and apparatus of selective gist
Technical field
The present invention relates to information security field, particularly relate to the method and apparatus of a kind of terminal and smart card negotiation selective gist.
Background technology
Application is that terminal and smart card carry out mutual prerequisite, the criterion of data, step, security strategy and result success and failure required in application definition terminal and smart card reciprocal process, therefore needed selective gist before terminal and smart card are carried out alternately.Along with the development of smart card techniques, the type of smart card also gets more and more, but terminal can not predict the type of smart card, causes terminal and smart card to be difficult to consult selective gist.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, a kind of terminal and smart card is provided to consult the method and apparatus of selective gist, both support terminal and smart card consulted selective gist according to catalogue selection function, also support terminal and smart card consult selective gist according to application sequence list selection function, compatible good, be easy to safeguard.
The invention provides a kind of method of terminal and smart card negotiation selective gist, comprising:
Step S1: described terminal obtains the short file identification in described smart card, initialization application candidate list and current record number;
Step S2: described terminal sends read record instruction according to described short file identification and current record number to described smart card, receive the second reply data that described smart card returns according to described read record instruction, judge whether to have read the record in described smart card according to described second reply data, be perform step S3, otherwise perform step S4;
Step S3: whether be empty, be perform step S5, otherwise perform step S8 if applying candidate list described in described terminal judges;
Step S4: whether the application catalogue file in the second reply data described in described terminal judges mates with the application sequence number in the application sequence list preset, upgrade described application candidate list according to the application message in described second reply data, upgrade current record number, return step S2, otherwise renewal current record number, returns step S2;
Step S5: described terminal obtains first application sequence in the application sequence list preset number as current application sequence number;
Step S6: described terminal sends the second selection instruction according to current application sequence number to smart card, receive the 3rd reply data that described smart card returns according to described second selection instruction, judge private file name in described 3rd reply data whether with current application sequence numbers match, upgrade described application candidate list according to described 3rd reply data, perform step S7, otherwise perform step S7;
Step S7: whether there is application sequence number after the current application sequence number in application sequence list described in described terminal judges, be, upgrade current application sequence number, return step S6, otherwise perform step S8;
Step S8: described terminal judges whether there is the application jointly supported with described smart card according to described application candidate list, be perform step S9, otherwise terminates;
Step S9: described terminal selects an application according to preset rules, the information obtaining described application in described application candidate list is applied in again according to what determine, according to the application sequence number in the information got, the 4th selection instruction is sent to described smart card, receive the 5th reply data that described smart card returns according to described 4th selection instruction, judge whether described 5th reply data meets the first preset requirement, it is then selective gist success, preserve the Treatment Options data object list in described 5th reply data, process ends, otherwise in described application candidate list, delete the information of the described application got, return step S8.
The present invention provides again a kind of terminal and smart card to consult the method for selective gist, comprising:
Step S1: described terminal initialization application candidate list, obtains first application sequence in the application sequence list preset number as current application sequence number;
Step S2: described terminal sends the second selection instruction according to current application sequence number to smart card, receive the 3rd reply data that described smart card returns according to described second selection instruction, judge private file name in described 3rd reply data whether with current application sequence numbers match, upgrade described application candidate list according to described 3rd reply data, perform step S3, otherwise perform step S3;
Step S3: whether there is application sequence number after the current application sequence number in application sequence list described in described terminal judges, be, upgrade current application sequence number, return step S2, otherwise perform step S4;
Step S4: whether be empty, be perform step S5, otherwise perform step S9 if applying candidate list described in described terminal judges;
Step S5: described terminal obtains the short file identification in described smart card, initialization current record number;
Step S6: described terminal sends read record instruction according to described short file identification and current record number to described smart card, receive the second reply data that smart card returns according to described read record instruction, judge whether to have read the record in described smart card according to described second reply data, be perform step S8, otherwise perform step S7;
Step S7: whether the application catalogue file in the second reply data described in described terminal judges mates with the application sequence number in the application sequence list preset, upgrade described application candidate list according to the application message in described second reply data, upgrade current record number, return step S6, otherwise renewal current record number, returns step S6;
Step S8: described terminal judges whether there is the application jointly supported with described smart card according to described application candidate list, be perform step S9, otherwise terminates;
Step S9: described terminal selects an application according to preset rules, the information obtaining described application in described application candidate list is applied in again according to what determine, according to the application sequence number in the information got, the 4th selection instruction is sent to described smart card, receive the 5th reply data that described smart card returns according to described 4th selection instruction, judge whether described 5th reply data meets the first preset requirement, it is then selective gist success, preserve the Treatment Options data object list in described 5th reply data, process ends, otherwise in application candidate list, delete the information of the described application got, return step S8.
The present invention provides again a kind of terminal and smart card to consult the device of selective gist, comprising: the first initial module, sending module, receiver module, the first judge module, the second judge module, the 3rd judge module, the first update module, the second initial module, the 4th judge module, the 5th judge module, the tenth judge module, the first acquisition module, the 6th judge module, memory module and removing module;
Described first initial module, for obtaining the short file identification in described smart card, initialization application candidate list and current record number;
Described sending module, sends read record instruction for the described short file identification that obtains according to described first initial module and current record number to described smart card; Also for sending the second selection instruction according to current application sequence number to described smart card; Also for according to the application sequence number got, send the 4th selection instruction to described smart card;
Described receiver module, for receiving the second reply data that described smart card returns according to the described read record instruction that described sending module sends; Also for receiving the 3rd reply data that described smart card returns according to described second selection instruction that described sending module sends; Also for receiving the 5th reply data that described smart card returns according to described 4th selection instruction that described sending module sends;
Described first judge module, judges whether to have read the record in described smart card for described second reply data received according to described receiver module;
Described second judge module, for when described first judge module is judged as YES, judges whether described application candidate list is empty;
Described 3rd judge module, for when described first judge module is judged as NO, judges whether the application catalogue file in described second reply data that described receiver module receives mates with the application sequence number in the application sequence list preset;
Described first update module, for when described 3rd judge module is judged as YES, upgrades described application candidate list according to the application message in described second reply data that described receiver module receives, and upgrades current record number; Also for when described 3rd judge module is judged as NO, upgrade current record number;
Described second initial module, for when described second judge module is judged as YES, obtains first application sequence in the application sequence list preset number as current application sequence number;
Described 4th judge module, for judge private file name in described 3rd reply data that described receiver module receives whether with current application sequence numbers match;
Described first update module, also for when described 4th judge module is judged as YES, upgrades described application candidate list according to described 3rd reply data that described receiver module receives;
Described 5th judge module, for being judged as NO at described 4th judge module, or after described first update module upgrades described application candidate list according to described 3rd reply data, whether there is application sequence number after judging the current application sequence number in described application sequence list, be, upgrade current application sequence number;
Described tenth judge module, has for judging whether according to described application candidate list the application jointly supported with described smart card;
Described first acquisition module, for when described 8th judge module is judged as YES, selects an application according to preset rules, then is applied according to what determine the information obtaining described application in described application candidate list;
Described 6th judge module, for judging whether described 5th reply data that described receiver module receives meets the first preset requirement;
Described memory module, for when described 6th judge module is judged as YES, preserves the Treatment Options data object list in described 5th reply data that described receiver module receives;
Described removing module, for when described 6th judge module is judged as NO, deletes the information of the described application got in described application candidate list.
The present invention compared with prior art, has the following advantages:
A kind of terminal provided by the invention and smart card consult the method and apparatus of selective gist, both support terminal and smart card consulted selective gist according to catalogue selection function, also support terminal and smart card consult selective gist according to application sequence list selection function, compatible good; For the smart card of many application, if increase an application in smart card, correspondingly, only need increase the sequence number of this application in terminal in application sequence list, upgrading is fast, does not need amendment terminal kernel, is easy to safeguard.
Accompanying drawing explanation
Fig. 1 is the process flow diagram that a kind of terminal of providing of the embodiment of the present invention 1 and smart card consult the method for selective gist;
Fig. 2 to Fig. 4 is the process flow diagram that a kind of terminal of providing of the embodiment of the present invention 2 and smart card consult the method for selective gist;
Fig. 5 is the process flow diagram that a kind of terminal of providing of the embodiment of the present invention 3 and smart card consult the method for selective gist;
Fig. 6 to Fig. 8 is the process flow diagram that a kind of terminal of providing of the embodiment of the present invention 4 and smart card consult the method for selective gist;
Fig. 9 is the module map that a kind of terminal of providing of the embodiment of the present invention 5 and smart card consult the device of selective gist.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
This method is applied in the system comprising authenticating device, client and authentication center.
Embodiment 1
Embodiments of the invention 1 provide a kind of method of terminal and smart card negotiation selective gist, as shown in Figure 1, comprising:
Step S1: terminal obtains the short file identification in smart card, initialization application candidate list and current record number;
Step S2: terminal sends read record instruction according to short file identification and current record number to smart card, receive the second reply data that smart card returns according to read record instruction, the record read in smart card is judged whether according to the second reply data, be perform step S3, otherwise perform step S4;
Step S3: whether terminal judges application candidate list is empty, is perform step S5, otherwise performs step S9;
Step S4: whether the application catalogue file in terminal judges second reply data mates with the application sequence number in the application sequence list preset, then according to the more new opplication candidate list of the application message in the second reply data, upgrade current record number, return step S2, otherwise renewal current record number, returns step S2;
Step S5: terminal obtains first application sequence in the application sequence list preset number as current application sequence number;
Step S6: terminal sends the second selection instruction according to current application sequence number to smart card, receive the 3rd reply data that smart card returns according to the second selection instruction, judge private file name in the 3rd reply data whether with current application sequence numbers match, then according to the 3rd reply data more new opplication candidate list, perform step S7, otherwise perform step S7;
Step S7: whether there is application sequence number after the current application sequence number in the list of terminal judges application sequence, be, upgrade current application sequence number, return step S6, otherwise perform step S8;
Step S8: terminal judges whether there is the application jointly supported with smart card according to application candidate list, is perform step S9, otherwise terminates;
Step S9: terminal selects an application according to preset rules, the information obtaining application in application candidate list is applied in again according to what determine, according to the application sequence number in the information got, the 4th selection instruction is sent to smart card, receive the 5th reply data that smart card returns according to the 4th selection instruction, judge whether the 5th reply data meets the first preset requirement, it is then selective gist success, preserve the Treatment Options data object list in the 5th reply data, process ends, otherwise in application candidate list, delete the information of the application got, return step S8.
Embodiment 2
Embodiments of the invention 2 provide a kind of method of terminal and smart card negotiation selective gist, as shown in Figures 2 to 4, comprising:
Step 101: terminal sends the first selection instruction according to the private file name preset to smart card;
Such as, the first selection instruction is: 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 4,444 46 30 31; Wherein, 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 are DF (Dedicated File, the private file) name preset;
According to the first reply data, step 102: terminal receives the first reply data that smart card returns according to the first selection instruction, judges that whether smart card is locked or do not support this instruction, is then selective gist failure, terminates, otherwise perform step 103;
Particularly, whether terminal judges first reply data is 0x6A81, is, determines that smart card is locked or do not support this instruction, otherwise determines that smart card is not locked and supports this instruction;
Step 103: whether terminal judges first reply data meets the second preset requirement, is perform step 104, otherwise perform step 116;
Particularly, whether there is 0x9000 in terminal judges first reply data and data layout is correct, be determine that the first reply data meets the second preset requirement, otherwise determine that the first reply data does not meet the second preset requirement;
In the present embodiment, first reply data does not meet the second preset requirement and comprises: smart card does not have catalogue selection function, catalogue selection function in smart card is locked, the file control information format error in the first reply data, lacks necessary data in the first reply data; Such as, the data that it is label that necessary data comprise with 0x6F, 0x84,0xA5 or 0x88;
Such as, in the present embodiment, the first reply data is: 6F 2F 84 0E 31 50 41 59 2E 53 5953 2E 44 44 46 30 31 A5 1D 88 01 01 5F 2D 08 65 73 65 6E 66 72 64 65 9,F11 01 01 BF 0C 08 85 06 12 34 56 78 9A BC 90 00, wherein, last 2 bytes are 0x9000, determine that the first reply data is correct, in first reply data, 0x6F is the label of file control information template, 0x2F is the length of file control information template, 0x84 is the label of DF name, thereafter a byte 0x0E is the length of DF name, thereafter 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 are DF (Dedicated File, private file) content of name, 0xA5 is the label of file control information, thereafter a byte 0x1D is the length of file control information, thereafter 88 01 01 5F 2D 08 65 7365 6E 66 72 64 65 9F 11 01 01 BF 0C 08 85 06 12 34 56 78 9A BC are the content of file control information, wherein 0x88 is SFI (Short File Identifier, short file identification) label, thereafter a byte 0x01 is the length of SFI name, thereafter 0x01 is the value of SFI, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index,
Step 104: terminal initialization application candidate list;
Particularly, terminal initialization application candidate list is for emptying application candidate list;
Step 105: whether there is correct short file identification in terminal judges first reply data is then initialization current record number, performs step 106, otherwise performs step 116;
Particularly, the first label value whether is there is in terminal judges first reply data, do not exist, determine in the first reply data, to there is not SFI (Short File Identifier, short file identification), exist and then determine to there is SFI in the first reply data, obtain the value of the SFI after the first label value, continue the value of SFI that judges to get whether in the first scope, be determine to there is correct SFI in the first reply data, otherwise determine there is not correct SFI in the first reply data; Preferably, the initial value of current record number is 1;
Such as, the first label value is 0x88, and the first scope is 0x01 to 0x0A; The value obtaining the SFI after 0x88 is 0x01, then SFI is in the first scope;
Step 106: terminal sends read record instruction according to short file identification and current record number to smart card;
Such as, terminal sends the first read record instruction 00 B2 01 0C00 according to SFI and current record number to smart card, smart card is 6C 57 according to the data that the first read record instruction returns, terminal obtains record length 0x57 from these data, and terminal sends the second read record instruction 00 B2 010C 57 according to SFI and record length to smart card again;
Step 107: terminal receives the second reply data that smart card returns according to read record instruction, judges whether the record read in smart card, is, perform step 108 according to the second reply data, otherwise perform step 109;
Particularly, whether terminal judges second reply data is 0x6A83, is, has read the record in smart card, otherwise has not read the record in smart card;
Step 108: whether terminal judges application candidate list is empty, is perform step 116, otherwise performs step 129;
Step 109: whether terminal judges second reply data meets the 3rd preset requirement, is perform step 110, otherwise initialization application candidate list, perform step 116;
Particularly, whether there is 0x9000 in terminal judges second reply data and data layout is correct, be determine that the second reply data meets the 3rd preset requirement, otherwise determine that the second reply data does not meet the 3rd preset requirement;
In the present embodiment, the second reply data does not meet the 3rd preset requirement and comprises: the second response data format mistake, lacks application directory name, applying label etc.;
Such as, in the present embodiment, second reply data is: 70 55 61 14 4F 07 A0 00 00 00 9,990 90 50 06 4E 4F 4E 45 4D 56 87 01 81 61 28 4F 07 A0 00 00 00 03 10 1050 0A 56 49 53 41 43 52 45 44 49 54 87 01 82 9F 12 0D 43 52 45 44 49 544F 44 45 56 49 53 41 61 13 4F 08 A0 00 00 00 03 10 10 03 50 04 41 50 5,033 87 01 03 90 00, wherein, last 2 bytes are 0x9000, determine that the second reply data is correct;
Step 110: whether there is entrance mark in terminal judges second reply data, is perform step 111, otherwise upgrades current record number, returns step 106;
Particularly, whether there is the second label value in terminal judges first reply data, be, determine in the second reply data, to there is entrance mark, otherwise determine in the second reply data, to there is not entrance mark;
Such as, entrance mark i.e. the second label value is 0x61;
Step 111: first entrance mark that terminal obtains in the second reply data identifies as current entry;
Such as, terminal searches the second label value 0x61 from front to back in the second reply data, finds 0x61, then identified as current entry by the 0x61 of the 3rd byte the 3rd byte; Data between this entrance mark and next entrance identify are the application message that this entrance identifies;
Such as, current entry identifies, application message after the 0x61 of i.e. the 3rd byte is: 14 4F 0,7A0 00 00 00 99 90 90 50 06 4E 4F 4E 45 4D 56 87 01 81, wherein, 0x14 is the length of this application message, 0x4F is ADF (Application Directory File, application catalogue file) label, thereafter a byte 0x07 is the length of ADF name, thereafter A0 00 00 00 99 90 90 is the content of ADF, 0x50 is the label of applying label, thereafter a byte 0x06 is the length of applying label, thereafter 4E 4F 4E 45 4D 56 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x87 is the content of application priority indicator, without the preferential name of application in this application message,
Step 112: the application catalogue file after terminal judges current entry mark and the application sequence number in the application sequence list preset whether complete match, then according to the application message more new opplication candidate list after current entry mark, perform step 115, otherwise perform step 113;
Particularly, the identical application sequence number of ADF after whether terminal judges can find and to identify with current entry in the application sequence list preset, be, the ADF in after determining current entry mark and application sequence complete match in application sequence list, otherwise determine current entry identify after in ADF not with the application sequence complete match in application sequence list; More new opplication candidate list is: terminal by current entry identify after application message in applying label, apply priority indicator, apply preferential name and ADF and application sequence number be stored into application candidate list in;
Such as, in the present embodiment, more new opplication candidate list is: 4F 07 A0 00 00 00 99 9,090 50 06 4E 4F 4E 45 4D 56 87 01 81 adds in application candidate list by terminal;
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 113: the application choice indicator that terminal is corresponding according to the application catalogue file after identifying with current entry in the application sequence list preset, judge whether to allow the application catalogue file after current entry mark and the application sequence semi-match in application sequence list, be perform step 114, otherwise perform step 115;
Step 114: the application catalogue file after terminal judges current entry mark and application sequence in application sequence list number whether semi-match, then according to the application message more new opplication candidate list after current entry mark, perform step 115, otherwise directly perform step 115;
Particularly, the application sequence number that the predetermined fraction of the ADF after whether terminal judges can find and to identify with current entry in application sequence list is identical, determine the ADF after current entry mark and application sequence semi-match in application sequence list, otherwise determine current entry identify after ADF not with the application sequence semi-match in application sequence list; Such as, the predetermined fraction of ADF is front 7 bytes of ADF, if the ADF after current entry mark is A0 00 00 00 03 10 10 03, application sequence number in application sequence list is A0 00 00 00 03 10 10, then determine the ADF after current entry mark and the application sequence semi-match in application sequence list; More new opplication candidate list is: terminal by current entry identify after application message in applying label, apply priority indicator, apply preferential name and ADF and application sequence number be stored into application candidate list in;
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 115: whether also there is entrance mark after terminal judges current entry mark, be, upgrades current entry mark, returns step 112, otherwise upgrade current record number, return step 106;
Particularly, terminal searches the second label value after current entry mark, judges whether to find the second label value, is, also there is entrance mark after determining current entry mark, otherwise there is not entrance mark after determining current entry mark; Renewal current entry is designated the rear entrance mark identified by current entry and identifies as current entry; Preferably, current record number is upgraded for current record number is added 1 certainly;
Such as, in the present embodiment, also comprise 2 entrance marks in the second reply data, be respectively:
25th byte is 0x61, and the application message after this entrance mark is: 28 4F 07 A0 00 00 0,003 10 10 50 0A 56 49 53 41 43 52 45 44 49 54 87 01 82 9F 12 0D 43 52 4,544 49 54 4F 44 45 56 49 53 41, wherein, 0x28 is the length of this application message, 0x4F is the label of ADF, thereafter a byte 0x07 is the length of ADF name, thereafter A0 00 00 00 03 1010 is the content of ADF, 0x50 is the label of applying label, thereafter a byte 0x0A is the length of applying label, thereafter 56 49 53 41 43 52 45 44 49 54 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x82 is the content of application priority indicator, 9F 12 is the label applying preferential name, thereafter a byte 0x0D is the length applying preferential name, thereafter 43 52 45 44 49 54 4F 44 45 56 4,953 41 are the content applying preferential name,
67th byte is 0x61, application message after this entrance mark is: 13 4F 08 A0 00 00 0,003 10 10 03 50 04 41 50 50 33 87 01 03, wherein, 0x13 is the length of this application message, 0x4F is the label of ADF, thereafter a byte 0x08 is the length of ADF name, thereafter A0 00 00 0,003 10 10 03 is the content of ADF, 0x50 is the label of applying label, thereafter a byte 0x04 is the length of applying label, thereafter 41 50 50 33 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 03 is the content applying priority indicator, without the preferential name of application in this application message,
Step 116: terminal initialization application candidate list, obtains first application sequence in the application sequence list preset number as current application sequence number;
Such as, current application sequence number is A0 00 00 00 03 10 10;
Step 117: terminal sends the second selection instruction according to current application sequence number to smart card;
Such as, the second selection instruction is 00 A4 04 00 07 A0 00 00 00 03 10 10;
Step 118: terminal receives the 3rd reply data that smart card returns according to the second selection instruction, judges whether the 3rd reply data meets the 5th preset requirement, is perform step 119, otherwise perform step 127;
Particularly, whether there is 0x9000 in terminal judges the 3rd reply data and data layout is correct, be determine that the 3rd reply data meets the 5th preset requirement, otherwise determine that the 3rd reply data does not meet the 5th preset requirement;
In the present embodiment, the 3rd reply data does not meet the 5th preset requirement and comprises: status code is not 0x9000 or 0x6283, file control information format error; Necessary data are lacked in 3rd reply data; Such as, the data that it is label that necessary data comprise with 0x6F, 0x84,0xA5;
Such as, in the present embodiment, the 3rd reply data is 6F 32 84 07 A0 00 00 00 03 10 10 A527 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 3501 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 90 00; Wherein, last 2 bytes are 0x9000, determine that the 3rd reply data is correct; 0x84 is the label of DF name, thereafter a byte 0x07 is the length of DF name, thereafter A0 00 00 00 03 10 10 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x27 is the length of file control information, and 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 015F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 are thereafter the content of file control information;
Step 119: whether the private file name in terminal judges the 3rd reply data mates completely with current application sequence number, is perform step 120, otherwise perform step 121;
Such as, in the present embodiment, DF name and current application sequence number are A0 00 00 00 03 10 10, then DF name is mated completely with current application sequence number, perform step 121;
If the 3rd reply data is 6F 33 84 08 A0 00 00 00 03 10 10 00 A5 27 87 01 019F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 0,865 73 65 6E 66 72 64 65 9F 11 01 01 90 00, wherein, 0x84 is the label of DF name, thereafter a byte 0x08 is the length of DF name, thereafter A0 00 00 00 03 10 10 00 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x27 is the length of file control information, thereafter 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9,F09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 are the content of file control information, then DF name and current application sequence number Incomplete matching, perform step 122,
Step 120: according to the 3rd reply data, terminal judges whether application is locked, and is perform step 127, otherwise according to the more new opplication candidate list of the file control information in the 3rd reply data, perform step 127;
Particularly, whether terminal judges the 3rd reply data is 0x6283, is, determines that application is locked, otherwise determines that application is not locked; More new opplication candidate list is: the DF name in the applying label in file control information, application priority indicator and the 3rd reply data and application sequence number are stored in application candidate list by terminal;
Such as, file control information in 3rd reply data is 87 01 01 9F 38 12 9F 1A 02 9,F33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 6465 9F 11 01 01, wherein, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x01 is the content of application priority indicator, 9F 38 is PDOL (Processing Options Data Object List, Treatment Options data object list) label, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 4005 9F 1B 04 9F 09 02 9F 35 01 is the content of PDOL, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index, more new opplication candidate list is: 84 08 A0 00 00 00 03 1,010 00 87 01 01 add in application candidate list by terminal,
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 121: terminal is according to application choice indicator corresponding with current application sequence number in the application sequence list preset, judge whether that the private file name in permission the 3rd reply data is mated with current application sequence number portion, be perform step 122, otherwise perform step 127;
Step 122: the private file name in terminal judges the 3rd reply data and current application sequence number whether semi-match, is perform step 123, otherwise performs step 127;
Particularly, whether the predetermined fraction of the private file name in terminal judges the 3rd reply data is identical with current application sequence number, be determine that private file name is mated with current application sequence number portion, otherwise determine that private file name is not mated with current application sequence number portion; Such as, the predetermined fraction of private file name is front 7 bytes of private file name, if private file is called A0 00 00 00 03 10 10 00, current application sequence number is A0 00 00 00 03 10 10, then determine that private file name is mated with current application sequence number portion;
Step 123: according to the 3rd reply data, terminal judges whether application is locked, and is perform step 124, otherwise according to the more new opplication candidate list of the file control information in the 3rd reply data, perform step 124;
Particularly, whether terminal judges the 3rd reply data is 0x6283, is, determines that application is locked, otherwise determines that application is not locked;
Particularly, more new opplication candidate list is: the DF name in the applying label in file control information, application priority indicator and the 3rd reply data is stored in application candidate list by terminal; Wherein, DF name stores as application sequence number;
Such as, file control information in 3rd reply data is 87 01 01 9F 38 12 9F 1A 02 9,F33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 6465 9F 11 01 01, wherein, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x01 is the content of application priority indicator, 9F 38 is PDOL (Processing Options Data Object List, Treatment Options data object list) label, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 4005 9F 1B 04 9F 09 02 9F 35 01 is the content of PDOL, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index, more new opplication candidate list is: 84 08 A0 00 00 00 03 1,010 00 87 01 01 add in application candidate list by terminal,
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 124: terminal sends the 3rd selection instruction according to current application sequence number to smart card, receives the 4th reply data that smart card returns according to the 3rd selection instruction;
Such as, the 3rd selection instruction is 00 A4 04 02 07 A0 00 00 00 03 10 10,
Step 125: whether terminal judges the 4th reply data meets the 4th preset requirement, is perform step 126, otherwise perform step 127;
Step 126: according to the 4th reply data, terminal judges whether application is locked, and is return step 124, otherwise according to the more new opplication candidate list of the file control information in the 4th reply data, returns step 124;
Particularly, whether terminal judges the 4th reply data is 0x6283, is, determines that application is locked, otherwise determines that application is not locked; More new opplication candidate list is: the DF name in the applying label in file control information, application priority indicator and the 4th reply data is stored in application candidate list by terminal; Wherein, DF name stores as application sequence number;
Such as, 4th reply data is 6F 33 84 08 A0 00 00 00 03 10 10 01 A5 27 87 0101 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2,D08 65 73 65 6E 66 72 64 65 9F 11 01 01 90 00, wherein, 0x84 is the label of DF name, thereafter a byte 0x08 is the length of DF name, thereafter A0 00 00 00 03 10 10 01 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x27 is the length of file control information, thereafter 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9,F09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 are the content of file control information, wherein, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x01 is the content of application priority indicator, 9F 38 is PDOL (Processing Options Data Object List, Treatment Options data object list) label, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 40 059F 1B 04 9F 09 02 9F 35 01 is the content of PDOL, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index, more new opplication candidate list is: 84 08 A0 00 00 00 03 10 10 0,187 01 01 add in application candidate list by terminal,
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 127: whether there is application sequence number after the current application sequence number in the list of terminal judges application sequence, be, upgrade current application sequence number, return step 117, otherwise perform step 128;
Step 128: terminal judges whether there is the application jointly supported with smart card according to application candidate list, is perform step 129, otherwise terminates;
Particularly, whether store application message in terminal judges application candidate list, be, determine to have with smart card the application jointly supported, otherwise determine the application jointly do not supported with smart card;
Such as, applying candidate list is: 4F 07 A0 00 00 00 99 90 90 50 06 4E 4F 4E 454D 56 87 01 81 4F 07 A0 00 00 00 03 10 10 50 0A 56 49 53 41 43 52 45 4,449 54 87 01 82 9F 12 0D 43 52 45 44 49 54 4F 44 45 56 49 53 41 4F 08 A000 00 00 03 10 10 03 50 04 41 50 50 33 87 01 03; This application candidate list comprises the application message of 3 application, be respectively: first application 4F 07 A0 00 00 00 99 90 90 50 064E 4F 4E 45 4D 56 87 01 81, second application 4F 07 A0 00 00 00 03 10 10 50 0,A56 49 53 41 43 52 45 44 49 54 87 01 82 9F 12 0D 43 52 45 44 49 54 4F the 4,445 56 49 53 41, the 3rd application 4F 08 A0 00 00 00 03 10 10 03 50 04 41 50 5,033 87 01 03;
Step 129: whether terminal judges only has one to have with smart card the application jointly supported or mutually support, is perform step 130, otherwise performs step 133;
Step 130: terminal is according to the application priority indicator in application candidate list, and judging that this application confirms the need of user, is perform step 131, otherwise selects this application, performs step 137;
Particularly, whether terminal judges application priority indicator meets the first preset format, is, determines that this application needs user to confirm, otherwise determines that this application does not need user to confirm;
Preferably, the first preset format is the most significant digit of application priority indicator is 1;
Such as, the application priority indicator of first application is 0x81, and the most significant digit of application priority indicator is 1, then determine that this application needs user to confirm; The application priority indicator of second application is 0x82, and the most significant digit of application priority indicator is 1, then determine that this application needs user to confirm; The application priority indicator of the 3rd application is 0x03, and the most significant digit of application priority indicator is not 1, then determine that this application does not need user to confirm;
Step 131: whether terminal judges supports that user confirms, is, performs step 132, otherwise terminate;
Step 132: this application of terminal demonstration, judges whether to receive triggering in Preset Time, is, select this application, performs step 137, otherwise terminates;
Step 133: terminal demonstration application candidate list;
Particularly, if application priority indicator exists and the priority difference of application, then to apply priority indicator priority display application candidate list from high to low; If application priority indicator exists and the priority of application is identical, then with the priority display application candidate list that self-defined priority or smart card provide; If the non-existent application of application priority indicator, then with the priority display application candidate list that self-defined priority or smart card provide;
Such as, the application priority indicator of first application is 0x81, the application priority indicator of second application is 0x82, the application priority indicator of the 3rd application is 0x03, then first show the application message of first application, show the application message of second application again, finally show the application message of the 3rd application; The applying label of first application is 4E 4F 4E 45 4D 56, then show NONEMV; The applying label of second application is 56 49 53 41 43 52 45 44 49 54, preferential 43 52 45 44 49 544F 44 45 56 49 53 41 by name of application, value due to publisher's code table index is 0x01, then terminal not display application label, the preferential name of display application, namely shows CREDITODEVISA; The applying label of the 3rd application is 41 50 50 33, then show APP3;
Step 134: whether terminal judges supports that user confirms, is, performs step 135, otherwise perform step 136;
Step 135: whether terminal judges receives triggering in Preset Time is then corresponding according to triggering selection application, performs step 137, otherwise terminates;
Step 136: terminal is according to application priority indicator, and the application that the application medium priority that selection does not need user to carry out confirming is the highest, performs step 137;
Preferably, the most significant digit not needing user to carry out the application priority indicator of the application confirmed is 0;
Such as, in the present embodiment, the application priority indicator of the 3rd application is 03, and the most significant digit of application priority indicator is 0, then determine that this application does not need user to confirm;
This step also comprises, and needs user to carry out the application confirmed in terminal deletion application candidate list;
Preferably, terminal deletion application priority indicator is the application of the first preset format;
Step 137: terminal, according to the application sequence number corresponding with the application selected, sends the 4th selection instruction to smart card;
Such as, in the present embodiment, user selects first application, then terminal obtains the application sequence number corresponding with the application that user selects, and namely application sequence number is A0 00 00 00 99 90 90; Then the 4th selection instruction is 00 A4 04 00 07 A0 00 00 00 99 90 90;
Step 138: terminal receives the 5th reply data that smart card returns according to the 4th selection instruction, judging that whether the 5th reply data is correct, is perform step 139, otherwise deletes the application of selection in application candidate list, returns step 128;
Such as, 5th reply data is 6F 3A 84 07 A0 00 00 00 99 90 90 A5 2F 50 06 4E4F 4E 45 4D 56 87 01 81 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9,F09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 90 00, wherein, last 2 bytes are 0x9000, determine that the 5th reply data is correct, 0x84 is the label of DF name, thereafter a byte 0x07 is the length of DF name, thereafter A0 00 00 00 99 90 90 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x2F is the length of file control information, the content of 50 06 4E 4F 4E 45 4D 56 87 01 81 9F 38 12 9F 1A 02 9F 33 039F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9,F11 01 01 thereafter, wherein, 0x50 is the label of applying label, thereafter a byte 0x06 is the length of applying label, thereafter 4E 4F 4E 45 4D 56 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x81 is the content of application priority indicator, 9F 38 is the label of PDOL, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 3501 is the content of PDOL,
Step 139: whether the application sequence number in terminal judges the 4th selection instruction mates completely with the private file name in the 5th reply data, it is then selective gist success, preserve the Treatment Options data object list in the 5th reply data, process ends, otherwise in application candidate list, delete the application of selection, return step 128;
Such as, DF name in AID in 4th selection instruction and the 5th reply data is A0 00 00 00 9,990 90, then terminal preserves PDOL:9F 1A 02 9F 33 03 9F 40 05 9F 1B04 9F 09 02 9F 35 01 in the 5th reply data, and application choice terminates;
In the present embodiment, if the success of terminal selective gist, then terminal and smart card arrange identical application respectively as current application, and namely current application is the application sequence number corresponding application in the 4th selection instruction.
A kind of terminal provided in the present embodiment and smart card consult the method for selective gist, both support terminal and smart card consulted selective gist according to catalogue selection function, also support terminal and smart card consult selective gist according to application sequence list selection function, compatible good; For the smart card of many application, if increase an application in smart card, correspondingly, only need increase the sequence number of this application in terminal in application sequence list, upgrading is fast, does not need amendment terminal kernel, is easy to safeguard.
Embodiment 3
Embodiments of the invention 3 provide a kind of method of terminal and smart card negotiation selective gist, as shown in Figure 5, comprising:
Step s1: terminal initialization application candidate list, obtains first application sequence in the application sequence list preset number as current application sequence number;
Step s2: terminal sends the second selection instruction according to current application sequence number to smart card, receive the 3rd reply data that smart card returns according to the second selection instruction, judge private file name in the 3rd reply data whether with current application sequence numbers match, then according to the 3rd reply data more new opplication candidate list, perform step s3, otherwise perform step s3;
Step s3: whether there is application sequence number after the current application sequence number in the list of terminal judges application sequence, be, upgrade current application sequence number, return step s2, otherwise perform step s4;
Step s4: whether terminal judges application candidate list is empty, is perform step s5, otherwise performs step s9;
Step s5: terminal obtains the short file identification in smart card, initialization current record number;
Step s6: terminal sends read record instruction according to short file identification and current record number to smart card, receive the second reply data that smart card returns according to read record instruction, the record read in smart card is judged whether according to the second reply data, be perform step s8, otherwise perform step s7;
Step s7: whether the application catalogue file in terminal judges second reply data mates with the application sequence number in the application sequence list preset, then according to the more new opplication candidate list of the application message in the second reply data, upgrade current record number, return step s6, otherwise renewal current record number, returns step s6;
Step s8: terminal judges whether there is the application jointly supported with smart card according to application candidate list, is perform step s9, otherwise terminates;
Step s9: terminal selects an application, the information obtaining application in application candidate list is applied in again according to what determine, according to the application sequence number in the information got, the 4th selection instruction is sent to smart card, receive the 5th reply data that smart card returns according to the 4th selection instruction, judge whether the 5th reply data meets the first preset requirement, it is then selective gist success, preserve the Treatment Options data object list in the 5th reply data, process ends, otherwise in application candidate list, delete the information of the application got, return step s8.
Embodiment 4
Embodiments of the invention 4 provide a kind of method of terminal and smart card negotiation selective gist, as shown in Figure 6 to 8, comprising:
Step 201: terminal initialization application candidate list, obtains first application sequence in the application sequence list preset number as current application sequence number;
Such as, current application sequence number is A0 00 00 00 03 10 10;
Step 202: terminal sends the second selection instruction according to current application sequence number to smart card;
Such as, the second selection instruction is 00 A4 04 00 07 A0 00 00 00 03 10 10;
According to the 3rd reply data, step 203: terminal receives the 3rd reply data that smart card returns according to the second selection instruction, judges that whether smart card is locked or do not support instruction, is then selective gist failure, terminates, otherwise perform step 204;
Particularly, whether terminal judges the 3rd reply data is 0x6A81, is, determines that whether smart card is locked or do not support, otherwise determines that smart card is not locked and supports instruction;
Step 204: whether terminal judges the 3rd reply data meets the 5th preset requirement, is perform step 205, otherwise perform step 213;
Particularly, whether there is 0x9000 in terminal judges the 3rd reply data and data layout is correct, be determine that the 3rd reply data meets the 5th preset requirement, otherwise determine that the 3rd reply data does not meet the 5th preset requirement;
In the present embodiment, the 3rd reply data does not meet the 5th preset requirement and comprises: status code is not 0x9000 or 0x6283, file control information format error; Necessary data are lacked in 3rd reply data; Such as, the data that it is label that necessary data comprise with 0x6F, 0x84,0xA5;
Such as, in the present embodiment, the 3rd reply data is 6F 32 84 07 A0 00 00 00 03 10 10 A527 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 3501 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 90 00; Wherein, last 2 bytes are 0x9000, determine that the 3rd reply data is correct; 0x84 is the label of DF name, thereafter a byte 0x07 is the length of DF name, thereafter A0 00 00 00 03 10 10 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x27 is the length of file control information, and 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 015F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 are thereafter the content of file control information;
Step 205: whether the private file name in terminal judges the 3rd reply data mates completely with current application sequence number, is perform step 206, otherwise perform step 207;
Such as, in the present embodiment, DF name and current application sequence number are A0 00 00 00 03 10 10, then DF name is mated completely with current application sequence number, perform step 206;
If the 3rd reply data is 6F 33 84 08 A0 00 00 00 03 10 10 00 A5 27 87 01 019F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 0,865 73 65 6E 66 72 64 65 9F 11 01 01 90 00, wherein, 0x84 is the label of DF name, thereafter a byte 0x08 is the length of DF name, thereafter A0 00 00 00 03 10 10 00 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x27 is the length of file control information, thereafter 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9,F09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 are the content of file control information, then DF name and current application sequence number Incomplete matching, perform step 207,
Step 206: according to the 3rd reply data, terminal judges whether application is locked, and is perform step 213, otherwise according to the more new opplication candidate list of the file control information in the 3rd reply data, perform step 213;
Particularly, whether terminal judges the 3rd reply data is 0x6283, is, determines that application is locked, otherwise determines that application is not locked; More new opplication candidate list is: the DF name in the applying label in file control information, application priority indicator and the 3rd reply data and application sequence number are stored in application candidate list by terminal;
Such as, file control information in 3rd reply data is 87 01 01 9F 38 12 9F 1A 02 9,F33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 6465 9F 11 01 01, wherein, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x01 is the content of application priority indicator, 9F 38 is PDOL (Processing Options Data Object List, Treatment Options data object list) label, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 4005 9F 1B 04 9F 09 02 9F 35 01 is the content of PDOL, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index, more new opplication candidate list is: 84 08 A0 00 00 00 03 1,010 00 87 01 01 add in application candidate list by terminal,
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 207: terminal is according to application choice indicator corresponding with current application sequence number in the application sequence list preset, judge whether that the private file name in permission the 3rd reply data is mated with current application sequence number portion, be perform step 208, otherwise perform step 213;
Step 208: the private file name in terminal judges the 3rd reply data and current application sequence number whether semi-match, is perform step 209, otherwise performs step 213;
Particularly, whether the predetermined fraction of the private file name in terminal judges the 3rd reply data is identical with current application sequence number, be determine that private file name is mated with current application sequence number portion, otherwise determine that private file name is not mated with current application sequence number portion; Such as, the predetermined fraction of private file name is front 7 bytes of private file name, if private file is called A0 00 00 00 03 10 10 00, current application sequence number is A0 00 00 00 03 10 10, then determine that private file name is mated with current application sequence number portion;
Step 209: according to the 3rd reply data, terminal judges whether application is locked, and is perform step 210, otherwise according to the more new opplication candidate list of the file control information in the 3rd reply data, perform step 210;
Particularly, whether terminal judges the 3rd reply data is 0x6283, is, determines that application is locked, otherwise determines that application is not locked;
Particularly, more new opplication candidate list is: the DF name in the applying label in file control information, application priority indicator and the 3rd reply data is stored in application candidate list by terminal; Wherein, DF name stores as application sequence number;
Such as, file control information in 3rd reply data is 87 01 01 9F 38 12 9F 1A 02 9,F33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 6465 9F 11 01 01, wherein, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x01 is the content of application priority indicator, 9F 38 is PDOL (Processing Options Data Object List, Treatment Options data object list) label, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 4005 9F 1B 04 9F 09 02 9F 35 01 is the content of PDOL, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index, more new opplication candidate list is: 84 08 A0 00 00 00 03 1,010 00 87 01 01 add in application candidate list by terminal,
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 210: terminal sends the 3rd selection instruction according to current application sequence number to smart card, receives the 4th reply data that smart card returns according to the 3rd selection instruction;
Such as, the 3rd selection instruction is 00 A4 04 02 07 A0 00 00 00 03 10 10,
Step 211: whether terminal judges the 4th reply data meets the 4th preset requirement, is perform step 212, otherwise perform step 213;
Step 212: according to the 4th reply data, terminal judges whether application is locked, and is return step 210, otherwise according to the more new opplication candidate list of the file control information in the 4th reply data, returns step 210;
Particularly, whether terminal judges the 4th reply data is 0x6283, is, determines that application is locked, otherwise determines that application is not locked; More new opplication candidate list is: the DF name in the applying label in file control information, application priority indicator and the 4th reply data is stored in application candidate list by terminal; Wherein, DF name stores as application sequence number;
Such as, 4th reply data is 6F 33 84 08 A0 00 00 00 03 10 10 01 A5 27 87 0101 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2,D08 65 73 65 6E 66 72 64 65 9F 11 01 01 90 00, wherein, 0x84 is the label of DF name, thereafter a byte 0x08 is the length of DF name, thereafter A0 00 00 00 03 10 10 01 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x27 is the length of file control information, thereafter 87 01 01 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9,F09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 are the content of file control information, wherein, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x01 is the content of application priority indicator, 9F 38 is PDOL (Processing Options Data Object List, Treatment Options data object list) label, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 40 059F 1B 04 9F 09 02 9F 35 01 is the content of PDOL, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index, more new opplication candidate list is: 84 08 A0 00 00 00 03 10 10 0,187 01 01 add in application candidate list by terminal,
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 213: whether there is application sequence number after the current application sequence number in the list of terminal judges application sequence, be, upgrade current application sequence number, return step 202, otherwise perform step 214;
Step 214: whether there is application message in terminal judges application candidate list, is perform step 229, otherwise perform step 215;
Step 215: terminal sends the first selection instruction according to the private file name preset to smart card;
Such as, the first selection instruction is: 00 A4 04 00 0E 31 50 41 59 2E 53 59 53 2E 4,444 46 30 31; Wherein, 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 are DF (Dedicated File, the private file) name preset;
Step 216: terminal receives the first reply data that smart card returns according to the first selection instruction, judges whether the first reply data meets the second preset requirement, is, performs step 217, otherwise selective gist failure, terminate;
Particularly, whether there is 0x9000 in terminal judges first reply data and data layout is correct, be determine that the first reply data meets the second preset requirement, otherwise determine that the first reply data does not meet the second preset requirement;
In the present embodiment, first reply data does not meet the second preset requirement and comprises: smart card does not have catalogue selection function, catalogue selection function in smart card is locked, the file control information format error in the first reply data, lacks necessary data in the first reply data; Such as, the data that it is label that necessary data comprise with 0x6F, 0x84,0xA5 or 0x88;
Such as, in the present embodiment, the first reply data is: 6F 2F 84 0E 31 50 41 59 2E 53 5953 2E 44 44 46 30 31 A5 1D 88 01 01 5F 2D 08 65 73 65 6E 66 72 64 65 9,F11 01 01 BF 0C 08 85 06 12 34 56 78 9A BC 90 00, wherein, last 2 bytes are 0x9000, determine that the first reply data is correct, in first reply data, 0x6F is the label of file control information template, 0x2F is the length of file control information template, 0x84 is the label of DF name, thereafter a byte 0x0E is the length of DF name, thereafter 31 50 41 59 2E 53 59 53 2E 44 44 46 30 31 are DF (Dedicated File, private file) content of name, 0xA5 is the label of file control information, thereafter a byte 0x1D is the length of file control information, thereafter 88 01 01 5F 2D 08 65 7365 6E 66 72 64 65 9F 11 01 01 BF 0C 08 85 06 12 34 56 78 9A BC are the content of file control information, wherein 0x88 is SFI (Short File Identifier, short file identification) label, thereafter a byte 0x01 is the length of SFI name, thereafter 0x01 is the value of SFI, 9F 11 is the label of publisher's code table index, thereafter a byte 0x01 is the length of publisher's code table index, thereafter 0x01 is the value of publisher's code table index,
Step 217: terminal initialization application candidate list;
Particularly, terminal initialization application candidate list is for emptying application candidate list;
Step 218: whether there is correct short file identification in terminal judges first reply data is then initialization current record number, performs step 219, otherwise selective gist failure, terminate;
Particularly, the first label value whether is there is in terminal judges first reply data, otherwise determine to there is not SFI in the first reply data, determine to there is SFI in the first reply data, obtain the value of the SFI after the first label value, continue the value of SFI that judges to get whether in the first scope, be determine to there is correct SFI in the first reply data, otherwise determine there is not correct SFI in the first reply data; Preferably, the initial value of current record number is 1;
Such as, the first label value is 0x88, and the first scope is 0x01 to 0x0A; The value obtaining the SFI after 0x88 is 0x01, then SFI is in the first scope;
Step 219: terminal sends read record instruction according to short file identification and current record number to smart card;
Such as, terminal sends the first read record instruction 00 B2 01 0C00 according to SFI and current record number to smart card, smart card is 6C 57 according to the data that the first read record instruction returns, terminal obtains record length 0x57 from these data, and terminal sends the second read record instruction 00 B2 010C 57 according to SFI and record length to smart card again;
Step 220: terminal receives the second reply data that smart card returns according to read record instruction, judges whether the record read in smart card, is, perform step 221 according to the second reply data, otherwise perform step 222;
Particularly, whether terminal judges second reply data is 0x6A83, is, has read the record in smart card, otherwise has not read the record in smart card;
Step 221: whether terminal judges application candidate list is empty, is then selective gist failure, terminates, otherwise perform step 229;
Step 222: whether terminal judges second reply data meets the 3rd preset requirement, is perform step 223, otherwise selective gist failure, terminate;
Particularly, whether there is 0x9000 in terminal judges second reply data and data layout is correct, be determine that the second reply data meets the 3rd preset requirement, otherwise determine that the second reply data does not meet the 3rd preset requirement;
In the present embodiment, the second reply data does not meet the 3rd preset requirement and comprises: the second response data format mistake, lacks application directory name, applying label etc.;
Such as, in the present embodiment, second reply data is: 70 55 61 14 4F 07 A0 00 00 00 9,990 90 50 06 4E 4F 4E 45 4D 56 87 01 81 61 28 4F 07 A0 00 00 00 03 10 1050 0A 56 49 53 41 43 52 45 44 49 54 87 01 82 9F 12 0D 43 52 45 44 49 544F 44 45 56 49 53 41 61 13 4F 08 A0 00 00 00 03 10 10 03 50 04 41 50 5,033 87 01 03 90 00, wherein, last 2 bytes are 0x9000, determine that the second reply data is correct;
Step 223: whether there is entrance mark in terminal judges second reply data, is perform step 224, otherwise upgrades current record number, returns step 219;
Particularly, whether there is the second label value in terminal judges first reply data, be, determine in the second reply data, to there is entrance mark, otherwise determine in the second reply data, to there is not entrance mark;
Such as, entrance mark i.e. the second label value is 0x61;
Step 224: first entrance mark that terminal obtains in the second reply data identifies as current entry;
Such as, terminal searches the second label value 0x61 from front to back in the second reply data, finds 0x61, then identified as current entry by the 0x61 of the 3rd byte the 3rd byte; Data between this entrance mark and next entrance identify are the application message that this entrance identifies;
Such as, current entry identifies, application message after the 0x61 of i.e. the 3rd byte is: 14 4F 0,7A0 00 00 00 99 90 90 50 06 4E 4F 4E 45 4D 56 87 01 81, wherein, 0x14 is the length of this application message, 0x4F is ADF (Application Directory File, application catalogue file) label, thereafter a byte 0x07 is the length of ADF name, thereafter A0 00 00 00 99 90 90 is the content of ADF, 0x50 is the label of applying label, thereafter a byte 0x06 is the length of applying label, thereafter 4E 4F 4E 45 4D 56 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x87 is the content of application priority indicator, without the preferential name of application in this application message,
Step 225: the application catalogue file after terminal judges current entry mark and the application sequence number in the application sequence list preset whether complete match, then according to the application message more new opplication candidate list after current entry mark, perform step 228, otherwise perform step 226;
Particularly, ADF (application catalogue file) identical application sequence number after whether terminal judges can find and to identify with current entry in the application sequence list preset, be, the ADF in after determining current entry mark and application sequence complete match in application sequence list, otherwise determine current entry identify after in ADF not with the application sequence complete match in application sequence list; More new opplication candidate list is: terminal by current entry identify after application message in applying label, apply priority indicator, apply preferential name and ADF and application sequence number be stored into application candidate list in;
Such as, in the present embodiment, more new opplication candidate list is: 4F 07 A0 00 00 00 99 9,090 50 06 4E 4F 4E 45 4D 56 87 01 81 adds in application candidate list by terminal;
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 226: the application choice indicator that terminal is corresponding according to the application catalogue file after identifying with current entry in the application sequence list preset, judge whether to allow the application catalogue file after current entry mark and the application sequence semi-match in application sequence list, be perform step 227, otherwise perform step 228;
Step 227: the application catalogue file after terminal judges current entry mark and application sequence in application sequence list number whether semi-match, then according to the application message more new opplication candidate list after current entry mark, perform step 228, otherwise directly perform step 228;
Particularly, the application sequence number that the predetermined fraction of the ADF after whether terminal judges can find and to identify with current entry in application sequence list is identical, determine the ADF after current entry mark and application sequence semi-match in application sequence list, otherwise determine current entry identify after ADF not with the application sequence semi-match in application sequence list; Such as, the predetermined fraction of ADF is front 7 bytes of ADF, if the ADF after current entry mark is A0 00 00 00 03 10 10 03, application sequence number in application sequence list is A0 00 00 00 03 10 10, then determine the ADF after current entry mark and the application sequence semi-match in application sequence list; More new opplication candidate list is: terminal by current entry identify after application message in applying label, apply priority indicator, apply preferential name and ADF and application sequence number be stored into application candidate list in;
In the present embodiment, more can also comprise before new opplication candidate list: initialization application candidate list;
Step 228: whether also there is entrance mark after terminal judges current entry mark, be, upgrades current entry mark, returns step 225, otherwise upgrade current record number, return step 219;
Particularly, terminal searches the second label value after current entry mark, judges whether to find current entry mark, is, also there is entrance mark after determining current entry mark, otherwise there is not entrance mark after determining current entry mark; Renewal current entry is designated the rear entrance mark identified by current entry and identifies as current entry; Preferably, current record number is upgraded for current record number is added 1 certainly;
Such as, in the present embodiment, also comprise 2 entrance marks in the second reply data, be respectively:
25th byte is 0x61, and the application message after this entrance mark is: 28 4F 07 A0 00 00 0,003 10 10 50 0A 56 49 53 41 43 52 45 44 49 54 87 01 82 9F 12 0D 43 52 4,544 49 54 4F 44 45 56 49 53 41, wherein, 0x28 is the length of this application message, 0x4F is the label of ADF, thereafter a byte 0x07 is the length of ADF name, thereafter A0 00 00 00 03 1010 is the content of ADF, 0x50 is the label of applying label, thereafter a byte 0x0A is the length of applying label, thereafter 56 49 53 41 43 52 45 44 49 54 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x82 is the content of application priority indicator, 9F 12 is the label applying preferential name, thereafter a byte 0x0D is the length applying preferential name, thereafter 43 52 45 44 49 54 4F 44 45 56 4,953 41 are the content applying preferential name,
67th byte is 0x61, application message after this entrance mark is: 13 4F 08 A0 00 00 0,003 10 10 03 50 04 41 50 50 33 87 01 03, wherein, 0x13 is the length of this application message, 0x4F is the label of ADF, thereafter a byte 0x08 is the length of ADF name, thereafter A0 00 00 0,003 10 10 03 is the content of ADF, 0x50 is the label of applying label, thereafter a byte 0x04 is the length of applying label, thereafter 41 50 50 33 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 03 is the content applying priority indicator, without the preferential name of application in this application message,
Step 229: whether terminal judges only has one to have with smart card the application jointly supported or mutually support, is perform step 230, otherwise performs step 233;
Also comprise before this step: terminal judges whether there is the application jointly supported with smart card according to application candidate list, is perform step 229, otherwise terminates;
Such as, applying candidate list is: 4F 07 A0 00 00 00 99 90 90 50 06 4E 4F 4E 454D 56 87 01 81 4F 07 A0 00 00 00 03 10 10 50 0A 56 49 53 41 43 52 45 4,449 54 87 01 82 9F 12 0D 43 52 45 44 49 54 4F 44 45 56 49 53 41 4F 08 A000 00 00 03 10 10 03 50 04 41 50 50 33 87 01 03; This application candidate list comprises the application message of 3 application, be respectively: first application 4F 07 A0 00 00 00 99 90 90 50 064E 4F 4E 45 4D 56 87 01 81, second application 4F 07 A0 00 00 00 03 10 10 50 0,A56 49 53 41 43 52 45 44 49 54 87 01 82 9F 12 0D 43 52 45 44 49 54 4F the 4,445 56 49 53 41, the 3rd application 4F 08 A0 00 00 00 03 10 10 03 50 04 41 50 5,033 87 01 03;
Step 230: terminal is according to the application priority indicator in application candidate list, and judging that this application confirms the need of user, is perform step 231, otherwise selects this application, performs step 237;
Particularly, whether terminal judges application priority indicator meets the first preset format, is, determines that this application needs user to confirm, otherwise determines that this application does not need user to confirm;
Preferably, the first preset format is the most significant digit of application priority indicator is 1;
Such as, the application priority indicator of first application is 0x81, and the most significant digit of application priority indicator is 1, then determine that this application needs user to confirm; The application priority indicator of second application is 0x82, and the most significant digit of application priority indicator is 1, then determine that this application needs user to confirm; The application priority indicator of the 3rd application is 0x03, and the most significant digit of application priority indicator is not 1, then determine that this application does not need user to confirm;
Step 231: whether terminal judges supports that user confirms, is, performs step 232, otherwise terminate;
Step 232: this application of terminal demonstration, judges whether to receive triggering in Preset Time, is, select this application, performs step 237, otherwise terminates;
Step 233: terminal demonstration application candidate list;
Particularly, if application priority indicator exists and the priority difference of application, then to apply priority indicator priority display application candidate list from high to low; If application priority indicator exists and the priority of application is identical, then with the priority display application candidate list that self-defined priority or smart card provide; If the non-existent application of application priority indicator, then with the priority display application candidate list that self-defined priority or smart card provide;
Such as, the application priority indicator of first application is 0x81, the application priority indicator of second application is 0x82, the application priority indicator of the 3rd application is 0x03, then first show the application message of first application, show the application message of second application again, finally show the application message of the 3rd application; The applying label of first application is 4E 4F 4E 45 4D 56, then show NONEMV; The applying label of second application is 56 49 53 41 43 52 45 44 49 54, preferential 43 52 45 44 49 544F 44 45 56 49 53 41 by name of application, value due to publisher's code table index is 0x01, then terminal not display application label, the preferential name of display application, namely shows CREDITODEVISA; The applying label of the 3rd application is 41 50 50 33, then show APP3;
Step 234: whether terminal judges supports that user confirms, is, performs step 235, otherwise perform step 236;
Step 235: whether terminal judges receives triggering in Preset Time is then corresponding according to triggering selection application, performs step 237, otherwise terminates;
Step 236: terminal is according to application priority indicator, and the application that the application medium priority that selection does not need user to carry out confirming is the highest, performs step 237;
Preferably, the most significant digit not needing user to carry out the application priority indicator of the application confirmed is 0;
Such as, in the present embodiment, the application priority indicator of the 3rd application is 03, and the most significant digit of application priority indicator is 0, then determine that this application does not need user to confirm;
This step also comprises, and needs user to carry out the application confirmed in terminal deletion application candidate list;
Preferably, terminal deletion application priority indicator is the application of the first preset format;
Step 237: terminal, according to the application sequence number corresponding with the application selected, sends the 4th selection instruction to smart card;
Such as, in the present embodiment, user selects first application, then terminal obtains the application sequence number corresponding with the application that user selects, and namely application sequence number is A0 00 00 00 99 90 90; Then the 4th selection instruction is 00 A4 04 00 07 A0 00 00 00 99 90 90;
Step 238: terminal receives the 5th reply data that smart card returns according to the 4th selection instruction, judging that whether the 5th reply data is correct, is perform step 239, otherwise deletes the application of selection in application candidate list, performs step 240;
Such as, 5th reply data is 6F 3A 84 07 A0 00 00 00 99 90 90 A5 2F 50 06 4E4F 4E 45 4D 56 87 01 81 9F 38 12 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9,F09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9F 11 01 01 90 00, wherein, last 2 bytes are 0x9000, determine that the 5th reply data is correct, 0x84 is the label of DF name, thereafter a byte 0x07 is the length of DF name, thereafter A0 00 00 00 99 90 90 is the content of DF name, thereafter a byte 0xA5 is the label of file control information, 0x2F is the length of file control information, the content of 50 06 4E 4F 4E 45 4D 56 87 01 81 9F 38 12 9F 1A 02 9F 33 039F 40 05 9F 1B 04 9F 09 02 9F 35 01 5F 2D 08 65 73 65 6E 66 72 64 65 9,F11 01 01 thereafter, wherein, 0x50 is the label of applying label, thereafter a byte 0x06 is the length of applying label, thereafter 4E 4F 4E 45 4D 56 is the content of applying label, 0x87 is the label of application priority indicator, thereafter a byte 0x01 is the length of application priority indicator, thereafter 0x81 is the content of application priority indicator, 9F 38 is the label of PDOL, thereafter a byte 0x12 is the length of PDOL, thereafter 9F 1A 02 9F 33 03 9F 40 05 9F 1B 04 9F 09 02 9F 3501 is the content of PDOL,
Step 239: whether the application sequence number in terminal judges the 4th selection instruction mates completely with the private file name in the 5th reply data, it is then selective gist success, preserve the Treatment Options data object list in the 5th reply data, process ends, otherwise in application candidate list, delete the application of selection, perform step 240;
Such as, DF name in AID in 4th selection instruction and the 5th reply data is A0 00 00 00 9,990 90, then terminal preserves PDOL:9F 1A 02 9F 33 03 9F 40 05 9F 1B04 9F 09 02 9F 35 01 in the 5th reply data, selective gist success, process ends;
In the present embodiment, if the success of terminal selective gist, then terminal and smart card arrange identical application respectively as current application, and namely current application is the application sequence number corresponding application in the 4th selection instruction;
Step 240: terminal judges whether there is the application jointly supported with smart card according to application candidate list, is return step 229, otherwise terminates.
A kind of terminal provided in the present embodiment and smart card consult the method for selective gist, both support terminal and smart card consulted selective gist according to catalogue selection function, also support terminal and smart card consult selective gist according to application sequence list selection function, compatible good; For the smart card of many application, if increase an application in smart card, correspondingly, only need increase the sequence number of this application in terminal in application sequence list, upgrading is fast, does not need amendment terminal kernel, is easy to safeguard.
Embodiment 5
Embodiments of the invention 5 provide the device of a kind of terminal and smart card negotiation selective gist, as shown in Figure 9, comprising: the first initial module 301, sending module 302, receiver module 303, first judge module 304, second judge module 305, the 3rd judge module 306, first update module 307, second initial module 308, the 4th judge module 309, the 5th judge module 310, first acquisition module 311, the 6th judge module 312, memory module 313, removing module 314 and the tenth judge module 315;
First initial module 301, for obtaining the short file identification in smart card, initialization application candidate list and current record number;
Sending module 302, sends read record instruction for the short file identification that obtains according to the first initial module 301 and current record number to smart card;
Receiver module 303, for receiving the second reply data that smart card returns according to the read record instruction that sending module 302 sends;
First judge module 304, the second reply data for receiving according to receiver module 303 judges whether the record read in smart card;
Second judge module 305, for when the first judge module 304 is judged as YES, judges whether application candidate list is empty;
3rd judge module 306, for when the first judge module 304 is judged as NO, judges whether the application catalogue file in the second reply data that receiver module 303 receives mates with the application sequence number in the application sequence list preset;
First update module 307, for when the 3rd judge module 306 is judged as YES, according to the application message more new opplication candidate list in the second reply data that receiver module 303 receives, upgrades current record number; When the 3rd judge module 306 is judged as NO, upgrade current record number;
Second initial module 308, for obtaining first application sequence in default application sequence list number as current application sequence number;
Sending module 302, also for sending the second selection instruction according to current application sequence number to smart card;
Receiver module 303, also for receiving the 3rd reply data that smart card returns according to the second selection instruction that sending module 302 sends;
4th judge module 309, for judge private file name in the 3rd reply data that receiver module 303 receives whether with current application sequence numbers match;
First update module 307, also for when the 4th judge module 309 is judged as YES, according to the 3rd reply data more new opplication candidate list that receiver module 303 receives;
5th judge module 310, for being judged as NO at the 4th judge module 309, or the first update module 307 is according to after the 3rd reply data more new opplication candidate list, whether there is application sequence number after judging the current application sequence number in application sequence list, be, upgrade current application sequence number;
Tenth judge module 315, for judging whether there is the application jointly supported with smart card according to application candidate list;
First acquisition module 311, for when the tenth judge module 315 is judged as YES, selects an application according to preset rules, then is applied according to what determine the information obtaining application in application candidate list;
Sending module 302, also for according to the application sequence number in the information got, sends the 4th selection instruction to smart card;
Receiver module 303, also for receiving the 5th reply data that smart card returns according to the 4th selection instruction that sending module 302 sends;
6th judge module 312, for judging whether the 5th reply data that receiver module 303 receives meets the first preset requirement;
Memory module 313, for when the 6th judge module 312 is judged as YES, the Treatment Options data object list in the 5th reply data that preservation receiver module 303 receives;
Removing module 314, for when the 6th judge module 312 is judged as NO, deletes the information of the application got in application candidate list.
First initial module 301 comprises the first judging unit and the second judging unit;
Sending module 302, also for sending the first selection instruction according to the private file name preset to smart card;
Receiver module 303, also for receiving the first reply data that smart card returns according to the first selection instruction that sending module 302 sends;
First judging unit, for judging whether the first reply data that receiver module 303 receives meets the second preset requirement;
Second judging unit, for when the first judging unit is judged as YES, judges whether there is correct short file identification in the first reply data, be, obtain short file identification.
First initial module 301 also comprises the 3rd judging unit, and the first reply data for receiving according to receiver module 303 judges that whether smart card is locked or do not support this instruction.
Second judging unit specifically for, when the first judging unit is judged as YES, judge whether there is the first label value in the first reply data, the value of the short file identification after the first label value is then obtained as there is the first label value, continue the value of short file identification that judges to get whether in the first scope, as described in the value of short file identification in the first scope, then obtain short file identification.
Sending module 302 sends read record instruction for the short file identification that obtains according to the first initial module 301 and current record number to smart card, comprising:
Sending module 302 is for sending the first read record instruction according to short file identification and current record number to smart card;
Receiver module 303 is also for receiving the data that smart card returns according to the first read record instruction that sending module 302 sends;
Sending module 302 also in the data returned that receive from receiver module 303, obtains record length, then sends the second read record instruction according to short file identification and record length to smart card.
Device also comprises the 7th judge module, for judging whether the second reply data that receiver module 303 receives meets the 3rd preset requirement, otherwise initialization application candidate list.
3rd judge module 306 comprises: the 4th judging unit, the first acquiring unit, the 5th judging unit, the 6th judging unit, the 7th judging unit, the 8th judging unit;
Whether the 4th judging unit, exist entrance mark for judging in the second reply data that receiver module 303 receives;
First update module 307, also for when the 4th judging unit is judged as NO, upgrades current record number;
First acquiring unit, for when the 4th judging unit is judged as YES, first the entrance mark obtained in the second reply data identifies as current entry;
5th judging unit, for judging application catalogue file after current entry mark and the application sequence number in the application sequence list preset whether complete match;
First update module 307, also for when the 5th judging unit is judged as YES, according to the application message more new opplication candidate list after current entry mark
6th judging unit, for when the 5th judging unit is judged as NO, the application choice indicator corresponding according to the application catalogue file after identifying with current entry in application sequence list, judges whether to allow the application catalogue file after current entry mark and the application sequence semi-match in application sequence list;
7th judging unit, for when the 6th judging unit is judged as YES, judges application catalogue file after current entry mark and application sequence in application sequence list number whether semi-match;
First update module 307, also for when the 7th judging unit is judged as YES, according to the application message more new opplication candidate list after current entry mark;
Whether the 8th judging unit, also exist entrance mark after judging current entry mark;
First update module 307, also for when the 8th judging unit is judged as YES, upgrades current entry mark; When the 8th judging unit is judged as NO, upgrade current record number.
4th judging unit specifically for, judge whether there is the second label value in the second reply data, be, determine to exist in the second reply data entrance mark, otherwise determine in the second reply data, to there is not entrance mark.
5th judging unit specifically for, judge whether to find in the application sequence list preset the identical application sequence number of application catalogue file in after identifying with current entry, be, the application catalogue file in after determining current entry mark and application sequence complete match in application sequence list, otherwise determine current entry identify after in application catalogue file not with the application sequence complete match in application sequence list.
7th judging unit specifically for, judge whether to find in application sequence list the application sequence number that the predetermined fraction of the application catalogue file after identifying with current entry is identical, determine the application catalogue file after current entry mark and application sequence semi-match in application sequence list, otherwise determine current entry identify after application catalogue file not with the application sequence semi-match in application sequence list.
First update module 307 also for according to the application message more new opplication candidate list after current entry mark, is specially: the first update module 307 is also for being stored into the application priority indicator in the application message after current entry mark and application catalogue file in application candidate list.
4th judge module 309 comprises: the 8th judging unit, the 9th judging unit, the tenth judging unit, the 11 judging unit;
8th judging unit, for judge private file name in the 3rd reply data that receiver module 303 receives whether with current application sequence number complete match;
First update module 307, also for when the 8th judging unit is judged as YES, according to the 3rd reply data more new opplication candidate list that receiver module 303 receives;
9th judging unit, for when the 8th judging unit is judged as NO, according to application choice indicator corresponding with current application sequence number in application sequence list, judge whether that the private file name in permission the 3rd reply data is mated with current application sequence number portion;
Tenth judging unit, for when the 9th judging unit is judged as YES, judges private file name in the 3rd reply data and current application sequence number whether semi-match;
First update module 307, also for when the tenth judging unit is judged as YES, according to the 3rd reply data more new opplication candidate list that receiver module 303 receives;
Sending module 302, also for sending the 3rd selection instruction according to current application sequence number to smart card;
Receiver module 303, also for receiving the 4th reply data that smart card returns according to the 3rd selection instruction that sending module 302 sends;
11 judging unit, for judging whether the 4th reply data that receiver module 303 receives meets the 4th preset requirement;
First update module 307, also for when the 11 judging unit is judged as YES, according to the 4th reply data more new opplication candidate list.
4th judge module 309 also comprises the 12 judging unit, for judging whether the 3rd reply data that receiver module 303 receives meets the 5th preset requirement.
8th judging unit specifically for, judge that whether the private file name in the 3rd reply data is identical with current application sequence number, determine the private file name in the 3rd reply data and current application sequence number complete match, otherwise determine private file name in the 3rd reply data not with current application sequence number complete match.
4th judge module 309 also comprises the 13 judging unit, judges whether application corresponding with private file name in smart card is locked for the 3rd reply data received according to receiver module 303.
Tenth judging unit specifically for, judge that whether the predetermined fraction of the private file name in the 3rd reply data is identical with current application sequence number, be determine that private file name is mated with current application sequence number portion, otherwise determine that private file name is not mated with current application sequence number portion.
4th judge module 309 also comprises the 14 judging unit, judges whether application corresponding with private file name in smart card is locked for the 4th reply data received according to receiver module 303.
First update module 307, for according to the 3rd reply data more new opplication candidate list, is specially: the first update module 307 is for being stored in application candidate list by the application priority indicator in the file control information in the private file name in the 3rd reply data and the 3rd reply data;
First update module 307, for according to the 4th reply data more new opplication candidate list, is specially: the first update module 307 is for being stored into the application priority indicator in the file control information in the private file name in the 4th reply data and the 4th reply data in application candidate list.
Device also comprises the 8th judge module, only has one to have with smart card the application jointly supported or mutually support for judging to apply in candidate list.
When the 8th judge module judge to apply in candidate list only have one with smart card have jointly support or mutual support application time, the first acquisition module 311 comprises: the 15 judging unit, the 16 judging unit and the 17 judging unit;
15 judging unit, for according to the application priority indicator in application candidate list, judges that the application in application candidate list confirms the need of user, otherwise selective gist, obtain the information corresponding with application;
16 judging unit, for when the 15 judging unit is judged as YES, judges whether to support that user confirms;
17 judging unit, for when the 16 judging unit is judged as YES, display application, judges whether to receive triggering in Preset Time, is then selective gist, obtains and applies corresponding information.
15 judging unit specifically for judging whether application priority indicator meets the first preset format, is determine that application needs user to confirm, otherwise determines that application does not need user to confirm, selective gist, obtains the information of application.
When the 8th judge module judge to apply in candidate list have at least two with smart card have jointly support or mutual support application time, the first acquisition module 311 comprises: display unit, the 18 judging unit, the 19 judging unit and second acquisition unit;
Display unit, for display application candidate list;
For judging whether, 18 judging unit, supports that user confirms;
19 judging unit, for when the 18 judging unit is judged as YES, judges whether to receive triggering in Preset Time, otherwise terminates;
Second acquisition unit, for when the 18 judging unit is judged as NO, according to application priority indicator, the information of the application that the application medium priority that acquisition does not need user to carry out confirming is the highest; When the 19 judging unit is judged as YES, according to triggering the information obtaining corresponding application.
First removing module 311 also needs user to carry out the application confirmed for deleting in application candidate list.
Device also comprises the 9th judge module, for judging the private file name complete match in the 5th reply data whether application sequence in the 4th selection instruction number receives with receiver module 303.
The above; be only the present invention's preferably embodiment, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in technical scope disclosed by the invention; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (76)

1. terminal and smart card consult a method for selective gist, and it is characterized in that, described method comprises:
Step S1: described terminal obtains the short file identification in described smart card, initialization application candidate list and current record number;
Step S2: described terminal sends read record instruction according to described short file identification and current record number to described smart card, receive the second reply data that described smart card returns according to described read record instruction, judge whether to have read the record in described smart card according to described second reply data, be perform step S3, otherwise perform step S4;
Step S3: whether be empty, be perform step S5, otherwise perform step S8 if applying candidate list described in described terminal judges;
Step S4: whether the application catalogue file in the second reply data described in described terminal judges mates with the application sequence number in the application sequence list preset, upgrade described application candidate list according to the application message in described second reply data, upgrade current record number, return step S2, otherwise renewal current record number, returns step S2;
Step S5: described terminal obtains first application sequence in the application sequence list preset number as current application sequence number;
Step S6: described terminal sends the second selection instruction according to current application sequence number to smart card, receive the 3rd reply data that described smart card returns according to described second selection instruction, judge private file name in described 3rd reply data whether with current application sequence numbers match, upgrade described application candidate list according to described 3rd reply data, perform step S7, otherwise perform step S7;
Step S7: whether there is application sequence number after the current application sequence number in application sequence list described in described terminal judges, be, upgrade current application sequence number, return step S6, otherwise perform step S8;
Step S8: described terminal judges whether there is the application jointly supported with described smart card according to described application candidate list, be perform step S9, otherwise terminates;
Step S9: described terminal selects an application according to preset rules, the information obtaining described application in described application candidate list is applied in again according to what determine, according to the application sequence number in the information got, the 4th selection instruction is sent to described smart card, receive the 5th reply data that described smart card returns according to described 4th selection instruction, judge whether described 5th reply data meets the first preset requirement, it is then selective gist success, preserve the Treatment Options data object list in described 5th reply data, process ends, otherwise in described application candidate list, delete the information of the described application got, return step S8.
2. method according to claim 1, is characterized in that, described terminal obtains the short file identification in described smart card, comprising:
Step S1-1: described terminal sends the first selection instruction according to the private file name preset to described smart card, receives the first reply data that described smart card returns according to described first selection instruction;
Step S1-2: described in described terminal judges, whether the first reply data meets the second preset requirement, is, performs step S1-3, otherwise perform step S5;
Step S1-3: whether there is correct short file identification in the first reply data described in described terminal judges, be, obtains described short file identification, otherwise performs step S5.
3. method according to claim 2, it is characterized in that, comprise before described step S1-2: according to described first reply data, described terminal judges that whether described smart card is locked or do not support this instruction, be then selective gist failure, terminate, otherwise perform step S1-2.
4. method according to claim 2, it is characterized in that, correct short file identification whether is there is in first reply data described in described terminal judges, be specially: in the first reply data described in described terminal judges, whether there is the first label value, as exist the first label value then obtain as described in the value of short file identification after the first label value, continue the value of short file identification that judges to get whether in the first scope, there is correct short file identification in described first reply data, otherwise there is not correct short file identification in described first reply data, if do not exist the first label value then as described in there is not correct short file identification in the first reply data.
5. method according to claim 1, it is characterized in that, described terminal sends read record instruction according to described short file identification and current record number to described smart card, comprise: described terminal sends the first read record instruction according to described short file identification and current record number to smart card, described terminal receives the data that described smart card returns according to described first read record instruction, and therefrom obtaining record length, described terminal sends the second read record instruction according to described short file identification and described record length to described smart card.
6. method according to claim 1, it is characterized in that, comprise before described step S4: whether the second reply data described in described terminal judges meets the 3rd preset requirement, is perform step S4, otherwise apply candidate list described in initialization, perform step S5.
7. method according to claim 1, is characterized in that, described step S4 is specially:
Step S4-1: whether there is entrance mark in the second reply data described in described terminal judges, is perform step S4-2, otherwise upgrades current record number, returns step S2;
Step S4-2: first entrance mark that described terminal obtains in described second reply data identifies as current entry;
Step S4-3: the application catalogue file after described terminal judges current entry mark and the application sequence in described default application sequence list number whether complete match, upgrade described application candidate list according to the application message after current entry mark, perform step S4-6, otherwise perform step S4-4;
Step S4-4: the application choice indicator that described terminal is corresponding according to the application catalogue file after identifying with current entry in described application sequence list, judge whether to allow the application catalogue file after current entry mark and the application sequence semi-match in described application sequence list, be perform step S4-5, otherwise perform step S4-6;
Step S4-5: the application catalogue file after described terminal judges current entry mark and the application sequence in described application sequence list number whether semi-match, upgrade described application candidate list according to the application message after current entry mark, perform step S4-6, otherwise directly perform step S4-6;
Step S4-6: whether also there is entrance mark after described terminal judges current entry mark, be, upgrade current entry mark, return step S4-3, otherwise upgrade current record number, return step S2.
8. method according to claim 7, it is characterized in that, entrance mark whether is there is in second reply data described in described terminal judges, be specially: in the second reply data described in described terminal judges, whether there is the second label value, be determine in described second reply data, to there is entrance mark, otherwise determine in described second reply data, to there is not entrance mark.
9. method according to claim 7, it is characterized in that, application catalogue file after described terminal judges current entry mark and the application sequence in described default application sequence list number whether complete match, be specially: the identical application sequence number of application catalogue file in after whether described terminal judges can find and to identify with current entry in described default application sequence list, be, the application catalogue file in after determining current entry mark and the application sequence complete match in application sequence list, otherwise determine current entry mark after in application catalogue file not with the application sequence complete match in application sequence list.
10. method according to claim 7, it is characterized in that, application catalogue file after described terminal judges current entry mark and the application sequence in described application sequence list number whether semi-match, be specially: the application sequence number that the predetermined fraction of the application catalogue file after whether described terminal judges can find and to identify with current entry in described application sequence list is identical, determine the application catalogue file after current entry mark and the application sequence semi-match in application sequence list, otherwise determine current entry mark after application catalogue file not with the application sequence semi-match in application sequence list.
11. methods according to claim 7, it is characterized in that, described according to current entry mark after application message upgrade described application candidate list, be specially: described terminal by current entry identify after application message in application priority indicator and application catalogue file be stored in described application candidate list.
12. methods according to claim 1, is characterized in that, also comprise before described step S5: described terminal initialization application candidate list.
13. methods according to claim 1, it is characterized in that, private file name in 3rd reply data described in described terminal judges whether with current application sequence numbers match, upgrade described application candidate list according to described 3rd reply data, perform step S7, otherwise perform step S7, comprising:
Step S6-1: the private file name in the 3rd reply data described in described terminal judges whether with current application sequence number complete match, be perform step S6-2, otherwise perform step S6-3;
Step S6-2: described terminal upgrades described application candidate list according to described 3rd reply data, performs step S7;
Step S6-3: described terminal is according to application choice indicator corresponding with current application sequence number in described application sequence list, judge whether to allow the private file name in described 3rd reply data to mate with current application sequence number portion, be perform step S6-4, otherwise perform step S7;
Step S6-4: the private file name in the 3rd reply data described in described terminal judges and current application sequence number whether semi-match, is perform step S6-5, otherwise performs step S7;
Step S6-5: described terminal upgrades described application candidate list according to described 3rd reply data, performs step S6-6;
Step S6-6: described terminal sends the 3rd selection instruction according to current application sequence number to described smart card, receives the 4th reply data that described smart card returns according to described 3rd selection instruction;
Step S6-7: described in described terminal judges, whether the 4th reply data meets the 4th preset requirement is then step S6-8, otherwise performs step S7;
Step S6-8: described terminal upgrades described application candidate list according to described 4th reply data, returns step S6-6.
14. methods according to claim 13, is characterized in that, comprise before described step S6-1: described in described terminal judges, whether the 3rd reply data meets the 5th preset requirement, is perform step S6-1, otherwise perform step S7.
15. methods according to claim 13, it is characterized in that, private file name in 3rd reply data described in described terminal judges whether with current application sequence number complete match, be specially: whether the private file name in the 3rd reply data described in described terminal judges is identical with current application sequence number, determine the private file name in described 3rd reply data and current application sequence number complete match, otherwise determine private file name in described 3rd reply data not with current application sequence number complete match.
16. methods according to claim 13, it is characterized in that, comprise before described step S6-2: according to described 3rd reply data, described terminal judges whether application corresponding with described private file name in described smart card is locked, and is perform step S7, otherwise perform step S6-2.
17. methods according to claim 13, it is characterized in that, private file name in 3rd reply data described in described terminal judges and current application sequence number whether semi-match, be specially: whether the predetermined fraction of the private file name in the 3rd reply data described in described terminal judges is identical with current application sequence number, be determine that described private file name is mated with current application sequence number portion, otherwise determine that described private file name is not mated with current application sequence number portion.
18. methods according to claim 13, it is characterized in that, comprise before described step S6-5: according to described 3rd reply data, described terminal judges whether application corresponding with described private file name in described smart card is locked, and is perform step S6-6, otherwise perform step S6-5.
19. methods according to claim 13, it is characterized in that, comprise before described step S6-8: according to described 4th reply data, described terminal judges whether application corresponding with described private file name in described smart card is locked, and is return step S6-6, otherwise perform step S6-8.
20. methods according to claim 13, it is characterized in that, described terminal upgrades described application candidate list according to described 3rd reply data, is specially: the application priority indicator in the described file control information in the private file name in described 3rd reply data and described 3rd reply data is stored in described application candidate list by described terminal;
Described terminal upgrades described application candidate list according to described 4th reply data, is specially: the application priority indicator in the described file control information in the private file name in described 4th reply data and described 4th reply data is stored in described application candidate list by described terminal.
21. methods according to claim 1, it is characterized in that, when described terminal judges go out in described application candidate list only to have one with described smart card have jointly supports or mutual support application time, described terminal selects an application according to preset rules, be applied according to what determine the information obtaining described application in described application candidate list again, be specially:
Step S9-1: described terminal is according to the application priority indicator in described application candidate list, judge that the application in described application candidate list confirms the need of user, be perform step S9-2, otherwise select described application, obtain and apply corresponding information with described;
Step S9-2: whether described terminal judges supports that user confirms, is, performs step S9-3, otherwise terminate;
Step S9-3: apply described in described terminal demonstration, judges whether to receive triggering in Preset Time, is, select described application, obtains and applies corresponding information with described, otherwise terminates.
22. methods according to claim 21, it is characterized in that, described terminal is according to the application priority indicator in described application candidate list, judge that the application in described application candidate list confirms the need of user, be specially: apply priority indicator described in described terminal judges and whether meet the first preset format, be determine that described application needs user to confirm, otherwise determine that described application does not need user to confirm.
23. methods according to claim 1, it is characterized in that, when described terminal judges go out in described application candidate list to have at least two with described smart card have jointly supports or mutual support application time, described terminal selects an application according to preset rules, be applied according to what determine the information obtaining described application in described application candidate list again, be specially:
Step S9-4: apply candidate list described in described terminal demonstration;
Step S9-5: whether described terminal judges supports that user confirms, is, performs step S9-6, otherwise perform step S9-7;
Step S9-6: whether described terminal judges receives triggering in Preset Time, is then according to triggering the information obtaining corresponding application, otherwise terminates;
Step S9-7: described terminal, according to described application priority indicator, obtains the information of the highest application of application medium priority not needing user to carry out confirming.
24. methods according to claim 23, is characterized in that, described step S9-7 also comprises: apply described in described terminal deletion in candidate list and need user to carry out the application confirmed.
25. methods according to claim 1, it is characterized in that, described step S9 judges that described 5th reply data meets between the first preset requirement and selective gist success and also comprises: application sequence in the 4th selection instruction described in described terminal judges number whether with the private file name complete match in described 5th reply data, it is then selective gist success, preserve the Treatment Options data object list in described 5th reply data, terminate, otherwise in described application candidate list, delete the information of the described application got, return step S8.
26. methods according to claim 1, is characterized in that, described selective gist is successfully specially: described terminal and described smart card arrange identical application respectively as current application.
27. 1 kinds of terminals and smart card consult the method for selective gist, and it is characterized in that, described method comprises:
Step S1: described terminal initialization application candidate list, obtains first application sequence in the application sequence list preset number as current application sequence number;
Step S2: described terminal sends the second selection instruction according to current application sequence number to smart card, receive the 3rd reply data that described smart card returns according to described second selection instruction, judge private file name in described 3rd reply data whether with current application sequence numbers match, upgrade described application candidate list according to described 3rd reply data, perform step S3, otherwise perform step S3;
Step S3: whether there is application sequence number after the current application sequence number in application sequence list described in described terminal judges, be, upgrade current application sequence number, return step S2, otherwise perform step S4;
Step S4: whether be empty, be perform step S5, otherwise perform step S9 if applying candidate list described in described terminal judges;
Step S5: described terminal obtains the short file identification in described smart card, initialization current record number;
Step S6: described terminal sends read record instruction according to described short file identification and current record number to described smart card, receive the second reply data that smart card returns according to described read record instruction, judge whether to have read the record in described smart card according to described second reply data, be perform step S8, otherwise perform step S7;
Step S7: whether the application catalogue file in the second reply data described in described terminal judges mates with the application sequence number in the application sequence list preset, upgrade described application candidate list according to the application message in described second reply data, upgrade current record number, return step S6, otherwise renewal current record number, returns step S6;
Step S8: described terminal judges whether there is the application jointly supported with described smart card according to described application candidate list, be perform step S9, otherwise terminates;
Step S9: described terminal selects an application according to preset rules, the information obtaining described application in described application candidate list is applied in again according to what determine, according to the application sequence number in the information got, the 4th selection instruction is sent to described smart card, receive the 5th reply data that described smart card returns according to described 4th selection instruction, judge whether described 5th reply data meets the first preset requirement, it is then selective gist success, preserve the Treatment Options data object list in described 5th reply data, process ends, otherwise in application candidate list, delete the information of the described application got, return step S8.
28. methods according to claim 27, it is characterized in that, private file name in 3rd reply data described in described terminal judges whether with current application sequence numbers match, upgrade described application candidate list according to described 3rd reply data, perform step S3, otherwise perform step S3, comprising:
Step S2-1: the private file name in the 3rd reply data described in described terminal judges whether with current application sequence number complete match, be perform step S2-2, otherwise perform step S2-3;
Step S2-2: described terminal upgrades described application candidate list according to described 3rd reply data, performs step S3;
Step S2-3: described terminal is according to application choice indicator corresponding with current application sequence number in described application sequence list, judge whether to allow the private file name in described 3rd reply data to mate with current application sequence number portion, be perform step S2-4, otherwise perform step S3;
Step S2-4: the private file name in the 3rd reply data described in described terminal judges and current application sequence number whether semi-match, is perform step S2-5, otherwise performs step S3;
Step S2-5: described terminal upgrades described application candidate list according to described 3rd reply data, performs step S2-6;
Step S2-6: described terminal sends the 3rd selection instruction according to current application sequence number to described smart card, receives the 4th reply data that described smart card returns according to described 3rd selection instruction;
Step S2-7: described in described terminal judges, whether the 4th reply data meets the 4th preset requirement is then step S2-8, otherwise performs step S3;
Step S2-8: described terminal upgrades described application candidate list according to described 4th reply data, returns step S2-6.
29. methods according to claim 28, is characterized in that, comprise before described step S2-1: described in described terminal judges, whether the 3rd reply data meets the 5th preset requirement, is perform step S2-1, otherwise perform step S3.
30. methods according to claim 28, it is characterized in that, private file name in 3rd reply data described in described terminal judges whether with current application sequence number complete match, be specially: whether the private file name in the 3rd reply data described in described terminal judges is identical with current application sequence number, determine the private file name in described 3rd reply data and current application sequence number complete match, otherwise determine private file name in described 3rd reply data not with current application sequence number complete match.
31. methods according to claim 28, it is characterized in that, comprise before described step S2-2: according to described 3rd reply data, described terminal judges whether application corresponding with described private file name in described smart card is locked, and is perform step S3, otherwise perform step S2-2.
32. methods according to claim 28, it is characterized in that, private file name in 3rd reply data described in described terminal judges and current application sequence number whether semi-match, be specially: whether the predetermined fraction of the private file name in the 3rd reply data described in described terminal judges is identical with current application sequence number, be determine that described private file name is mated with current application sequence number portion, otherwise determine that described private file name is not mated with current application sequence number portion.
33. methods according to claim 28, it is characterized in that, comprise before described step S2-5: according to described 3rd reply data, described terminal judges whether application corresponding with described private file name in described smart card is locked, and is perform step S2-6, otherwise perform step S2-5.
34. methods according to claim 28, it is characterized in that, comprise before described step S2-8: according to described 4th reply data, described terminal judges whether application corresponding with described private file name in described smart card is locked, and is return step S2-6, otherwise perform step S2-8.
35. methods according to claim 28, it is characterized in that, described terminal upgrades described application candidate list according to described 3rd reply data, is specially: the application priority indicator in the described file control information in the private file name in described 3rd reply data and described 3rd reply data stores described in application candidate list by described terminal;
Described terminal upgrades described application candidate list according to described 4th reply data, is specially: the application priority indicator in the described file control information in the private file name in described 4th reply data and described 4th reply data is stored in described application candidate list by described terminal.
36. methods according to claim 27, is characterized in that, described terminal obtains the short file identification in described smart card, comprising:
Step S5-1: described terminal sends the first selection instruction according to the private file name preset to described smart card, receives the first reply data that described smart card returns according to described first selection instruction;
Step S5-2: described in described terminal judges, whether the first reply data meets the second preset requirement, is, performs step S5-3, otherwise terminate;
Step S5-3: whether there is correct short file identification in the first reply data described in described terminal judges, be, obtains described short file identification, otherwise terminates.
37. methods according to claim 36, it is characterized in that, comprise before described step S5-2: according to described first reply data, described terminal judges that whether described smart card is locked or do not support this instruction, be then selective gist failure, terminate, otherwise perform step S5-2.
38. methods according to claim 36, it is characterized in that, correct short file identification whether is there is in first reply data described in described terminal judges, be specially: in the first reply data described in described terminal judges, whether there is the first label value, as exist the first label value then obtain as described in the value of short file identification after the first label value, continue the value of short file identification that judges to get whether in the first scope, there is correct short file identification in described first reply data, otherwise there is not correct short file identification in described first reply data, if do not exist the first label value then determine as described in there is not correct short file identification in the first reply data.
39. methods according to claim 27, it is characterized in that, described terminal sends read record instruction according to described short file identification and current record number to described smart card, comprise: described terminal sends the first read record instruction according to described short file identification and current record number to smart card, described terminal receives the data that described smart card returns according to described first read record instruction, and therefrom obtaining record length, described terminal sends the second read record instruction according to described short file identification and described record length to described smart card.
40. methods according to claim 27, is characterized in that, comprise before described step S7: whether the second reply data described in described terminal judges meets the 3rd preset requirement, is perform step S7, otherwise terminate.
41. methods according to claim 29, is characterized in that, described step S7 is specially:
Step S7-1: whether there is entrance mark in the second reply data described in described terminal judges, is perform step S7-2, otherwise upgrades current record number, returns step S6;
Step S7-2: first entrance mark that described terminal obtains in described second reply data identifies as current entry;
Step S7-3: the application catalogue file after described terminal judges current entry mark and the application sequence in described default application sequence list number whether complete match, upgrade described application candidate list according to the application message after current entry mark, perform step S7-6, otherwise perform step S7-4;
Step S7-4: the application choice indicator that described terminal is corresponding according to the application catalogue file after identifying with current entry in described application sequence list, judge whether to allow the application catalogue file after current entry mark and the application sequence semi-match in described application sequence list, be perform step S7-5, otherwise perform step S7-6;
Step S7-5: the application catalogue file after described terminal judges current entry mark and the application sequence in described application sequence list number whether semi-match, upgrade described application candidate list according to the application message after current entry mark, perform step S7-6, otherwise directly perform step S7-6;
Step S7-6: whether also there is entrance mark after described terminal judges current entry mark, be, upgrade current entry mark, return step S7-3, otherwise upgrade current record number, return step S6.
42. methods according to claim 41, it is characterized in that, entrance mark whether is there is in second reply data described in described terminal judges, be specially: in the second reply data described in described terminal judges, whether there is the second label value, be determine in described second reply data, to there is entrance mark, otherwise determine in described second reply data, to there is not entrance mark.
43. methods according to claim 41, it is characterized in that, application catalogue file after described terminal judges current entry mark and the application sequence in described default application sequence list number whether complete match, be specially: the identical application sequence number of application catalogue file in after whether described terminal judges can find and to identify with current entry in described default application sequence list, be, the application catalogue file in after determining current entry mark and the application sequence complete match in application sequence list, otherwise determine current entry mark after in application catalogue file not with the application sequence complete match in application sequence list.
44. methods according to claim 41, it is characterized in that, application catalogue file after described terminal judges current entry mark and the application sequence in described application sequence list number whether semi-match, be specially: the application sequence number that the predetermined fraction of the application catalogue file after whether described terminal judges can find and to identify with current entry in described application sequence list is identical, determine the application catalogue file after current entry mark and the application sequence semi-match in application sequence list, otherwise determine current entry mark after application catalogue file not with the application sequence semi-match in application sequence list.
45. methods according to claim 41, it is characterized in that, described according to current entry mark after application message upgrade described application candidate list, be specially: described terminal by current entry identify after application message in application priority indicator and application catalogue file be stored in described application candidate list.
46. methods according to claim 27, is characterized in that, also comprise before described step S5: described terminal initialization application candidate list.
47. methods according to claim 27, it is characterized in that, when described terminal judges go out in described application candidate list only to have one with described smart card have jointly supports or mutual support application time, described terminal selects an application according to preset rules, be applied according to what determine the information obtaining described application in described application candidate list again, be specially:
Step S9-1: described terminal is according to the application priority indicator in described application candidate list, judge that the application in described application candidate list confirms the need of user, be perform step S9-2, otherwise select described application, obtain and apply corresponding information with described;
Step S9-2: whether described terminal judges supports that user confirms, is, performs step S9-3, otherwise terminate;
Step S9-3: apply described in described terminal demonstration, judges whether to receive triggering in Preset Time, is, select described application, obtains and applies corresponding information with described, otherwise terminates.
48. methods according to claim 47, it is characterized in that, described terminal is according to the application priority indicator in described application candidate list, judge that the application in described application candidate list confirms the need of user, be specially: apply priority indicator described in described terminal judges and whether meet the first preset format, be determine that described application needs user to confirm, otherwise determine that described application does not need user to confirm.
49. methods according to claim 27, it is characterized in that, when described terminal judges go out in described application candidate list to have at least two with described smart card have jointly supports or mutual support application time, described terminal selects an application according to preset rules, be applied according to what determine the information obtaining described application in described application candidate list again, be specially:
Step S9-4: apply candidate list described in described terminal demonstration;
Step S9-5: whether described terminal judges supports that user confirms, is, performs step S9-6, otherwise perform step S9-7;
Step S9-6: whether described terminal judges receives triggering in Preset Time, is then according to triggering the information obtaining corresponding application, otherwise terminates;
Step S9-7: described terminal, according to described application priority indicator, obtains the information of the highest application of application medium priority not needing user to carry out confirming.
50. methods according to claim 49, is characterized in that, described step S9-7 also comprises: apply described in described terminal deletion in candidate list and need user to carry out the application confirmed.
51. methods according to claim 27, it is characterized in that, described step S9 judges that described 5th reply data meets between the first preset requirement and selective gist success and also comprises: application sequence in the 4th selection instruction described in described terminal judges number whether with the private file name complete match in described 5th reply data, it is then selective gist success, preserve the Treatment Options data object list in described 5th reply data, process ends, otherwise in described application candidate list, delete the information of the described application got, return step S8.
52. methods according to claim 27, is characterized in that, described selective gist is successfully specially: described terminal and described smart card arrange identical application respectively as current application.
53. 1 kinds of terminals and smart card consult the device of selective gist, it is characterized in that, comprising: the first initial module, sending module, receiver module, the first judge module, the second judge module, the 3rd judge module, the first update module, the second initial module, the 4th judge module, the 5th judge module, the tenth judge module, the first acquisition module, the 6th judge module, memory module and removing module;
Described first initial module, for obtaining the short file identification in described smart card, initialization application candidate list and current record number;
Described sending module, sends read record instruction for the described short file identification that obtains according to described first initial module and current record number to described smart card; Also for sending the second selection instruction according to current application sequence number to described smart card; Also for according to the application sequence number got, send the 4th selection instruction to described smart card;
Described receiver module, for receiving the second reply data that described smart card returns according to the described read record instruction that described sending module sends; Also for receiving the 3rd reply data that described smart card returns according to described second selection instruction that described sending module sends; Also for receiving the 5th reply data that described smart card returns according to described 4th selection instruction that described sending module sends;
Described first judge module, judges whether to have read the record in described smart card for described second reply data received according to described receiver module;
Described second judge module, for when described first judge module is judged as YES, judges whether described application candidate list is empty;
Described 3rd judge module, for when described first judge module is judged as NO, judges whether the application catalogue file in described second reply data that described receiver module receives mates with the application sequence number in the application sequence list preset;
Described first update module, for when described 3rd judge module is judged as YES, upgrades described application candidate list according to the application message in described second reply data that described receiver module receives, and upgrades current record number; Also for when described 3rd judge module is judged as NO, upgrade current record number;
Described second initial module, for when described second judge module is judged as YES, obtains first application sequence in the application sequence list preset number as current application sequence number;
Described 4th judge module, for judge private file name in described 3rd reply data that described receiver module receives whether with current application sequence numbers match;
Described first update module, also for when described 4th judge module is judged as YES, upgrades described application candidate list according to described 3rd reply data that described receiver module receives;
Described 5th judge module, for being judged as NO at described 4th judge module, or after described first update module upgrades described application candidate list according to described 3rd reply data, whether there is application sequence number after judging the current application sequence number in described application sequence list, be, upgrade current application sequence number;
Described tenth judge module, has for judging whether according to described application candidate list the application jointly supported with described smart card;
Described first acquisition module, for when described tenth judge module is judged as YES, selects an application according to preset rules, then is applied according to what determine the information obtaining described application in described application candidate list;
Described 6th judge module, for judging whether described 5th reply data that described receiver module receives meets the first preset requirement;
Described memory module, for when described 6th judge module is judged as YES, preserves the Treatment Options data object list in described 5th reply data that described receiver module receives;
Described removing module, for when described 6th judge module is judged as NO, deletes the information of the described application got in described application candidate list.
54. devices according to claim 53, is characterized in that, described first initial module comprises the first judging unit and the second judging unit;
Described sending module, also for sending the first selection instruction according to the private file name preset to described smart card;
Described receiver module, also for receiving the first reply data that described smart card returns according to described first selection instruction that described sending module sends;
Described first judging unit, for judging whether described first reply data that described receiver module receives meets the second preset requirement;
Described second judging unit, for when described first judging unit is judged as YES, judges whether there is correct short file identification in described first reply data, is, obtain described short file identification.
55. devices according to claim 54, is characterized in that, described first initial module also comprises the 3rd judging unit, and described first reply data for receiving according to described receiver module judges that whether described smart card is locked or do not support this instruction.
56. devices according to claim 54, it is characterized in that, described second judging unit specifically for, when described first judging unit is judged as YES, judge whether there is the first label value in described first reply data, as exist the first label value then obtain as described in the value of short file identification after the first label value, continue to judge that the value of the short file identification got is whether in the first scope, as described in the value of short file identification then obtain in the first scope as described in short file identification.
57. devices according to claim 53, is characterized in that, described sending module is used for the described short file identification that obtains according to described first initial module and current record number sends read record instruction to described smart card, comprising:
Described sending module is used for sending the first read record instruction according to described short file identification and current record number to smart card;
Described receiver module is also for receiving the data that described smart card returns according to the described first read record instruction that described sending module sends;
Described sending module also in the data that return described in receiving from described receiver module, obtains record length, then sends the second read record instruction according to described short file identification and described record length to described smart card.
58. devices according to claim 53, is characterized in that, described device also comprises the 7th judge module, for judging whether described second reply data that described receiver module receives meets the 3rd preset requirement, otherwise apply candidate list described in initialization.
59. devices according to claim 53, is characterized in that, described 3rd judge module comprises: the 4th judging unit, the first acquiring unit, the 5th judging unit, the 6th judging unit, the 7th judging unit, the 8th judging unit;
Whether described 4th judging unit, exist entrance mark for judging in described second reply data that described receiver module receives;
Described first acquiring unit, for when described 4th judging unit is judged as YES, first the entrance mark obtained in described second reply data identifies as current entry;
Described 5th judging unit, for judging application catalogue file after current entry mark and the application sequence number in the application sequence list preset whether complete match;
Described 6th judging unit, for when described 5th judging unit is judged as NO, the application choice indicator corresponding according to the application catalogue file after identifying with current entry in described application sequence list, judges whether to allow the application catalogue file after current entry mark and the application sequence semi-match in application sequence list;
Described 7th judging unit, for when described 6th judging unit is judged as YES, judges application catalogue file after current entry mark and application sequence in described application sequence list number whether semi-match;
Whether described 8th judging unit, also exist entrance mark after judging current entry mark;
Described first update module, also for when described 4th judging unit is judged as NO, upgrades current record number; Also for when described 5th judging unit is judged as YES, upgrade described application candidate list according to the application message after current entry mark; Also for when described 7th judging unit is judged as YES, upgrade described application candidate list according to the application message after current entry mark; Also for when described 8th judging unit is judged as YES, upgrade current entry mark; When described 8th judging unit is judged as NO, upgrade current record number.
60. devices according to claim 59, it is characterized in that, described 4th judging unit specifically for, judge whether there is the second label value in described second reply data, be determine in described second reply data, to there is entrance mark, otherwise determine in described second reply data, to there is not entrance mark.
61. devices according to claim 59, it is characterized in that, described 5th judging unit specifically for, judge whether to find in described default application sequence list the identical application sequence number of application catalogue file in after identifying with current entry, be, the application catalogue file in after determining current entry mark and application sequence complete match in application sequence list, otherwise determine current entry identify after in application catalogue file not with the application sequence complete match in application sequence list.
62. devices according to claim 59, it is characterized in that, described 7th judging unit specifically for, judge whether to find in described application sequence list the application sequence number that the predetermined fraction of the application catalogue file after identifying with current entry is identical, determine the application catalogue file after current entry mark and application sequence semi-match in application sequence list, otherwise determine current entry identify after application catalogue file not with the application sequence semi-match in application sequence list.
63. devices according to claim 59, it is characterized in that, described first update module also for upgrading described application candidate list according to the application message after current entry mark, is specially: described first update module is also for being stored into the application priority indicator in the application message after current entry mark and application catalogue file in application candidate list.
64. devices according to claim 53, is characterized in that, described 4th judge module comprises: the 8th judging unit, the 9th judging unit, the tenth judging unit, the 11 judging unit;
Described 8th judging unit, for judge private file name in described 3rd reply data that described receiver module receives whether with current application sequence number complete match;
Described 9th judging unit, for when described 8th judging unit is judged as NO, according to application choice indicator corresponding with current application sequence number in described application sequence list, judge whether to allow the private file name in described 3rd reply data to mate with current application sequence number portion;
Described tenth judging unit, for when described 9th judging unit is judged as YES, judges private file name in described 3rd reply data and current application sequence number whether semi-match;
Described sending module, also for sending the 3rd selection instruction according to current application sequence number to described smart card;
Described receiver module, also for receiving the 4th reply data that described smart card returns according to described 3rd selection instruction that described sending module sends;
Described 11 judging unit, for judging whether described 4th reply data that described receiver module receives meets the 4th preset requirement;
Described first update module, also for when described 8th judging unit is judged as YES, upgrades described application candidate list according to described 3rd reply data that described receiver module receives; Also for when described tenth judging unit is judged as YES, upgrade described application candidate list according to described 3rd reply data that described receiver module receives; Also for when described 11 judging unit is judged as YES, upgrade described application candidate list according to described 4th reply data.
65. devices according to claim 64, is characterized in that, described 4th judge module also comprises the 12 judging unit, for judging whether described 3rd reply data that described receiver module receives meets the 5th preset requirement.
66. devices according to claim 64, it is characterized in that, described 8th judging unit specifically for, judge that whether the private file name in described 3rd reply data is identical with current application sequence number, determine the private file name in described 3rd reply data and current application sequence number complete match, otherwise determine private file name in described 3rd reply data not with current application sequence number complete match.
67. devices according to claim 64, it is characterized in that, described 4th judge module also comprises the 13 judging unit, judges whether application corresponding with described private file name in described smart card is locked for described 3rd reply data received according to described receiver module.
68. devices according to claim 64, it is characterized in that, described tenth judging unit specifically for, judge that whether the predetermined fraction of the private file name in described 3rd reply data is identical with current application sequence number, be determine that described private file name is mated with current application sequence number portion, otherwise determine that described private file name is not mated with current application sequence number portion.
69. devices according to claim 64, it is characterized in that, described 4th judge module also comprises the 14 judging unit, judges whether application corresponding with described private file name in described smart card is locked for described 4th reply data received according to described receiver module.
70. devices according to claim 64, it is characterized in that, described first update module is used for upgrading described application candidate list according to described 3rd reply data, is specially: described first update module is used for the application priority indicator in the described file control information in the private file name in described 3rd reply data and described 3rd reply data to be stored in described application candidate list;
Described first update module is used for upgrading described application candidate list according to described 4th reply data, is specially: described first update module is used for the application priority indicator in the described file control information in the private file name in described 4th reply data and described 4th reply data to be stored in described application candidate list.
71. devices according to claim 64, is characterized in that, described device also comprises the 8th judge module, only have one to have with described smart card the application jointly supported or mutually support for judging in described application candidate list.
72. devices according to claim 53, it is characterized in that, when described 8th judge module judge only to have in described application candidate list one with described smart card have jointly supports or mutual support application time, described first acquisition module comprises: the 15 judging unit, the 16 judging unit and the 17 judging unit;
Described 15 judging unit, for according to the application priority indicator in described application candidate list, judges that the application in described application candidate list confirms the need of user, otherwise selects described application, obtains and applies corresponding information with described;
Described 16 judging unit, for when described 15 judging unit is judged as YES, judges whether to support that user confirms;
Described 17 judging unit, for when described 16 judging unit is judged as YES, shows described application, judges whether to receive triggering in Preset Time, be, select described application, obtains and applies corresponding information with described.
73. according to the device described in claim 72, it is characterized in that, described 15 judging unit is specifically for judging whether described application priority indicator meets the first preset format, determine that described application needs user to confirm, otherwise determine that described application does not need user to confirm, select described application, obtain the information of described application.
74. according to the device described in claim 71, it is characterized in that, when described 8th judge module judge to have in described application candidate list at least two with described smart card have jointly supports or mutual support application time, described first acquisition module comprises: display unit, the 18 judging unit, the 19 judging unit and second acquisition unit;
Described display unit, for showing described application candidate list;
For judging whether, described 18 judging unit, supports that user confirms;
Described 19 judging unit, for when described 18 judging unit is judged as YES, judges whether to receive triggering in Preset Time, otherwise terminates;
Described second acquisition unit, for when described 18 judging unit is judged as NO, according to described application priority indicator, the information of the application that the application medium priority that acquisition does not need user to carry out confirming is the highest; When described 19 judging unit is judged as YES, according to triggering the information obtaining corresponding application.
75., according to the device described in claim 74, is characterized in that, described first removing module also needs user to carry out the application confirmed for deleting in described application candidate list.
76. devices according to claim 53, it is characterized in that, described device also comprises the 9th judge module, for judging the private file name complete match in described 5th reply data whether application sequence in described 4th selection instruction number receives with described receiver module.
CN201410591616.0A 2014-10-29 2014-10-29 The method and apparatus that a kind of terminal and smart card consult selection application Active CN104407845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410591616.0A CN104407845B (en) 2014-10-29 2014-10-29 The method and apparatus that a kind of terminal and smart card consult selection application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410591616.0A CN104407845B (en) 2014-10-29 2014-10-29 The method and apparatus that a kind of terminal and smart card consult selection application

Publications (2)

Publication Number Publication Date
CN104407845A true CN104407845A (en) 2015-03-11
CN104407845B CN104407845B (en) 2017-12-19

Family

ID=52645478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410591616.0A Active CN104407845B (en) 2014-10-29 2014-10-29 The method and apparatus that a kind of terminal and smart card consult selection application

Country Status (1)

Country Link
CN (1) CN104407845B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657447A (en) * 2017-09-11 2018-02-02 飞天诚信科技股份有限公司 A kind of transaction terminal and its method of work for supporting a variety of cards
CN109840148A (en) * 2019-01-22 2019-06-04 飞天诚信科技股份有限公司 A kind of multi-application smart card operating system and its update the method for applying priority

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126398A1 (en) * 2006-06-29 2008-05-29 Incard S.A. Method for Configuring an IC Card in Order to Receive Personalization Commands
CN102377570A (en) * 2011-11-07 2012-03-14 飞天诚信科技股份有限公司 Method and device for generating dynamic passwords
CN102567771A (en) * 2011-12-07 2012-07-11 北京握奇数据系统有限公司 Method and system for operating smart card, smart card and terminal
CN103763103A (en) * 2013-12-31 2014-04-30 飞天诚信科技股份有限公司 Method for generating off-line authentication certifications through intelligent card

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126398A1 (en) * 2006-06-29 2008-05-29 Incard S.A. Method for Configuring an IC Card in Order to Receive Personalization Commands
CN102377570A (en) * 2011-11-07 2012-03-14 飞天诚信科技股份有限公司 Method and device for generating dynamic passwords
CN102567771A (en) * 2011-12-07 2012-07-11 北京握奇数据系统有限公司 Method and system for operating smart card, smart card and terminal
CN103763103A (en) * 2013-12-31 2014-04-30 飞天诚信科技股份有限公司 Method for generating off-line authentication certifications through intelligent card

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657447A (en) * 2017-09-11 2018-02-02 飞天诚信科技股份有限公司 A kind of transaction terminal and its method of work for supporting a variety of cards
CN109840148A (en) * 2019-01-22 2019-06-04 飞天诚信科技股份有限公司 A kind of multi-application smart card operating system and its update the method for applying priority
CN109840148B (en) * 2019-01-22 2020-10-13 飞天诚信科技股份有限公司 Multi-application smart card operating system and method for updating application priority thereof

Also Published As

Publication number Publication date
CN104407845B (en) 2017-12-19

Similar Documents

Publication Publication Date Title
US11617073B2 (en) Method enabling migration of a subscription
CN102783121B (en) Communications device
CN108876689B (en) Order processing method, device, equipment and computer readable storage medium
JP5668051B2 (en) Method for pre-selecting at least one application in a mobile communication device including an NFC system
CN106664112B (en) Data-updating method, device and universal embedded integrated circuit card
EP3337219B1 (en) Carrier configuration processing method, device and system, and computer storage medium
CN103249033B (en) The self-service number of the changing implementation method of SIM card and terminal
CN103853590A (en) Method and deice for storing and deleting virtual SIM card data
CN105378748B (en) For transmitting the method for user data between two examples of application
CN103442012B (en) Method and device that CAMEL-Subscription-Information migrates is realized between internet of things equipment
US20130152069A1 (en) Method, apparatus and system for initiating terminal operation
CN103702319A (en) SIM (subscriber identity module) card, individualized card writing system and method as well as SIM card obtained according to method
CN101330301A (en) System and method for writing smart card base on wireless communication
CN104468116A (en) Method for achieving multi-application of intelligent secret key equipment
CN105049631B (en) Enter the method and mobile terminal of row information transmission in address list program
CN104407845A (en) Method and device for negotiating and selecting application of terminal and intelligent card
CN103546551B (en) Application software smart download methods, devices and systems
CN104639669A (en) Method and device for configuring electronic mail box
CN105357771B (en) Connect method for building up and user terminal
CN104363325A (en) Terminal calling method and system
CN114386934A (en) Method and device for generating business process, server and storage medium
CN103929469A (en) Internet of Things management platform of eUICC and mobile number remote management method
CN110221855B (en) Method for app and server collaborative updating and offline running
CN105025147A (en) Method and device for displaying contacts of cell phones of multiple users
CN104125593A (en) Information processing method and electronic equipment

Legal Events

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