WO2012000438A1 - 一种对电子钱包进行操作的方法 - Google Patents

一种对电子钱包进行操作的方法 Download PDF

Info

Publication number
WO2012000438A1
WO2012000438A1 PCT/CN2011/076590 CN2011076590W WO2012000438A1 WO 2012000438 A1 WO2012000438 A1 WO 2012000438A1 CN 2011076590 W CN2011076590 W CN 2011076590W WO 2012000438 A1 WO2012000438 A1 WO 2012000438A1
Authority
WO
WIPO (PCT)
Prior art keywords
command
data
file
composite
initialization command
Prior art date
Application number
PCT/CN2011/076590
Other languages
English (en)
French (fr)
Inventor
陆舟
于华章
Original Assignee
飞天诚信科技股份有限公司
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
Priority claimed from CN 201010213920 external-priority patent/CN102044114B/zh
Priority claimed from CN2010102141326A external-priority patent/CN102013132B/zh
Application filed by 飞天诚信科技股份有限公司 filed Critical 飞天诚信科技股份有限公司
Priority to US13/519,187 priority Critical patent/US10878404B2/en
Publication of WO2012000438A1 publication Critical patent/WO2012000438A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/34Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
    • G06Q20/352Contactless payments by cards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/34Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3672Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes initialising or reloading thereof
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07FCOIN-FREED OR LIKE APPARATUS
    • G07F7/00Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus
    • G07F7/08Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus by coded identity card or credit card or other personal identification means
    • G07F7/0866Mechanisms actuated by objects other than coins to free or to actuate vending, hiring, coin or paper currency dispensing or refunding apparatus by coded identity card or credit card or other personal identification means by active credit-cards adapted therefor

Definitions

  • the present invention relates to the field of information security, and in particular, to a method for operating an electronic wallet in a CPU card.
  • the chip of the CPU card contains a microprocessor, which functions as a microcomputer, and the CPU card includes a central processing unit (CPU), a read only memory (ROM), a random access memory (RAM), and an electric battery.
  • Erasing programmable read-only memory (EEPROM), etc. has the advantages of large amount of information, high security of anti-counterfeiting, offline operation, and multi-functional development.
  • the CPU card uses a powerful and stable security controller to enhance the security of the card, and the internal and external authentication mechanism unique to the CPU card and the dedicated authentication mechanism represented by the financial IC card specification can fully guarantee the legality of the transaction. Security, and then the application firewall function of the CPU card can ensure the security independence of different applications in the same card.
  • the large-capacity storage space of the CPU card can meet the storage of more customer information required by the expected large amount of consumption applications.
  • the electronic wallet in the CPU card can implement basic transaction functions such as general storage, consumption/cash-out, promotion, and overdraft limit, but when a special application is encountered, such as when different recharges are required
  • a promotional application in which the amount is discounted, such as a membership card of an institution such as a shopping mall, a supermarket, a restaurant, a fitness club, etc.
  • the ordinary storage operation and consumption operation of the existing electronic wallet cannot satisfy the application.
  • the CPU card enters the non-contact sensing area of the terminal, and the CPU card is powered on and initialized; receiving an operation initialization command sent by the terminal, reading data in the operation initialization command, and saving, the data includes a transaction amount
  • the operation initialization command is a composite cache initialization command or a consumption initialization command; If the operation initialization command is a composite cache initialization command, performing a composite cache initialization operation; receiving an updated composite application special file command sent by the terminal, searching for a composite application special file; and writing the pre-agreed data to the composite Replacing the original content in the storage space of the application special file; receiving the composite cache command sent by the terminal, reading the data in the composite cache command and saving; and calculating the transaction amount according to a pre-agreed algorithm Calculating the data in the composite application special file to obtain a new amount, adding the obtained new amount to the balance of the electronic wallet to obtain a new balance; if the operation initialization command is a consumption initialization command, according to a pre-agreed
  • the invention has the following advantages:
  • the present invention provides a method for operating an electronic wallet, and the method provided by the invention makes the whole transaction process more secure, and prevents illegal means to modify the composite application in the CPU card.
  • the special file further simplifies the implementation of the hierarchical discount offer operation, and only needs to set the composite application special file in the cache, and is convenient to manage, thereby saving the management cost.
  • FIG. 1 is a flowchart of a method for performing composite cache of an electronic wallet according to Embodiment 1;
  • FIG. 2 is a detailed flowchart of a method for performing composite cache of an electronic wallet according to Embodiment 1 FIG.
  • Embodiment 1 is a detailed flowchart of a method for consuming an electronic wallet according to Embodiment 1;
  • FIG. 4 is a flowchart of a method for consuming an electronic wallet according to Embodiment 2;
  • Embodiment 1 In order to simplify the hierarchical discounting operation, the composite application special file is set in the composite buffer.
  • the embodiment of the present invention provides a method for composite storage of the electronic wallet. Referring to FIG. 1, the method includes :
  • Embodiments of the present invention provide a method for performing composite cache on an electronic wallet.
  • an electronic The wallet is taken as an example.
  • the electronic wallet in the CPU card has all the transaction functions of the wallet supporting the composite application, and correspondingly supports the function of the composite cache, and is also in the CPU card.
  • the composite cache operation of the electronic wallet is performed at the CPU terminal.
  • the transaction amount and the value specified in the composite special file are calculated according to a pre-agreed rule to obtain a new amount, and the new amount will be obtained.
  • Amount plus On the balance of the electronic wallet, the composite cache operation is completed, and accordingly, at the time of consumption, the balance is consumed. Referring to FIG.
  • Step 4 101: The CPU card enters the non-contact sensing area of the terminal, and the CPU card is powered on and initialized; 102: The composite buffer initialization command INITIALIZE FOR CAPP LOAD sent by the receiving terminal reads the data contained in the command and saves it; in this embodiment, the composite cache initialization command INITIALIZE FOR CAPP LOAD is used to initialize the composite inventory transaction, where The INITIALIZE FOR CAPP LOAD command is divided into: Command Head + Command Body, which is: (CLA + INS + P1 + P2) + (Lc + Data + Le); where CLA + INS + PI + P2 is the command header.
  • Lc + Data + Le is the command body, the command header is the command code, CLA in the command header is the instruction category, INS is the instruction code, P1 and P2 are the instruction parameters; Lc in the command body is the length of the data in the command body Data.
  • Data is the data in the INITIALIZE FOR CAPP LOAD command, and Le is the maximum number of bytes of the expected response APDU data field.
  • the data contained in the INITIALIZE FOR CAPP LOAD command Data is specifically The key index number, the transaction amount, and the terminal number; specifically, in this embodiment, the received INITIALIZE FOR CAPP LOAD command is specifically: 80 50 06 02 0B 02 00 00 03 E8 00 00 00 00 00 01 10, 80 is CLA, 50 is INS, 06 is PI, defined as the identifier of the composite cache initialization, 02 is P2, defined as the identifier of the electronic 4 packet, 0B is Lc, 02 is the key index number in Data, 00 00 03 E8 is the transaction amount in Data, 00 00 00 00 00 00 01 is the terminal number in Data, and 10 is Le.
  • Step 103 Check whether the key index number included in the INITIALIZE FOR CAPP LOAD command is supported. If not, execute step 104. If yes, go to step 105.
  • Step 104 Return the status code 0x9403 to the terminal and terminate the execution.
  • the composite cache initialization operation is performed.
  • the method for generating the process key is specifically: The pseudo random number, the electronic wallet online transaction serial number and the '8000' sequence are sequentially linked, and the data obtained by the link is encrypted by using the cache subkey DLK, and the obtained encrypted data is the process key.
  • Step 106 Calculate the first message authentication code MAC1 by using the above process key.
  • the method for calculating the first 4D authentication code MAC 1 by using the process key is specifically as follows: The balance of the package, the transaction amount, the transaction type identifier and the terminal number are sequentially linked, and the linked data is encrypted by using the process key, and the first four bytes of the encrypted data obtained are the first four texts. Code MAC 1.
  • Step 108 Receive a command UPDATE CAPP for updating the composite application special file sent by the terminal.
  • the command UPDATE CAPP DATA CACHE for updating the composite application special file is used to update the data in the composite application patent file;
  • the composite application special file is composed of a file header and a file body, and the file header specifically includes: FILE ID of the byte, FILE TYPE of 1 byte, FILE SIZE of 2 bytes, AC1 of 1 byte, AC2 of 1 byte and RFU of 2 bytes, where FILE TYPE is 00 , indicates that the file is a binary file. When FILE TYPE is 01, it indicates that the file is a fixed-length record file. When FILE TYPE is 02, it indicates that the file is a variable-length record file.
  • FILE TYPE When FILE TYPE is 03, it indicates the file. For a loop file, when FILE TYPE is 05, it means that the file is a key file.
  • the FILE SIZE corresponding to the binary file is the file size
  • the FILE SIZE corresponding to the fixed length record file is the number of records and the record length
  • the FILE SIZE corresponding to the variable length record file is the number of records and the maximum length of the record
  • the corresponding file of the loop file FILE SIZE is the number of records and the length of the record.
  • the FILE SIZE corresponding to the key file is the number of records and the length of the record, and AC 1 is the read file right, AC2 is the write file right; the file body is the data of the composite application special file; Specifically, in this embodiment, the composite application special file is specifically a binary file, and FILE TYPE is 00, and FILE SIZE is a file size, specifically 00 0B, and the content in the file body is empty; further, UPDATE CAPP DATA
  • the CACHE command message is composed of CLA + INS + P 1 + P2 + Lc + Data.
  • the UPDATE CAPP DATA CACHE command is specifically: 80 D6 92 B l 04 00 01 20 00 , where 80 is CLA, D6 For INS, 92 is PI, B 1 is P2, 04 is Lc, 00 01 20 00 is Data; and the data in the data field Data of the UPDATE CAPP DATA CACHE command is new to be written to the composite application special file.
  • the composite application special file can be customized as a rate file.
  • the data in the data domain is specifically a rate value, and in this embodiment, the specific rate value is 120%; correspondingly, when the defined rate value is 120%, the data in the UPDATE CAPP DATA CACHE command It may not be 120%, it may be 83.3%, or it may be 20%. Or, the data of the UPDATE CAPP DATA CACHE command may not include the rate value, and the CPU card judges the transaction amount included in the composite cache initialization command.
  • the transaction amount in the composite cache initialization command is 800 yuan, that is, less than the pre-agreed lower limit, If it is 2000, it will generate a rate value of 90%, or 111.1%, or 11.1%, or 100 yuan, when the transaction in the composite cache initialization command When it is 5000 yuan, that is, between the pre-agreed lower limit and the upper limit, specifically, if it is 2000 to 6000, a data of 80%, or 125%, or 25%, or 600 yuan is generated, when the composite cache initialization command When the transaction amount is 8000 yuan, that is, when it is greater than the pre-agreed lower limit, specifically, if it is 6000, a data of 75%, or 133%, or 33%, or 2000 yuan, etc.
  • Step 109 Determine whether there is an SFI field in the received UPDATE CAPP DATA CACHE command, if yes, go to step 110, if not, go to step 111; In this embodiment, it is determined whether the SFI i exists in the UPDATE CAPP DATA CACHE command or specifically: determining whether the upper three digits of the PI in the UPDATE CAPP DATA CACHE command are 100, and if so, indicating that the SFI field exists in the command, and the PI is low. The value of the SFI field is 5 bits. Otherwise, the SFI field is not present in the command.
  • Step 110 Find whether the SFI value of a file exists in the current application of the CPU card is the same as the SFI value in the UPDATE CAPP DATA CACHE command. If not, execute step 111. If yes, execute step 4 to gather 112; Step 4 111: Returning the ⁇ I state code 0x6A82 to the terminal, and terminating the operation; Step 112: Using the file found in step 110 as a composite application special file, and checking whether the length of the data field in the UPDATE CAPP DATA CACHE command is greater than that of the composite application.
  • the process proceeds to step 113. If not, the process proceeds to step 114.
  • the length of the composite application special file is specifically a value of FILE SIZE. Specifically, it is determined whether the value of Lc in the UPDATE CAPP DATA CACHE command is greater than the value of the composite application dedicated file FILE SIZE. Since the value of Lc in the UPDATE CAPP DATA CACHE command in this embodiment is 04, the value of FILE SIZE is 00 OB, so The length of the data field in the command is no longer than the length of the composite application special file.
  • Step 113 Return the status code 0x6A84 to the terminal, and terminate the operation;
  • the data i or the 00 01 20 00 in the CACHE command can be written into the composite application special file; accordingly, when the rate value in the UPDATE CAPP DATA CACHE command is 83.3 %, it is written in the composite application special file.
  • the data is specifically 83.3 % when UPDATE CAPP DATA
  • the rate value in the CACHE command is 20%
  • the data written in the composite application special file is specifically 20%; or, when the data of the UPDATE CAPP DATA CACHE command may not include the rate value, the CPU card pair
  • the transaction amount included in the composite cache initialization command is judged, a rate value is generated according to the transaction amount according to a pre-agreed rule, and the generated rate value is written into the composite application special file, and is written in the composite application dedicated file. Before the file, it is determined whether the length of the generated rate value is greater than the length of the composite application special file.
  • the specificity is 2000.
  • the generated 90%, or 111.1%, or 11.1%, or 100 yuan is written into the composite application special file
  • the transaction amount in the composite cache initialization command is 5000 yuan, that is, the pre-agreed lower limit
  • the specific ⁇ mouth is 2000 JiJ 6000 yen
  • the shell is 80%, or 125%, or 25%, or 600 yuan.
  • Step 115 Return the response of the UPDATE CAPP DATA CACHE command to the terminal; wherein, the response of the UPDATE CAPP DATA CACHE command is composed of swl + sw2, and there is no data domain data, when the UPDATE CAPP DATA CACHE command is successfully executed.
  • Step 116 The composite cache command CREDIT FOR CAPP LOAD is sent by the receiving terminal, and the data in the command data field is read and saved.
  • the composite cache command CREDIT FOR CAPP LOAD is used for the composite cache transaction;
  • the CREDIT FOR CAPP LOAD command is composed of CLA + INS + P1 + P2 + Lc + Data + Le, wherein the data in the data field Data specifically includes: a transaction date, a transaction time, and a second message authentication code MAC2;
  • the CREDIT FOR CAPP LOAD command received in this embodiment is specifically: 80 52 00 00 0B 07 DA 06 08 OA 14 2D 00 01 Al 0B 08, where 80 is CLA, 52 is INS, 00 is PI, 00 is P2, 0B is Lc, 07 DA 06 08 is the transaction date in Data, OA 14 2D is the transaction time in Data, 00 01 Al 0B is MAC2 in Data, and 08 is Le.
  • Step 117 Verify whether the second message authentication code MAC2 in the data is valid. If it is invalid, perform step 4 to gather 118. If it is valid, perform step 4 to gather 119.
  • - is the risk certificate MAC2 valid?
  • the method is specifically: linking the transaction amount, the transaction type identifier, the terminal number, the transaction date, and the transaction time, and then encrypting the data obtained by using the process key generated in step 105, and comparing the data obtained by the encryption.
  • the first four bytes are the same as the MAC2 in the data field of the CREDIT FOR CAPP LOAD command. If they are not the same, MAC2 is invalid. If they are the same, MAC2 is valid.
  • Step 118 Return status code 0x9302 to the terminal, prompting MAC2 to be invalid;
  • the value in the file is the rate value, which is 120%. Therefore, if the transaction amount is 1000 yuan and the balance in the electronic 4 package is 0 yuan, the transaction amount of 1000 yuan is multiplied by the rate value in the composite special file.
  • the new amount is 1200 yuan, so the 1200 yuan is added to the balance of 0 yuan of the electronic 4 package, and the new balance is 1200 yuan, so that the new balance of 1200 yuan in the electronic 4 package is better than the transaction.
  • the amount of 1000 yuan directly added to the balance of the electronic wallet is more than 1,000 yuan; when the rate value written in the composite application special file is specifically 83.3%, if the transaction amount is 100 0 yuan, the balance in the e-wallet is 0 yuan, then the transaction amount of 1000 yuan divided by the rate value of 83.3%, the new amount is 1200 yuan, so the balance of 1200 yuan to the electronic 4 package 0 yuan On, the new balance is 1200 yuan, so the new balance of 1200 yuan in the electronic 4 package is more than the balance of 1000 yuan directly added to the balance of the electronic wallet; when writing the composite application special file
  • the rate value is specifically 20%, if the transaction amount is 1000 yuan and the balance in the e-wallet is 0 yuan, then the transaction amount of 1000 yuan is multiplied by the rate value of 20%, and then the transaction amount is 1000 yu
  • the new amount is 1200 yuan, @ jtb i 1200 yuan ⁇ il wallet balance 0 yuan, get a new balance of 1200 yuan, so the new balance in the e-wallet 1200 yuan is more than the balance of 1000 yuan directly added to the balance of the electronic 4 package; or when the transaction amount in the composite cache initialization command is 8000 yuan, the generated rate value of 75 %, or 133%, or 33%, or 2000 yuan is written to the composite application special file. At this time, when the rate value written in the composite application special file is 75%, the transaction amount is 8000 yuan divided by 75%.
  • the new amount is 10060 yuan, so this will be 10060 yuan.
  • the new balance is 10060 yuan, so that the new balance of 10060 yuan in the electronic 4 package is more than the balance of 8,000 yuan obtained by directly adding the transaction amount of 8,000 yuan to the balance of the electronic wallet.
  • the new amount obtained after multiplying the transaction amount by 8,000 yuan by 133% is 10060 yuan, because the jt ⁇ 4 wins the 10060 yuan force il electronic 4 packs
  • the balance of il Xinyi is 10060 yuan, so the new balance of 10060 yuan in the electronic 4 package is more than the balance of 8,000 yuan obtained by directly adding the transaction amount of 8,000 yuan to the balance of the electronic wallet;
  • the rate value in the composite application special file is 33%
  • the transaction amount is 8000 yuan multiplied by 33%, plus the transaction amount is 8000 yuan, and the new amount is 10060 yuan, @jtb i 10060 yuan 4
  • the balance of the package is 0 yuan, and the new balance is 10060 yuan, so the new balance of 10060 yuan in the electronic 4 package is more than
  • Step 122 Return the response of the CREDIT FOR CAPP LOAD command to the terminal, and the composite buffer operation ends.
  • the response of the CREDIT FOR CAPP LOAD command consists of data + swl + sw2.
  • the status codes swl and sw2 in response to the message are '9000, correspondingly, the data If the CREDIT FOR CAPP LOAD command is unsuccessful, the status codes swl and sw2 in the response message are not '9000', and the data field is not included; specifically, in this embodiment, The response of the returned CREDIT FOR CAPP LOAD command is 00 05 D2 BC 90 00.
  • each record in the composite application special file corresponds to one application, specifically, the FILE TYPE in the composite application special file in this embodiment 01 indicates that the composite application special file is a fixed length record file, and correspondingly, the FILE SIZE corresponding to the fixed length record file is the number of records and the record length; accordingly, steps 108 to 116 of updating the composite application dedicated file are performed accordingly.
  • the method may further be replaced by: Step 108,: receiving an update record command UPDATE RECORD sent by the terminal; wherein, the update record command UPDATE RECORD is used to update the record specified in the command, and the UPDATE RECORD command is applicable to the fixed length record file and the variable length record Specifically, the UPDATE RECORD command consists of CLA + INS + PI + P2 + Lc + Data, where PI and P2 are used to specify which file's first record is a composite application-specific file record, Lc is The length of the data in Data plus 4 bytes.
  • the UPDATE RECORD command is specifically: 00 D C 03 04 08 00 01 20 00 , where 00 is CLA, DC is INS, 03 is PI, 04 is P2, 08 is Lc, 00 01 20 00 is Data; and the data field of the UPDATE RECORD command is to be written
  • the new data of the composite application special file wherein the specific application of the composite application special file can be customized by the card issuer, so the data in the data domain can also be customized, as in the embodiment, the composite application special file can be
  • the data is defined as a rate file, and the data in the data field is specifically a rate value. In this embodiment, the rate value is specifically defined as 120%.
  • Step 109 Determine whether there is an SFI field in the received update record command UPDATE RECORD, if yes, execute step 110', if not, execute step 111'; wherein, determine whether there is an SFI in the update record command UPDATE RECORD
  • the method of the domain is specifically: determining whether the upper 5 bits of the P2 in the UPDATE RECORD command are all 0. If yes, the SFI field exists in the command, that is, the upper 5 bits of the P2 is the value of the SFI field, otherwise, the command is in the command. There is no SFI domain.
  • Step 110 Finding whether the SFI value of a file exists in the current application of the CPU card is the same as the SFI value in the UPDATE RECORD command.
  • Step 111 Returning the status code 0x6A82 to the terminal, and terminating the execution of the composite cache transaction;
  • Step 112' using the file found in step 110' as a composite application special file, and according to the record number specified in the UPDATE RECORD command in the composite application
  • the corresponding file is searched for the corresponding record. If the corresponding record is not found, step 113 is performed. If the corresponding record is found, step 114 is performed.
  • Step 113 Return the status code 0x6A83 to the terminal, and terminate the execution of the composite.
  • the buffer transaction is performed.
  • Step 114' Check whether the length of the data field in the UPDATE RECORD command is greater than the specified length of the record obtained in step 112. If yes, execute step 115. If not, perform step 116.
  • Step 115 Return status code 0x6A84 to the terminal, and terminate execution of the composite cache transaction;
  • Step 116 ' Write the data in the data field in the UPDATE RECORD command to the searched record, and replace the original content in the record; in this embodiment, specifically write the rate value 120% into the record, and replace The original content in the record.
  • Step 117 Return the response of the UPDATE RECORD command to the terminal; wherein, the response of the UPDATE RECORD command is composed of swl + sw2, and there is no data field data.
  • Step 201 The receiving terminal sends the The consumption initialization command INITIALIZE FOR PURCHASE reads the data in the command and saves it; in this embodiment, the consumption initialization command INITIALIZE FOR PURCHASE is used to initialize the consumer transaction;
  • the INITIALIZE FOR PURCHASE command 4 is divided into: Command Head + Command Body: (CLA + INS + P 1 + P2) + (Lc + Data + Le); where CLA + INS + P1 + P2 is the command header, Lc + Data + Le is the command body, the command header is the code of the command, CLA in the command header is the instruction type, INS is the instruction code, P1 and P2 are the instruction parameters; Lc in the command body is the length of the data in the command body data, Data is the data in the INITIALIZE FOR PURCHASE command, Le is the maximum number of bytes of the expected response APDU data field; and the data in the INITIALIZE FOR PURCHASE command is specifically the key index number, the transaction amount, and the terminal number; specifically, In this embodiment, the received INITIALIZE FOR PURCHASE command is specifically: 80 50 01 02 0B 02 00 00 00 C8 00 00 00 00 01 0F, where 80 is CLA,
  • Step 202 Check whether the key index number included in the above INITIALIZE FOR PURCHASE command is supported. If not, execute step 203. If yes, go to step 204. Step 203: Return the status code 0x9403 to the terminal, and terminate the execution. Consumption initialization operation; Step 204: Read the balance of the electronic 4 package, determine whether the transaction amount included in the INITIALIZE FOR PURCHASE command exceeds the sum of the balance of the electronic wallet and the overdraft limit, and if yes, execute step 205, if not, execute the step Step Step 206: Return the status code 0x9401 to the terminal, and terminate the execution of the consumption initialization operation; Step 206: Generate a pseudo random number and a process key.
  • the process key is used for the consumer transaction of the CPU electronic wallet or the M1 electronic wallet, and the process key is obtained by using the key DPK.
  • Step 207 Send a response of the INITIALIZE FOR PURCHASE command to the terminal; wherein, the INITIALIZE FOR PURCHASE response is composed of Data + swl + sw2, and when the INITIALIZE FOR PURCHASE command is successfully executed, the response is returned in the message
  • the status codes swl and sw2 are '9000', and the data contained in the response data field Data is specifically the balance of the electronic wallet, the offline transaction serial number of the CPU e-wallet, the overdraft limit, the key version number, the algorithm identification, and the pseudo.
  • the response message returned only contains the status codes swl and sw2, and the status codes swl and sw2 are not '9000,; specifically, the INITIALIZE FOR PURCHASE returned to the terminal in this embodiment
  • the response is as follows: 00 00 4B 00 00 01 00 00 64 02 03 01 02 03 04 90 00 .
  • Step 208 Receive the consumption command DEBIT FOR PURCHASE sent by the terminal, read the data in the command and save it; in this embodiment, the DEBIT FOR PURCHASE command is used for the consumption operation; wherein, the DEBIT FOR PURCHASE command is also used by the CLA + INS + P1 + P2 + Lc + Data + Le composition, the data in the DEBIT FOR PURCHASE command is specifically: terminal transaction serial number, transaction date, transaction time and third authentication code MAC3; specifically, in this embodiment, receiving The DEBIT FOR PURCHASE command to the specifics is: 80 54 01 00 0F 00 00 00 01 7D AO 06 09 OF 27 13 01 OA Dl 0C 08, where 80 is CLA, 54 is INS, 01 is PI, 00 is P2, OF is Lc, 00 00 00 01 is the terminal transaction serial number in Data, 7D AO 06 09 is the transaction date in Data, OF 27 13 is the transaction time in Data, 01 OA Dl 0C is MAC3 in Data
  • Step 209 If the process key generated in step 205 is used, the MAC3 included in the DEBIT FOR PURCHASE command is valid. If it is invalid, step 210 is performed. If it is valid, step 211 is performed.
  • the method of whether the MAC3 included in the DEBIT FOR PURCHASE command is valid is specifically: The transaction amount, the transaction type identifier, the terminal number, the transaction date of the terminal, and the transaction time of the terminal are sequentially linked, and the data obtained by the link is encrypted by the process key generated in step 206, and the obtained force is compared. Whether the first four bytes of the encrypted data are the same as the MAC3 included in the DEBIT FOR PURCHASE command, if not the same, MAC3 is invalid.
  • Step 210 Return the status code 0x9302 to the terminal, and terminate the operation;
  • the related transaction details of the electronic wallet that need to be updated are specifically: transaction amount, transaction type identifier, terminal number, transaction date, and transaction time, specifically, The CPU card links the transaction amount, transaction type identifier, terminal number, transaction date, and transaction time sequence into a record for updating.
  • the method for generating the fourth message authentication code MAC4 is specifically: using the process key pair transaction generated in step 206 The amount is encrypted, and the first four bytes of the obtained encrypted data are the fourth text authentication code MAC4.
  • the method for calculating the TAC code by using the result of the exclusive OR operation is specifically: performing an exclusive OR operation with 8 bytes of DTK, and the transaction amount, the transaction type identifier, the terminal number, the terminal transaction serial number, and the terminal transaction.
  • the date and the transaction time of the terminal are sequentially linked, and the result obtained by the exclusive OR operation is used to encrypt the data obtained by the link, and the first four bytes of the obtained encrypted data are the TAC code.
  • Step 214 Return the response of the DEBIT FOR PURCHASE command to the terminal, and the transaction ends.
  • the response of the DEBIT FOR PURCHASE command consists of data + swl + sw2.
  • the response status code swl and Sw2 is '9000, correspondingly, the data i or data is specifically TAC code and MAC4.
  • the status codes swl and sw2 in response to the message are not '9000' and do not contain The data field; specifically, the response of the DEBIT FOR PURCHASE command in this embodiment is: 01 0D B1 09 00 02 EA B1 90 00.
  • This embodiment provides a method for performing composite cache on an electronic wallet in a CPU card. The method can make the process of the entire composite cache more secure, and prevent illegal means to tamper with the specificity of the CPU card.
  • the composite application special file, and the method simplifies the realization of the hierarchical discount preferential service by writing new data into the composite application special file, and only needs to set the rate corresponding to the recharge amount when recharging, which is more convenient to manage.
  • the discounts enjoyed by members are only linked to the recharge amount, and more discounts are provided, thus saving management costs.
  • Embodiment 2 In order to simplify the grading discount preferential operation, it is convenient to automatically process the consumption amount.
  • the embodiment of the invention provides a method for consuming the electronic wallet. Referring to FIG. 4, the method includes: 401: CPU card enters the terminal In the non-contact sensing area, the CPU card is powered on and initialized;
  • Embodiments of the present invention provide a method for consuming an electronic wallet. In this embodiment,
  • the electronic wallet in the CPU card supports the functions of the composite cache and the consumption, and the composite storage operation of the electronic wallet in the CPU card is performed at the CPU terminal.
  • the transaction amount is directly added to the balance of the electronic wallet, and correspondingly, when the consumption is performed, the transaction amount and the value in the corresponding record of the composite special file are calculated according to a pre-agreed algorithm. After obtaining the new amount, the new amount obtained from the balance of the electronic 4 package is deducted, and the new balance of the electronic wallet is obtained, and the consumption operation is completed. Referring to FIG.
  • Step 501 The CPU card enters the non-contact sensing area of the terminal, and the CPU card is powered on and initialized.
  • Step 502 Waiting for the application sent by the receiving terminal The command, when receiving the composite cache initialization command INITIALIZE FOR CAPP LOAD, executing step 503, when receiving the consumption initialization command INITIALIZE FOR PURCHASE, executing step 526;
  • Step 503 reading the composite memory initialization command INITIALIZE FOR CAPP LOAD
  • the data is saved and saved; in this embodiment, the composite cache initialization command INITIALIZE FOR CAPP LOAD is used to initialize the composite cache transaction, and the 4 bytes of the INITIALIZE FOR CAPP LOAD command are divided into: Command Head + Command Body, which is: ( CLA + INS + P1 + P2) + (Lc + Data + Le), where CLA + INS + P1 + P2 is the command header, Lc + Data + Le is the command body, the command header
  • Step 504 Check whether the key index number included in the INITIALIZE FOR CAPP LOAD command is supported. If not, go to step 505. If yes, go to step 506.
  • Step 505 Return the status code 0x9403 to the terminal and terminate the execution.
  • the composite cache initialization operation is performed.
  • the method for generating the process key is specifically: connecting the pseudo random number and the electronic wallet The transaction serial number and the '8000' sequence are linked, and the data obtained after the link is encrypted by using the cache subkey DLK, and the obtained encrypted data is the process key.
  • Step 507 Calculate the first 4 ⁇ text authentication code MAC1 by using the above process key;
  • the method for calculating the first 4 ⁇ text authentication code MAC 1 by using the process key is specifically: 4 The balance of the package, the transaction amount, the transaction type identifier and the terminal number sequence link, and then use the process key to encrypt the linked data, and the first four bytes of the obtained encrypted data are the first four texts.
  • Step 4 508: Return the response of the INITIALIZE FOR CAPP LOAD command to the terminal; wherein, the response of the INITIALIZE FOR CAPP LOAD command is composed of Data + swl + sw2, and when the command is successfully executed, the response is 4 ⁇ The status codes swl and sw2 in the text are '9000'.
  • the data contained in the data field Data are: the balance of the CPU e-wallet before the transaction, the online transaction serial number of the CPU wallet, the key version number, the algorithm identification, the pseudo-random The number and MAC1, when the command execution is unsuccessful, the status codes swl and sw2 in the response message are not '9000', and there is no data field Data; specifically, in this embodiment, the INITIALIZE FOR CAPP LOAD command The response is as follows: 00 00 00 00 00 01 02 01 01 02 03 04 00 01 Bl 0A 90 00.
  • Step 509 Receive an update record command UPDATE RECORD sent by the terminal.
  • the update record command UPDATE RECORD is used to update data in the corresponding record in the composite application special file;
  • the composite application special file is composed of a file header and a file body.
  • the file header specifically includes: 2 bytes of FILE ID, 1 byte of FILE TYPE, 2 bytes of FILE SIZE, 1 byte of AC1, 1 byte of AC2, and 2 bytes of RFU , when FILE TYPE is 00, it means that the file is a binary file.
  • FILE TYPE 01
  • FILE TYPE it means that the file is a fixed length record file.
  • FILE TYPE 02
  • FILE When TYPE is 03 it indicates that the file is a loop file.
  • FILE TYPE When FILE TYPE is 05, it indicates that the file is a key file.
  • the FILE SIZE corresponding to the binary file is the file size
  • the FILE SIZE corresponding to the fixed length record file is the record.
  • the number of records and the length of the record, the FILE SIZE corresponding to the variable length record file is the number of records and the maximum length of the record.
  • the FILE SIZE corresponding to the loop file is the number of records and the length of the record, and the key file.
  • the FILE SIZE should be the number of records and the length of the record, and AC 1 is the read file right, AC2 is the write file right; the file body is the data of the composite application special file; specifically, in this embodiment, the composite application special file Specifically for fixed length records, FILE
  • TYPE 01
  • FILE SIZE is the number of records and the length of the record, specifically OA 10, the content in the file body is empty;
  • UPDATE RECORD command 4 is composed of CLA + INS + PI + P2 + Lc + Data
  • PI and P2 are used to specify which file records of the file are used as the record of the composite application special file
  • Lc is the length of the data in the Data plus 4 bytes.
  • the UPDATE RECORD command is specifically: 80 DC 03 68 08 00 00 80 00 , where 00 is CLA, DC is INS, 03 is PI, 04 is P2, 08 is Lc, 00 00 80 00 is Data; and the data field of the UPDATE RECORD command is Write new data in the corresponding record of the composite application special file, wherein, since the specific application corresponding to each record in the composite application special file can be customized by the card issuer, the data in the data domain can also be customized, such as In this embodiment, the data in the custom data domain is specifically a rate value, and the rate value is written into the record for writing the rate value in the composite application special file, specifically, in this embodiment.
  • the data in the update record command may not be 80%, may be 125%, or may be 20%, or the data of the update record command may not include the rate value
  • the CPU card judges the transaction amount included in the composite cache initialization command, generates a rate value according to the transaction amount, and writes the generated rate value into the corresponding record of the composite application special file.
  • the data of the update record command includes a rate value and a precondition of the rate value. Since the composite application special file in this embodiment is specifically a fixed length record file, the composite application special file is pre-agreed.
  • Each record in the record specifically includes a rate value under a precondition, such as when the transaction amount at the time of consumption is greater than 200 yuan, less than 300 yuan, the rate value is negative 20 yuan or the rate value is 90%, indicating consumption
  • the rate value is negative 100 yuan or the rate value is 80%, indicating that the consumption is less than 500 minus 100 or full 500 dozens of folds, etc.
  • the preconditions corresponding to each record in the specific composite application special file can be pre-defined by the card issuer, and the rate value under the precondition is also customized by the card issuer. .
  • Step 510 Determine whether there is a short file identifier SFI field in the UPDATE RECORD command, if yes, execute step 511. If not, execute step 512. Wherein, determine whether the SFI field exists in the update record command UPDATE RECORD. To: determine whether the upper 5 bits of P2 in the UPDATE RECORD command are all 0. If yes, it means that there is an SFI field in the command, that is, the upper 5 bits of P2 is the SFI value; otherwise, the SFI field does not exist in the command; In the embodiment, P2 in the UPDATE RECORD command is 68, indicating that the upper 5 bits of P2 are 01101, and the SFI field exists.
  • Step 511 Finding whether the SFI value of a file exists in the current application of the CPU card is the same as the SFI value in the UPDATE RECORD command. If not, executing step 512. If yes, executing step 513; Step 512: Returning status to the terminal The code 0x6A82 terminates the execution of the composite cache transaction at the same time; Step 513: The file found in the step 511 is used as a composite application special file, and the corresponding file is searched for in the composite application special file according to the record number specified in the UPDATE RECORD command.
  • step 514 If the corresponding record is not found, step 514 is performed, and if found, step 515 is performed; specifically, in the embodiment, the PI in the UPDATE RECORD command is 03, so the record number in the composite application special file is The record of 03 is the record that needs to be found.
  • Step 514 Return status code 0x6A83 to the terminal, and terminate execution of the composite cache transaction;
  • Step 515 Check whether the length of the data field in the UPDATE RECORD command is greater than the specified length of the record obtained in step 513. If yes, execute step 516. If not, perform step 4 517.
  • the record length in the composite application special file is determined by the value of FILE SIZE, since in this embodiment In the UPDATE RECORD command, the value of Lc is 08, and the value of FILE SIZE is OA 10, so the length of the data field in the command is not longer than the length of the composite application special file.
  • Step 516 Return the status code 0x6A84 to the terminal, and terminate the execution of the composite cache transaction.
  • Step 517 Write the data in the data field in the UPDATE RECORD command into the searched record, and replace the original content in the record.
  • the rate value is 80% written in the record, and the original content in the record is replaced; since the original content in the record in the composite application special file is empty in this embodiment, Write the data i or the 00 00 80 00 in the UPDATE RECORD command directly to the record in the composite application special file whose record number is 03; correspondingly, when updating the rate value in the record command When it is 125%, the data in the corresponding record written to the composite application special file is specifically 125%, and when the rate value in the update record command is 20%, the data in the corresponding record of the composite application special file is written.
  • the CPU card judges the transaction amount included in the composite cache initialization command according to the pre-agreed rule.
  • a rate value is generated according to the transaction amount, and the generated rate value is written into the corresponding record of the composite application special file, for example, when the transaction amount in the composite cache initialization command is 800 yuan, that is, less than the pre-agreed
  • the lower limit specifically 2000, generates a data of 95%, or 105%, or 5%, so 95% or 105% or 5% is written into the corresponding record of the composite application special file, and when the composite is stored
  • the specific ⁇ port is 2000 JiJ 6000 yen, and M generates a data of 80% or 125% or 20%, so 80 will be % or 125% or 20% is written in the corresponding record of the composite application special file
  • Step 518 Return the response of the UPDATE RECORD command to the terminal; wherein, the response of the UPDATE RECORD command is composed of swl + sw2, and there is no data field data. When the command is successfully executed, the response is returned.
  • the text is '9000'.
  • Step 519 The composite cache command CREDIT FOR CAPP LOAD is sent by the receiving terminal, and the data in the command data field is read and saved.
  • the composite cache command CREDIT FOR CAPP LOAD is used for the composite cache transaction;
  • the composition of the data includes the following: the transaction date, the transaction time, and the second message authentication code MAC2.
  • the CREDIT FOR CAPP LOAD command received in this embodiment is specifically: 80 52 00 00 0B 07 DA 06 08 OA 14 2D 00 01 Al 0B 08, where 80 is CLA, 52 is INS, 00 is PI, 00 is P2, 0B is Lc, 07 DA 06 08 is the transaction date in Data, OA 14 2D is Data Trading time, 00 01 Al 0B is MAC2 in Data, 08 is Le.
  • the method is specifically: linking the transaction amount, the transaction type identifier, the terminal number, the transaction date, and the transaction time, and then encrypting the data obtained by using the process key generated in step 506, and comparing the data obtained by the encryption.
  • the first four bytes are the same as the MAC2 in the data field of the CREDIT FOR CAPP LOAD command. If they are not the same, MAC2 is invalid. If they are the same, MAC2 is valid.
  • Step 521 Return status code 0x9302 to the terminal, prompting MAC2 to be invalid;
  • Step 523 Update the transaction details of the electronic 4 package; specifically: the online transaction serial number, the transaction amount, the transaction type identifier, the terminal number, the transaction date, and the transaction time sequence of the electronic wallet are combined to form a record to update the standard transaction details;
  • the data is the TAC code.
  • Step 525 Return the response of the CREDIT FOR CAPP LOAD command to the terminal; wherein, the response of the CREDIT FOR CAPP LOAD command is composed of data + swl + sw2, and when the command is successfully executed, the response returned is 4 ⁇ The status codes swl and sw2 in the text are '9000'.
  • the data in the data field of the response message is specifically TAC code.
  • the status codes swl and sw2 in the response are not returned. In the case of '9000, there is no data field in the response.
  • the response of the CREDIT FOR CAPP LOAD command returned in this embodiment is 00 05 D2 BC 90 00.
  • Step 526 Read the data in the consumption initialization command INITIALIZE FOR PURCHASE and save it; in this embodiment, the consumption initialization command INITIALIZE FOR PURCHASE is used to initialize the consumer transaction, and the INITIALIZE FOR PURCHASE command is used by CLA + INS + PI + P2 +Lc + Data + Le is composed, wherein the data in the data is specifically a key index number, a transaction amount, and a terminal number; specifically, in this embodiment, the received INITIALIZE FOR PURCHASE command is specifically: 80 50 01 02 0B 02 00 00 00 C8 00 00 00 00 00 01 OF, where 80 is CLA, 50 is INS, 01 is P1, 02 is P2, defined as the identifier of the electronic 4 packet, 0B is Lc, 02 is the key in Data Index number, 00 00 00 C8 is the transaction amount in Data, 00 00 00 00 00 01 is the terminal number in Data, and OF is Le.
  • Step 527 Check whether the key index number included in the above INITIALIZE FOR PURCHASE command is supported. If not, go to step 528. If yes, go to step 529. Step 528: Return the status code 0x9403 to the terminal, and terminate the operation.
  • Step 529 Calculate the transaction amount in the INITIALIZE FOR PURCHASE command and the value in the corresponding record of the composite application special file according to a pre-agreed algorithm to obtain a new amount;
  • the pre-agreed algorithm includes multiplication, Division, addition and subtraction, and various combinations of the four algorithms;
  • the value in the record of the composite application special file is a rate value, specifically 80%, so if the transaction amount when the consumption is 200 yuan When the transaction amount is 200 yuan and the rate value 80% in the composite special file is multiplied, the new amount is 160 yuan; and when the rate value in the record of the composite application special file is 125%, then Dividing the transaction amount of 200 yuan and the rate value of 125% in the compound special file, the new amount is 160 yuan; When the rate value in the record of the application-specific file is 20%, the transaction amount of 200 yuan is multiplied by 20% of the rate value in the composite special file to obtain
  • the new amount obtained is 160 yuan; or, when the transaction amount of consumption is 550 yuan, the precondition for the transaction amount of 550 yuan is that the transaction amount is greater than 500 yuan less than 600 yuan, so according to the premise
  • the condition can find the corresponding rate value in the corresponding record. Specifically, if the custom rate value is negative 100 yuan in the corresponding record, then at the time of consumption, the transaction amount is automatically 550 yuan and the rate in the corresponding record. The value is minus 100 yuan for addition, and the new amount is 450 yuan.
  • Step 530 Read the balance of the electronic wallet, determine whether the new amount exceeds the sum of the balance of the electronic wallet and the overdraft limit, and if yes, go to step 531. If no, go to step 532; Step 531: Return ⁇ I State code 0x9401 Give the terminal, and terminate the operation; Step 4: 532: Generate a pseudo random number and a process key; In this embodiment, the process key is used for the consumer transaction of the CPU electronic wallet or the Ml electronic wallet, and the process key is used The key DPK is scattered.
  • Step 533 Send a response of the INITIALIZE FOR PURCHASE command to the terminal; wherein, the INITIALIZE FOR PURCHASE response is composed of Data + swl + sw2, and when the command is successfully executed, the response is returned to the terminal.
  • the codes swl and sw2 are '9000', and the data contained in the response message Data is specifically the balance of the electronic wallet, the offline transaction serial number of the CPU electronic wallet, the overdraft limit, the key version number, the algorithm identifier, and the pseudo random number.
  • the response returned to the terminal includes only the status codes swl and sw2, and the status codes swl and sw2 are not '9000; specifically, the INITIALIZE FOR PURCHASE response returned to the terminal in this embodiment 4
  • the text is: 00 00 4B 00 00 01 00 00 64 02 03 01 02 03 04 90 00.
  • Step 534 Receive the consumption command DEBIT FOR PURCHASE sent by the terminal, read the data in the command and save it; in this embodiment, the DEBIT FOR PURCHASE command is used for the consumption operation; wherein, the DEBIT FOR PURCHASE command is also used by the CLA + INS + P1 + P2 + Lc + Data + Le composition, the data in Data is specifically: terminal transaction serial number, transaction date, transaction time and third authentication code MAC3; specifically, in this embodiment, received DEBIT
  • the FOR PURCHASE command is specifically: 80 54 01 00 0F 00 00 00 01 7D AO 06 09 OF 27 13 01 OA Dl 0C 08, where 80 is CLA, 54 is INS, 01 is PI, 00 is P2, and OF is Lc, 00 00 00 01 is the terminal transaction serial number in Data, 7D AO 06 09 is the transaction date in Data, OF 27 13 is the transaction time in Data, 01 OA Dl 0C is MAC3 in Data, and 08 is Le.
  • Step 535 Use the process key generated in step 532 to check whether the MAC3 included in the DEBIT FOR PURCHASE command is valid. If not, execute step 536. If yes, execute step 537.
  • the method of whether the MAC3 included in the DEBIT FOR PURCHASE command is valid is specifically: linking the transaction amount, the transaction type identifier, the terminal number, the transaction date of the terminal, and the transaction time of the terminal, using the process secret generated in step 532.
  • the key encrypts the data obtained by the link and compares the obtained force. Whether the first four bytes of the encrypted data are the same as the MAC3 included in the DEBIT FOR PURCHASE command, if not the same, MAC3 is invalid.
  • Step 536 Return the status code 0x9302 to the terminal, terminate the operation;
  • Step 537 Add 1 to the offline transaction serial number of the electronic wallet, and deduct the new amount obtained in step 529 from the balance of the electronic wallet;
  • Step 538 Update the electronic 4
  • the transaction details of the package; in this embodiment, the related transaction details of the electronic wallet that need to be updated are specifically: transaction amount, transaction type identifier, terminal number, transaction date, and transaction time, specifically, the CPU card will be the transaction amount, the transaction type The identification, terminal number, transaction date, and transaction time sequence links form a record for updating.
  • Step 539 Generate a fourth message authentication code MAC4, and then calculate a transaction verification code TAC code.
  • the method for generating the fourth 4D authentication code MAC4 is specifically: using the process key pair transaction generated in step 532
  • the amount is encrypted, and the first four bytes of the obtained encrypted data are the fourth text authentication code MAC4.
  • the method for calculating the TAC code by using the result of the exclusive OR operation is specifically: performing an exclusive OR operation with 8 bytes of DTK, and the transaction amount, the transaction type identifier, the terminal number, the terminal transaction serial number, and the terminal transaction.
  • the date and the transaction time of the terminal are sequentially linked, and the result obtained by the exclusive OR operation is used to encrypt the data obtained by the link, and the first four bytes of the obtained encrypted data are the TAC code.
  • Step 540 Return the response of the DEBIT FOR PURCHASE command to the terminal, and the transaction ends.
  • the response of the DEBIT FOR PURCHASE command is composed of data + swl + sw2.
  • the status codes swl and sw2 in the response message are '9000', and correspondingly, the data field data is specifically TAC.
  • Code and MAC4 when the command execution is unsuccessful, the status codes swl and sw2 in the response message are not '9000' and do not contain the data field; specifically, the response of the DEBIT FOR PURCHASE command in this embodiment is 4 For: 01 0D B 1 09 00 02 EA B 1 90 00.
  • the command received by the CPU card to update the composite application special file is not the update record command UPDATE RECORD, but the UPDATE CAPP DATA CACHE command.
  • the specific operation after the CPU card receives the UPDATE CAPP DATA CACHE command is as follows: Step 509:: Receive a command UPDATE CAPP DATA CACHE for updating the composite application special file sent by the terminal;
  • the command UPDATE for updating the composite application special file is CAPP DATA
  • the CACHE is used to update the data in the composite application patent file.
  • the UPDATE CAPP DATA CACHE command is composed of CLA + INS + P1 + P2 + Lc + Data.
  • the UPDATE CAPP DATA CACHE command is specifically: 80 D6 92 B l 04 00 01 20 00, where 80 is CLA, D6 is INS, 92 is PI, B 1 is P2, 04 is Ix, 00 01 20 00 ⁇ Data; and the data field of UPDATE CAPP DATA CACHE command
  • the data in the data is new data to be written into the composite application special file, wherein the specific application of the composite application special file can be customized by the card issuer, so the data in the data domain can also be customized, as in this implementation.
  • the composite application-specific file can be customized as a rate file, and correspondingly, the data in the data domain is specifically a rate value.
  • the rate value is specifically defined as 120%; specifically, in this embodiment.
  • the composite application special file is specifically a binary file, and the FILE TYPE is 00, and the FILE SIZE is the file size, specifically 00 0B, and the content in the file body is empty.
  • Step 510 Determine whether there is an SFI domain in the received UPDATE CAPP DATA CACHE command, if yes, execute step 511, if not, execute step 512; In this embodiment, it is determined whether the SFI i exists in the UPDATE CAPP DATA CACHE command or specifically: determining whether the upper three bits of the PI in the UPDATE CAPP DATA CACHE command are 100, and if so, indicating that the SFI field exists in the command, and the PI is low. The 5 bits are the SFI field. Otherwise, it means that there is no SFI i or in the command.
  • Step 511 Find whether the SFI value of a file exists in the current application of the CPU card is the same as the SFI value in the UPDATE CAPP DATA CACHE command, if not, execute step 512', if yes, perform step 4 513; Step 512: Return the status code 0x6A82 to the terminal, and terminate the execution of the composite cache transaction.
  • Step 513' Use the file found in step 51 as a composite application special file, and check the data in the UPDATE CAPP DATA CACHE command.
  • the composite application special file is a binary file, so the composite application is dedicated.
  • the length of the file is specifically the value of FILE SIZE. Specifically, it is to determine whether the value of Lc in the UPDATE CAPP DATA CACHE command is greater than the value of the composite application dedicated file FILE SIZE. Because the value of Lc in the UPDATE CAPP DATA CACHE command is 04 in this embodiment.
  • the value of FILE SIZE is 00 OB, so the length of the data field in the command is not longer than the length of the composite application special file.
  • Step 514 return the status code 0x6A84 to the terminal, and terminate the execution of the composite cache transaction;
  • Step 515' Write the data in the data field in the UPDATE CAPP DATA CACHE command to the composite application special file, and replace the composite application.
  • the original content in the special file in this embodiment, specifically writing the rate value 120% into the composite application special file, replacing the original content; because the original content in the composite application special file in this embodiment It is empty, so you can directly write the data i in the UPDATE CAPP DATA CACHE command or 00 01 20 00 in the composite application special file.
  • Step 516 return the response of the UPDATE CAPP DATA CACHE command to the terminal;
  • the response of the UPDATE CAPP DATA CACHE command consists of swl + sw2. There is no data field data.
  • the UPDATE CAPP DATA CACHE command is executed successfully, the response is 4, and the UPDATE CAPP DATA CACHE command. If the execution is unsuccessful, the response is not '9000'.
  • This embodiment provides a method for consuming an electronic wallet in a CPU card. The method can make the process of the entire composite cache more secure, and prevent illegal means to tamper with specific combinations in the CPU card.
  • the application special file, and the method simplifies the realization of the hierarchical discount preferential service by writing new data into the composite application special file, and automatically processes the amount of consumption during consumption, which is more convenient for management, thereby saving management. cost.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Description

一种对电子钱包进^ "操作的方法 技术领域 本发明涉及信息安全领域, 特别涉及一种对 CPU 卡内的电子钱包进行操 作的方法。 背景技术
CPU卡的芯片内含有一个微处理器, 它的功能相当于一台微型计算机, 并 且 CPU卡内包括中央处理器 ( CPU )、 只读存储器 ( ROM )、 随机存取存储器 (RAM), 电可擦除可编程只读存储器 (EEPROM ) 等, 具有信息量大、 防伪安 全性高、 可脱机作业, 可多功能开发等优点。 CPU卡釆用强大而稳定的安全控 制器, 增强了卡片的安全性, 并且 CPU 卡所特有的内外部认证机制以及以金 融 IC 卡规范为代表的专用认证机制, 能够完全保证交易的合法性和安全性, 然后 CPU 卡的应用防火墙功能可以保障同一张卡中不同应用的安全独立性, 同时, CPU卡的大容量存储空间又可以满足预期的大金额消费应用所要求的更 多客户信息的存储。 在现有技术中, CPU 卡中的电子钱包可以实现普通的圏存、 消费 /取现、 圏提、 更新透支限额等基本交易功能, 但是在遇到特殊的应用时, 如在需要对 不同的充值金额进行分级打折优惠的促销性应用时, 如商场、 超市、 餐馆、 健 身会所等机构的会员卡, 则现有的电子钱包的普通的圏存操作和消费操作不能 满足这种应用。 发明内容 为了解决现有技术中的不足, 本发明提供了一种对电子钱包进行操作的方 法。 一种对电子钱包进行操作的方法, 包括:
CPU卡进入终端的非接触式感应区内, 所述 CPU卡上电并初始化; 接收所述终端发送的操作初始化命令, 读取所述操作初始化命令中的数据 并保存, 所述数据包括交易金额, 所述操作初始化命令为复合圏存初始化命令 或消费初始化命令; 如果所述操作初始化命令为复合圏存初始化命令, 则进行复合圏存初始化 操作; 接收所述终端发送的更新复合应用专用文件命令, 查找复合应用专用文 件; 将预先约定的数据写入所述复合应用专用文件的存储空间中, 替换原有内 容; 接收所述终端发送的复合圏存命令, 读取所述复合圏存命令中的数据并保 存; 按照预先约定的算法对所述交易金额与所述复合应用专用文件中的数据进 行运算, 得到新金额, 将所述得到新金额加到电子钱包的余额上, 得到新余额; 如果所述操作初始化命令为消费初始化命令, 按照预先约定的算法对所述 交易金额和复合应用专用文件中的相应记录中的值进行计算, 得到新金额; 读 取所述电子钱包的余额, 判断所述新金额是否超过所述电子钱包的余额与透支 限额的和; 若是, 则向所述终端返回所述电子钱包余额不足的信息, 终止操作; 若否, 则生成一个伪随机数和一个过程密钥, 将所述消费初始化命令的响应报 文返回给所述终端; 接收所述终端发送的消费命令, 读取所述消费命令终的数 据并保存; 从所述电子钱包的余额中扣减所述新金额, 得到新的金额, 并将所 述消费命令的响应报文返回给所述终端。 本发明的有益效果在于: 本发明提供了一种对电子钱包进行操作的方法, 通过本发明提供的方法使整个交易过程更安全, 且防止了釆取非法的手段去修 改 CPU卡中的复合应用专用文件, 进一步地简化了分级打折优惠操作的实现, 只需要在圏存时对复合应用专用文件进行设定即可,并且方便管理,从而节省了 管理的成本。 附图说明 图 1为本实施例 1提供的一种对电子钱包进行复合圏存的方法的流程图; 图 2为本实施例 1提供的一种对电子钱包进行复合圏存的方法的详细流程 图; 图 3为本实施例 1提供的一种对电子钱包进行消费的方法的详细流程图; 图 4为本实施例 2提供的一种对电子钱包进行消费的方法的流程图; 以及 图 5为本实施例 2提供的一种对电子钱包进行消费的方法的详细流程图。 具体实施方式 为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明 实施方式故进一步地详细描述。 实施例 1 为了简化分级打折优惠操作, 在复合圏存时对复合应用专用文件进行设 定, 本发明实施例提供了一种对电子钱包进行复合圏存的方法, 参见图 1 , 该 方法内容包括:
S 1:CPU卡进入终端的非接触式感应区内, 所述 CPU卡上电并初始化;
S2:接收所述终端发送的复合圏存初始化命令,读取所述复合圏存初始化命 令中的数据并保存,进行复合圏存初始化操作,其中所述数据中包括交易金额;
S3:接收所述终端发送的更新复合应用专用文件命令,查找复合应用专用文 件;
S4:将预先约定的数据写入所述复合应用专用文件的存储空间中,替换原有 内容; S5:接收所述终端发送的复合圏存命令,读取所述复合圏存命令中的数据并 保存;
S6:按照预先约定的算法对所述交易金额与所述复合应用专用文件中的数 据进行运算, 得到新金额, 将所述得到的新金额加到电子钱包的余额上, 得到 新余额, 复合圏存操作结束。 为了对本发明实施例提供的方法进行详细说明, 请参见如下实施例: 实施例 本发明实施例提供了一种对电子钱包进行复合圏存的方法, 在本实施例 中, 以 CPU卡内的电子钱包为例进行说明, CPU卡内的电子钱包除了具有普 通电子钱包的基本交易功能外, 还具有支持复合应用的钱包的所有交易功能, 相应地也支持复合圏存的功能, 并且对 CPU 卡内电子钱包的复合圏存操作是 在 CPU 终端进行的, 其中进行复合圏存操作时, 按照预先约定的规则对交易 金额与复合专用文件中规定的值进行运算, 得到新金额, 并将得到的新金额加 到电子钱包的余额上, 完成复合圏存操作, 相应地, 在消费时, 则按照该余额 进行消费。 参见图 2, —种对 CPU卡内的电子钱包进行复合圏存的方法, 具体实现步 骤如下: 步 4聚 101 : CPU卡进入终端的非接触式感应区内, CPU卡上电并初始化; 步骤 102: 接收终端发送的复合圏存初始化命令 INITIALIZE FOR CAPP LOAD , 读取命令中包含的数据并保存; 在本实施例中, 复合圏存初始化命令 INITIALIZE FOR CAPP LOAD用于 初始化复合圏存交易, 其中 INITIALIZE FOR CAPP LOAD命令 4艮文分成: 命 令头 + 命令体, 即为: (CLA + INS + P1 + P2) + (Lc + Data + Le); 其中, CLA + INS + PI + P2为命令头, Lc + Data + Le为命令体, 命令头 为命令的编码, 命令头中的 CLA为指令类别, INS为指令代码, P1和 P2为指 令参数; 命令体中的 Lc为命令体内 Data中数据的长度, Data为 INITIALIZE FOR CAPP LOAD命令中的数据, Le是期望的应答 APDU数据字段的最大字 节数; 本实施例中 INITIALIZE FOR CAPP LOAD命令 Data中包含的数据具体为 密钥索引号、 交易金额和终端机编号; 具体地, 在本实施例中, 接收到的 INITIALIZE FOR CAPP LOAD命令具 体为: 80 50 06 02 0B 02 00 00 03 E8 00 00 00 00 00 01 10, 其中 80为 CLA, 50 为 INS , 06为 PI , 定义为复合圏存初始化的标识, 02为 P2, 定义为电子 4 包 的标识, 0B为 Lc, 02为 Data中的密钥索引号, 00 00 03 E8为 Data中的交易 金额, 00 00 00 00 00 01为 Data中的终端机编号, 10为 Le。 步骤 103 : 检查自身是否支持 INITIALIZE FOR CAPP LOAD命令中包含 的密钥索引号, 若不支持, 则执行步骤 104, 若支持, 则执行步骤 105; 步骤 104: 向终端返回状态码 0x9403 , 同时终止执行复合圏存初始化操作; 步 4聚 105 : 生成一个四字节的伪随机数和一个过程密钥; 在本实施例中, 生成过程密钥的方法具体为: 将上述伪随机数、 电子钱包联机交易序号和' 8000'顺序链接, 再利用圏存 子密钥 DLK对链接后得到的数据进行加密, 得到的加密后的数据即为过程密 钥。 步骤 106: 利用上述过程密钥计算得到第一报文鉴别码 MAC1 ; 在本实施例中,利用过程密钥计算得到第一 4艮文鉴别码 MAC 1的方法具体 为: 将交易前的电子 4 包的余额、 交易金额、 交易类型标识和终端机编号顺序 链接, 再利用过程密钥对链接后的数据进行加密, 得到的加密后的数据的前四 个字节即为第一 4艮文鉴别码 MAC 1。 步 4聚 107: 将 INITIALIZE FOR CAPP LOAD命令的响应 4艮文返回给终端; 其中, INITIALIZE FOR CAPP LOAD命令的响应 4艮文由 Data + swl + sw2 组成, 当 INITIALIZE FOR CAPP LOAD命令执行成功时, 则响应 4艮文中的状 态码 swl和 sw2为' 9000' , 相应地, 响应 4艮文数据域 Data中包含的数据具体 为交易前的 CPU电子钱包的余额、 CPU钱包的联机交易序号、 密钥版本号、 算法标识、 伪随机数和 MAC1 , 当 INITIALIZE FOR CAPP LOAD命令执行不 成功时, 则响应 4艮文中的状态码 swl和 sw2不为' 9000' , 并且也不存在数据域 Data; 具体地, 在本实施例中, INITIALIZE FOR CAPP LOAD命令的响应 4艮文 具体为: 00 00 00 00 00 01 02 03 01 02 03 04 00 01 B l 0A 90 00。 步骤 108: 接收终端发送的更新复合应用专用文件的命令 UPDATE CAPP
DATA CACHE; 在本实施例中, 更新复合应用专用文件的命令 UPDATE CAPP DATA CACHE用于更新复合应用专利文件中的数据; 复合应用专用文件由文件头和文件体组成, 文件头具体包括: 2个字节的 FILE ID, 1个字节的 FILE TYPE, 2个字节的 FILE SIZE , 1个字节的 AC1、 1个字节的 AC2和 2个字节的 RFU, 其中当 FILE TYPE为 00时, 表示该文 件为二进制文件, 当 FILE TYPE为 01 时, 表示该文件为定长记录文件, 当 FILE TYPE为 02时, 表示该文件为变长记录文件, 当 FILE TYPE为 03时, 表示该文件为循环文件, 当 FILE TYPE为 05时, 表示该文件为密钥文件, 相 应地, 二进制文件对应的 FILE SIZE为文件大小, 定长记录文件对应的 FILE SIZE为记录条数和记录长度, 变长记录文件对应的 FILE SIZE为记录条数和 记录最大长度,循环文件对应的 FILE SIZE为记录条数和记录长度, 密钥文件 对应的 FILE SIZE为记录条数和记录长度, 并且 AC 1为读文件权限, AC2为 写文件权限; 文件体中为复合应用专用文件的数据; 具体地, 在本实施例中, 复合应用专用文件具体为二进制文件, 则 FILE TYPE为 00 ,且 FILE SIZE为文件大小,具体为 00 0B ,文件体中的内容为空; 进一步地, UPDATE CAPP DATA CACHE命令报文由 CLA + INS + P 1 + P2 + Lc + Data组成, 本实施例中, UPDATE CAPP DATA CACHE命令具体为: 80 D6 92 B l 04 00 01 20 00 , 其中, 80为 CLA, D6为 INS , 92为 P I , B 1为 P2 , 04为 Lc , 00 01 20 00为 Data; 并且 UPDATE CAPP DATA CACHE命令的数据域 Data中的数据为要写入 复合应用专用文件的新数据, 其中, 由于复合应用专用文件的具体应用可以由 发卡方自定义, 因此数据域中的数据也可以是自定义的, 如在本实施例中复合 应用专用文件可以自定义为费率文件, 则相应地, 数据域中的数据具体为费率 值, 在本实施例中具体定义费率值为 120 % ; 相应地, 当定义费率值为 120%时, UPDATE CAPP DATA CACHE命令中 的数据可以不是 120 % , 可以是 83.3 % , 还可以是 20 % , 或者, UPDATE CAPP DATA CACHE命令的数据中可以不包括费率值, 而由 CPU卡对复合圏存初始 化命令中包含的交易金额进行判断, 根据交易金额生成一个费率值, 将这个生 成的费率值写入复合应用专用文件中, 如当复合圏存初始化命令中的交易金额 为 800元时, 即小于预先约定的下限时, 具体如为 2000时, 则生成一个费率 值 90 % , 或者 111. 1 % , 或者 11. 1 % , 或者 100元, 当复合圏存初始化命令中 的交易金额为 5000元时, 即在预先约定的下限与上限之间时, 具体如为 2000 到 6000时, 则生成一个数据 80 % , 或者 125 % , 或者 25 % , 或者 600元, 当 复合圏存初始化命令中的交易金额为 8000 元时, 即大于预先约定的下限时, 具体如为 6000时, 则生成一个数据 75 % , 或者 133 % , 或者 33 % , 或者 2000 元等等。 步骤 109: 判断接收到的 UPDATE CAPP DATA CACHE命令中是否存在 SFI域, 若存在, 则执行步骤 110 , 若不存在, 则执行步骤 111 ; 在本实施例中, 判断 UPDATE CAPP DATA CACHE命令中是否存在 SFI i或具体为: 判断 UPDATE CAPP DATA CACHE命令中的 P I的高三位是否为 100 , 若是, 则表示命令中存在 SFI域, PI的低 5位即为 SFI域的值, 否则, 表示命令中不存在 SFI域; 具体地, 本实施例中 UPDATE CAPP DATA CACHE命令中的 P I为 92 , 表 示 P 1的高三位为 100 , 存在 SFI i或。 步骤 110 : 查找 CPU卡当前应用下是否存在一个文件的 SFI值与 UPDATE CAPP DATA CACHE命令中的 SFI值相同, 若不存在, 则执行步骤 111 , 若存 在, 则执行步 4聚 112; 步 4聚 111 : 向终端返回^ I 态码 0x6A82 , 同时终止操作; 步骤 112 : 将步骤 110中查找得到的文件作为复合应用专用文件, 并检查 UPDATE CAPP DATA CACHE命令中的数据域的长度是否大于复合应用专用 文件的长度, 若大于, 则执行步骤 113 , 若不大于, 则执行步骤 114; 在本实施例中, 由于复合应用专用文件是二进制文件, 所以复合应用专用 文件的长度具体为 FILE SIZE 的值, 具体即为判断 UPDATE CAPP DATA CACHE命令中 Lc的值是否大于复合应用专用文件 FILE SIZE的值, 由于本 实施例中 UPDATE CAPP DATA CACHE命令中 Lc的值为 04 , FILE SIZE的 值为 00 OB , 所以命令中的数据域的长度不大于复合应用专用文件的长度。 步骤 113 : 向终端返回状态码 0x6A84 , 同时终止操作; 步骤 114 : UPDATE CAPP DATA CACHE命令中的数据域中的数据写入 复合应用专用文件中, 替换该复合应用专用文件中的原有内容; 在本实施例中, 具体将费率值 120 %写入该复合应用专用文件中, 替换其 原有内容; 由于本实施例中复合应用专用文件中的原有内容为空, 因此直接将 UPDATE CAPP DATA CACHE命令中的数据 i或中的 00 01 20 00写入复合应用 专用文件中即可; 相应地, 当 UPDATE CAPP DATA CACHE命令中的费率值为 83.3 %时, 则写入复合应用专用文件中的数据具体为 83.3 % , 当 UPDATE CAPP DATA CACHE命令中的费率值为 20 %时, 则写入复合应用专用文件中的数据具体为 20 %; 或者, 当 UPDATE CAPP DATA CACHE命令的数据中可以不包括费率值, 而由 CPU 卡对复合圏存初始化命令中包含的交易金额进行判断, 按照预先约 定的规则根据交易金额生成一个费率值, 再将这个生成的费率值写入复合应用 专用文件中, 并且在写入复合应用专用文件之前还要判断生成的费率值的长度 是否大于复合应用专用文件的长度, 例如, 当复合圏存初始化命令中的交易金 额为 800元时, 即小于预先约定的下限时, 具体如为 2000时, 则将生成的 90 % , 或者 111.1 % , 或者 11.1 % , 或者 100元写入复合应用专用文件中, 而当 复合圏存初始化命令中的交易金额为 5000 元时, 即在预先约定的下限与上限 之间日寸, 具体^口为 2000 JiJ 6000日寸, 贝 夺生成 ό 80 % , 或者 125 % , 或者 25 % , 或者 600元写入复合应用专用文件中, 或者当复合圏存初始化命令中的交 易金额为 8000元时, 即大于预先约定的下限时, 具体如为 6000时, 则将生成 的 75 % , 或者 133 % , 或者 33 % , 或者 2000元写入复合应用专用文件中。 步骤 115 : 将 UPDATE CAPP DATA CACHE命令的响应 4艮文返回给终端; 其中, UPDATE CAPP DATA CACHE命令的响应 4艮文由 swl + sw2组成, 不存在数据域 data, 当 UPDATE CAPP DATA CACHE命令执行成功时, 则响 应 4艮文为 '9000,, 当 UPDATE CAPP DATA CACHE命令执行不成功时, 则响应 4艮文不为' 9000'。 步骤 116: 接收终端发送的复合圏存命令 CREDIT FOR CAPP LOAD, 读 取命令数据域中的数据并保存; 在本实施例中, 复合圏存命令 CREDIT FOR CAPP LOAD用于复合圏存交 易;
CREDIT FOR CAPP LOAD命令 4艮文由 CLA + INS + P1 + P2 + Lc + Data + Le组成, 其中数据域 Data中的数据具体包括: 交易日期、 交易时间和第二报 文鉴别码 MAC2; 具体地, 本实施例中接收到的 CREDIT FOR CAPP LOAD命令具体为: 80 52 00 00 0B 07 DA 06 08 OA 14 2D 00 01 Al 0B 08,其中, 80为 CLA, 52为 INS , 00为 PI , 00为 P2, 0B为 Lc, 07 DA 06 08为 Data中的交易日期, OA 14 2D 为 Data中的交易时间, 00 01 Al 0B为 Data中的 MAC2, 08为 Le。 步骤 117: 验证数据中的第二报文鉴别码 MAC2是否有效, 若无效, 则执 行步 4聚 118, 若有效, 则执行步 4聚 119; 在本实施例中, -险证 MAC2是否有效的方法, 具体为: 将交易金额、 交易类型标识、 终端机编号、 交易日期和交易时间顺序链接, 然后使用步骤 105中生成的过程密钥对链接得到的数据进行加密, 再比较加密 后得到的数据的前四个字节与 CREDIT FOR CAPP LOAD 命令数据域中的 MAC2是否相同, 若不相同, 则 MAC2无效, 若相同, 则 MAC2有效。 步骤 118: 向终端返回状态码 0x9302, 提示 MAC2无效; 步骤 119: 将电子钱包的联机交易序号加 1 , 按照预先约定的算法对交易 金额与复合应用专用文件中的值进行运算, 得到新金额, 并将得到的新金额加 到电子钱包的余额上; 在本实施例中, 预先约定的算法包括乘法、 除法、 加法和减法, 以及所述 四种算法的各种组合; 进一步地, 复合应用专用文件中的值为费率值, 具体为 120 % , 因此若当 交易金额为 1000元, 电子 4 包中的余额为 0元时, 则将交易金额 1000元乘上 复合专用文件中的费率值 120 %之后,得到的新金额为 1200元, 因此将这 1200 元加到电子 4 包的余额 0元上, 得到新的余额为 1200元, 这样电子 4 包中的 新余额 1200元就比将交易金额 1000元直接加到电子钱包的余额上得到的余额 1000元要多; 当写入复合应用专用文件中的费率值具体为 83.3 %时,若交易金额为 1000 元, 电子钱包中的余额为 0元, 则将交易金额 1000元除以费率值 83.3 %之后, 得到的新金额为 1200元, 因此将这 1200元力口到电子 4 包的余额 0元上, 得到 新的余额为 1200元, 这样电子 4 包中的新余额 1200元就比将交易金额 1000 元直接加到电子钱包的余额上得到的余额 1000元要多; 当写入复合应用专用文件中的费率值具体为 20 %时, 若交易金额为 1000 元, 电子钱包中的余额为 0元, 则将交易金额 1000元乘上费率值 20 %后, 再 力口上交易金额 1000元, 最后得 i l ό 新金额为 1200元, @ jtb i 1200元力口 i l 电子钱包的余额 0元上, 得到新的余额为 1200元, 这样电子钱包中的新余额 1200元就比将交易金额 1000元直接加到电子 4 包的余额上得到的余额 1000元 要多; 或者当复合圏存初始化命令中的交易金额为 8000 元时, 则将生成的费率 值 75 % , 或者 133 % , 或者 33 % , 或者 2000元写入复合应用专用文件中, 此 时当写入复合应用专用文件中的费率值为 75 %时, 交易金额 8000元除以 75 % 之后得到的新金额为 10060元,因此将这 10060元力。到电子 4 包的余额 0元上, 得到新的余额为 10060元, 这样电子 4 包中的新余额 10060元就比将交易金额 8000元直接加到电子钱包的余额上得到的余额 8000元要多; 当写入复合应用 专用文件中的费率值为 133 %时, 交易金额 8000元乘上 133 %之后得到的新金 额为 10060元, 因 jt匕 4夺这 10060元力口 i l电子 4 包 ό 余额 0元上, 得 i l新 ό 余额 为 10060元, 这样电子 4 包中的新余额 10060元就比将交易金额 8000元直接 加到电子钱包的余额上得到的余额 8000 元要多; 当写入复合应用专用文件中 的费率值为 33 %时, 交易金额 8000元乘上 33 %之后, 再加上交易金额 8000 元,得 ΐ1 ό 新金额为 10060元, @ jtb i 10060元力口 i l电子 4 包 ό 余额 0元上, 得到新的余额为 10060元, 这样电子 4 包中的新余额 10060元就比将交易金额 8000元直接加到电子钱包的余额上得到的余额 8000元要多; 当写入复合应用 专用文件中的费率值为 2000元时, 交易金额 8000元力口上 2000元后得到的新 余额为 10000元, @ jtb i 10000元力口 i l电子 4 包 ό 余额 0元上, 得 i l新 ό 余 额为 10000元, 这样电子 4 包中的新余额 10000元就比将交易金额 8000元直 接加到电子钱包的余额上得到的余额 8000元要多。 步 4聚 120: 更新电子 4 包的交易明细; 具体地为: 将电子钱包的联机交易序号、 交易金额、 交易类型标识、 终端 机编号、 交易日期和交易时间顺序链接组成一个记录来更新标准交易明细。 步 4聚 121 : 计算交易-险证码 TAC; 在本实施例步骤 121中, 计算交易验证码 TAC码, 具体为: 用 DTK左右 8个字节进行异或运算, 并将交易后的电子钱包的余额、加 1 前的电子 4 包的联机交易序号、 交易金额、 交易类型标识、 终端机编号、 交易 日期和交易时间顺序链接, 再利用异或运算得到的结果对链接得到的数据进行 加密, 得到的加密后的数据即为 TAC码。 步骤 122: 将 CREDIT FOR CAPP LOAD命令的响应 4艮文返回给终端, 复 合圏存操作结束。 其中, CREDIT FOR CAPP LOAD命令的响应 4艮文由 data + swl + sw2组 成,当 CREDIT FOR CAPP LOAD命令执行成功时,则响应 4艮文中的状态码 swl 和 sw2为' 9000,, 相应地, 数据 i或 data具体为 TAC码, 当 CREDIT FOR CAPP LOAD命令执行不成功时, 则响应 4艮文中的状态码 swl和 sw2不为' 9000' , 并 且不包含数据域; 具体地, 在本实施例中返回的 CREDIT FOR CAPP LOAD命令的响应 4艮文 为 00 05 D2 BC 90 00。 进一步地, 在本实施例中, 当复合应用专用文件为记录型文件时, 则复合 应用专用文件中的每一条记录对应着一个应用, 具体地, 本实施例中复合应用 专用文件中的 FILE TYPE为 01 , 表示该复合应用专用文件为定长记录文件, 相应地, 定长记录文件对应的 FILE SIZE为记录条数和记录长度; 相应地, 对复合应用专用文件进行更新的步骤 108至步骤 116还可以替换 为: 步骤 108,: 接收终端发送的更新记录命令 UPDATE RECORD; 其中, 更新记录命令 UPDATE RECORD用于更新命令中指定的记录,并且 该 UPDATE RECORD命令适用于定长记录文件和变长记录文件; 具体地, UPDATE RECORD命令 4艮文由 CLA + INS + PI + P2 + Lc + Data 组成,其中 PI 和 P2用于指定将哪个文件的第几条记录作为复合应用专用文件 的记录, Lc 为 Data 中的数据的长度加上 4 个字节, 本实施例中, UPDATE RECORD命令具体为: 00 DC 03 04 08 00 01 20 00 , 其中, 00为 CLA, DC为 INS , 03为 PI , 04为 P2 , 08为 Lc, 00 01 20 00为 Data; 并且 UPDATE RECORD命令的数据域中即为要写入复合应用专用文件的 新数据, 其中, 由于复合应用专用文件的具体应用可以由发卡方自定义, 因此 数据域中的数据也可以是自定义的, 如在本实施例中复合应用专用文件可以自 定义为费率文件, 则相应地, 数据域中的数据具体为费率值, 在本实施例中具 体定义费率值为 120 %。 步骤 109,:判断接收到的更新记录命令 UPDATE RECORD中是否存在 SFI 域, 若存在, 则执行步骤 110' , 若不存在, 则执行步骤 111' ; 其中, 判断更新记录命令 UPDATE RECORD中是否存在 SFI域的方法具 体为: 判断 UPDATE RECORD命令中的 P2的高 5位是否全为 0, 若是, 则表 示命令中存在 SFI域, 即 P2的高 5位即是 SFI域的值, 否则, 表示命令中不 存在 SFI域。 步骤 110,:查找 CPU卡当前应用下是否存在一个文件的 SFI值与 UPDATE RECORD命令中的 SFI值相同, 若不存在, 则执行步骤 111' , 若存在, 则执行 步骤 112,; 步骤 111,: 向终端返回状态码 0x6A82, 同时终止执行此次复合圏存交易; 步骤 112' : 将步骤 110'中查找得到的文件作为复合应用专用文件, 并根据 UPDATE RECORD 命令中指定的记录号在该复合应用专用文件中查找相应的 记录, 若没有找到相应的记录, 则执行步骤 113,, 若找到相应的记录, 则执行 步骤 114,; 步骤 113,: 向终端返回状态码 0x6A83 , 同时终止执行此次复合圏存交易; 步骤 114': 检查 UPDATE RECORD命令中的数据域的长度是否大于步骤 112,中查找得到的记录的指定长度, 若大于, 则执行步骤 115,, 若不大于, 则 执行步骤 116,; 步骤 115,: 向终端返回状态码 0x6A84, 同时终止执行此次复合圏存交易; 步骤 116': 将 UPDATE RECORD命令中的数据域中的数据写入查找得到 的记录中, 替换该记录中的原有内容; 在本实施例中, 具体将费率值 120 %写入该记录中, 替换该记录中的原有 内容。 步骤 117,: 将 UPDATE RECORD命令的响应 4艮文返回给终端; 其中, UPDATE RECORD命令的响应 4艮文由 swl + sw2组成, 不存在数据 域 data, 当 UPDATE RECORD 命令执行成功时, 则响应 4艮文为 '9000,, 当 UPDATE RECORD命令执行不成功时, 则响应 4艮文不为' 9000'。 进一步地, 在本实施例中, 通过上述方法进行复合圏存操作之后, 则可以 利用该 CPU卡中的电子钱包进行消费, 参见图 3 , 消费操作的流程具体如下: 步骤 201 :接收终端发送的消费初始化命令 INITIALIZE FOR PURCHASE, 读取命令中的数据并保存; 在本实施例中, 消费初始化命令 INITIALIZE FOR PURCHASE用于初始 化消费交易;
INITIALIZE FOR PURCHASE命令 4艮文分成: 命令头 + 命令体 即为: (CLA + INS + P 1 + P2) + (Lc + Data + Le); 其中, CLA + INS + P1 + P2为命令头, Lc + Data + Le为命令体, 命令头 为命令的编码, 命令头中的 CLA为指令类别, INS为指令代码, P1和 P2为指 令参数; 命令体中的 Lc为命令体内 Data中数据的长度, Data为 INITIALIZE FOR PURCHASE命令中的数据, Le是期望的应答 APDU数据字段的最大字节 数; 并且 INITIALIZE FOR PURCHASE命令中的数据具体为密钥索引号、 交 易金额和终端机编号; 具体地, 在本实施例中, 接收到的 INITIALIZE FOR PURCHASE命令具 体为: 80 50 01 02 0B 02 00 00 00 C8 00 00 00 00 00 01 0F, 其中 80为 CLA, 50 为 INS , 01为 P1 , 02为 P2, 定义为电子 4 包的标识, 0B为 Lc, 02为 Data 中的密钥索引号, 00 00 00 C8为 Data中的交易金额, 00 00 00 00 00 01为 Data 中的终端机编号, 0F为 Le。 步骤 202:检查自身是否支持上述 INITIALIZE FOR PURCHASE命令中包 含的密钥索引号, 若不支持, 则执行步骤 203 , 若支持, 则执行步骤 204; 步骤 203 : 返回状态码 0x9403给终端, 并终止执行消费初始化操作; 步骤 204: 读取电子 4 包的余额, 判断 INITIALIZE FOR PURCHASE命令 中包含的交易金额是否超过电子钱包的余额与透支限额的和, 若是, 则执行步 骤 205 , 若否, 则执行步骤 206; 步骤 205 : 返回状态码 0x9401给终端, 并终止执行消费初始化操作; 步骤 206: 生成一个伪随机数和一个过程密钥; 在本实施例中, 过程密钥用于 CPU电子钱包或 Ml电子钱包的消费交易, 过程密钥是用密钥 DPK分散得到的。 步骤 207: 发送 INITIALIZE FOR PURCHASE命令的响应 4艮文给终端; 其中, INITIALIZE FOR PURCHASE响应 4艮文由 Data + swl + sw2组成, 当 INITIALIZE FOR PURCHASE命令执行成功时, 则返回的响应 4艮文中的状 态码 swl和 sw2为' 9000' , 且响应 4艮文数据域 Data中包含的数据具体为电子 钱包的余额、 CPU电子钱包的脱机交易序号、 透支限额、 密钥版本号、 算法标 识和伪随机数, 若命令执行不成功, 则返回的响应报文中只含有状态码 swl和 sw2, 且状态码 swl和 sw2不为' 9000,; 具体地, 本实施例中返回给终端的 INITIALIZE FOR PURCHASE响应 4艮 文为: 00 00 4B 00 00 01 00 00 64 02 03 01 02 03 04 90 00 。 步骤 208: 接收终端发送的消费命令 DEBIT FOR PURCHASE, 读取命令 中的数据并保存; 在本实施例中, DEBIT FOR PURCHASE命令用于进行消费操作; 其中, DEBIT FOR PURCHASE命令 4艮文也由 CLA + INS + P1 + P2 + Lc + Data + Le组成, DEBIT FOR PURCHASE命令中的数据具体为:终端交易序号、 交易日期、 交易时间和第三鉴别码 MAC3; 具体地, 在本实施例中, 接收到的 DEBIT FOR PURCHASE命令具体为: 80 54 01 00 0F 00 00 00 01 7D AO 06 09 OF 27 13 01 OA Dl 0C 08, 其中 80为 CLA, 54为 INS , 01为 PI , 00为 P2, OF为 Lc, 00 00 00 01为 Data中的终 端交易序号, 7D AO 06 09为 Data中的交易日期, OF 27 13为 Data中的交易时 间, 01 OA Dl 0C为 Data中的 MAC3 , 08为 Le。 步骤 209:使用步骤 205中生成的过程密钥来 -险证 DEBIT FOR PURCHASE 命令中包含的 MAC3是否有效, 若无效, 则执行步骤 210, 若有效, 则执行步 骤 211; 在本实施例中, -险证 DEBIT FOR PURCHASE命令中包含的 MAC3是否 有效的方法, 具体为: 将交易金额、 交易类型标识、 终端机编号、 终端的交易日期和终端的交易 时间顺序链接, 用步骤 206中生成的过程密钥对链接得到的数据进行加密, 再 比较得到的力。密后的数据的前四个字节与 DEBIT FOR PURCHASE命令中包含 的 MAC3是否 目同, 若不 目同, 则 MAC3无效, 若 4目同, 则 MAC3有效。 步骤 210: 返回状态码 0x9302给终端, 终止操作; 步骤 211 : 将电子钱包的脱机交易序号加 1 , 从电子钱包的余额中扣减计 算得到的金额; 在本实施例中, 若当交易金额为 200元, 电子钱包中的余额为 1200元时, 则从电子 4 包的余额 1200中扣减掉金额 200元后, 得到新的余额为 1000元。 步 4聚 212: 更新电子 4 包的交易明细; 在本实施例中, 需要更新的电子钱包的相关交易明细具体为: 交易金额、 交易类型标识、 终端编号、 交易日期和交易时间, 具体地, CPU卡将交易金额、 交易类型标识、 终端编号、 交易日期和交易时间顺序链接组成一个记录以便更 新。 步骤 213 : 生成第四报文鉴别码 MAC4, 然后计算交易验证码 TAC码; 在本实施例中, 生成第四 4艮文鉴别码 MAC4方法具体为: 用步骤 206中生成的过程密钥对交易金额进行加密, 得到的加密后的数据 的前四个字节即为第四 艮文鉴别码 MAC4。 其中, 利用异或运算得到的结果来计算 TAC码的方法具体为: 用 DTK左右 8个字节进行异或运算, 并将交易金额、 交易类型标识、 终 端机编号、 终端交易序号、 终端的交易日期和终端的交易时间顺序链接, 并用 异或运算得到的结果对链接得到的数据进行加密, 得到的加密后的数据的前四 个字节即为 TAC码。 步骤 214: 返回 DEBIT FOR PURCHASE命令的响应 4艮文给终端, 交易结 束。 其中, DEBIT FOR PURCHASE命令的响应 4艮文由 data + swl + sw2组成, 当 DEBIT FOR PURCHASE命令执行成功时, 则响应 4艮文中的状态码 swl和 sw2为' 9000,, 相应地, 数据 i或 data具体为 TAC码和 MAC4, 当 DEBIT FOR PURCHASE 命令执行不成功时, 则响应 4艮文中的状态码 swl 和 sw2 不为 '9000' , 且不包含数据域; 具体地,本实施例中 DEBIT FOR PURCHASE命令的响应 4艮文为: 01 0D B1 09 00 02 EA B1 90 00。 本实施例提供了一种对 CPU 卡内的电子钱包进行复合圏存的方法, 该方 法可以使整个复合圏存的过程更安全, 防止釆取非法的手段去^ ί'爹改 CPU 卡中 特定的复合应用专用文件, 并且该方法中通过对复合应用专用文件中写入新的 数据,简化了分级打折优惠业务的实现,只需充值时设定充值金额对应的费率即 可, 更方便管理, 会员享受的优惠只跟充值金额挂钩, 多充多优惠,从而节省了 管理的成本。 实施例 2 为了简化了分级打折优惠操作, 便于对消费金额自动进行处理, 本发明实 施例提供了一种对电子钱包进行消费的方法, 参见图 4, 该方法内容包括: 401 : CPU卡进入终端的非接触式感应区内, 所述 CPU卡上电并初始化;
402:等待接收所述终端发送的命令;
403:当接收所述终端发送的消费初始化命令时, 读取所述消费初始化命令 中的数据并保存, 其中所述数据中包括交易金额;
404:按照预先约定的算法对所述交易金额和复合应用专用文件中的相应记 录中的值进行运算, 得到新金额;
405:读取所述电子 4 包的余额, 判断所述新金额是否超过所述电子 4 包的 余额与透支限额的和; 若是, 则向所述终端返回所述电子钱包余额不足的信息, 终止操作; 若否, 则生成一个伪随机数和一个过程密钥, 将所述消费初始化命令的响 应 4艮文返回给所述终端;
406:接收所述终端发送的消费命令, 读取所述消费命令中的数据并保存; 407:从所述电子 4 包的余额中扣减所述新金额, 得到新的余额, 并将所述 消费命令的响应 ^艮文返回给所述终端。 为了对本发明实施例提供的方法进行详细说明, 请参见如下实施例: 实施例 本发明实施例提供了一种对电子钱包进行消费的方法, 在本实施例中,
CPU卡内的电子钱包除了具有支持复合应用的钱包的所有交易功能外,还支持 复合圏存和消费的功能, 并且对 CPU卡内电子钱包的复合圏存操作是在 CPU 终端进行的, 本实施例中进行复合圏存操作时, 将交易金额直接加到电子钱包 的余额上, 相应地, 在消费时, 则按照预先约定的算法对交易金额和复合专用 文件的相应记录中的值进行运算, 得到新金额, 再从电子 4 包的余额中扣减得 到的新金额, 得到电子钱包的新余额, 完成消费操作。 参见图 5 , —种对电子钱包进行消费的方法, 具体实现步骤如下: 步骤 501 : CPU卡进入终端的非接触式感应区内, CPU卡上电并初始化; 步骤 502: 等待接收终端发送的应用命令, 当接收到复合圏存初始化命令 INITIALIZE FOR CAPP LOAD时, 执行步骤 503 , 当接收到消费初始化命令 INITIALIZE FOR PURCHASE, 执行步骤 526; 步骤 503 : 读取复合圏存初始化命令 INITIALIZE FOR CAPP LOAD中包 含的数据并保存; 在本实施例中, 复合圏存初始化命令 INITIALIZE FOR CAPP LOAD用于 初始化复合圏存交易, 并且 INITIALIZE FOR CAPP LOAD命令的 4艮文分成: 命令头 + 命令体,即为:(CLA + INS + P1 + P2) + (Lc + Data + Le),其中, CLA + INS + P1 + P2为命令头, Lc + Data + Le为命令体, 命令头为命令的编码, 命 令头中的 CLA为指令类别, INS为指令代码, P1和 P2为指令参数; 命令体中 的 Lc为命令体内 Data中数据的长度, Data为 INITIALIZE FOR CAPP LOAD 命令中的数据, Le是期望的应答 APDU数据字段的最大字节数; 并且 INITIALIZE FOR CAPP LOAD命令的 Data中保存的数据具体为密钥 索引号、 交易金额和终端机编号; 具体地, 在本实施例中, 接收到的 INITIALIZE FOR CAPP LOAD命令具 体为: 80 50 06 02 0B 02 00 00 03 E8 00 00 00 00 00 01 10, 其中 80为 CLA, 50 为 INS , 06为 PI , 定义为复合圏存初始化的标识, 02为 P2, 定义为电子 4 包 的标识, 0B为 Lc, 02为 Data中的密钥索引号, 00 00 03 E8为 Data中的交易 金额, 00 00 00 00 00 01为 Data中的终端机编号, 10为 Le。 步骤 504: 检查自身是否支持 INITIALIZE FOR CAPP LOAD命令中包含 的密钥索引号, 若不支持, 则执行步骤 505 , 若支持, 则执行步骤 506; 步骤 505 : 向终端返回状态码 0x9403 , 同时终止执行复合圏存初始化操作; 步 4聚 506: 生成一个四字节的伪随机数和一个过程密钥; 在本实施例中, 生成过程密钥的方法具体为: 将上述伪随机数、 电子钱包联机交易序号和' 8000'顺序链接, 再利用圏存 子密钥 DLK对链接后得到的数据进行加密, 得到的加密后的数据即为过程密 钥。 步骤 507: 利用上述过程密钥计算得到第一 4艮文鉴别码 MAC1; 在本实施例中,利用过程密钥计算得到第一 4艮文鉴别码 MAC 1的方法具体 为: 将交易前的电子 4 包的余额、 交易金额、 交易类型标识和终端机编号顺序 链接, 再利用过程密钥对链接后的数据进行加密, 得到的加密后的数据的前四 个字节即为第一 4艮文鉴别码 MAC 1。 步 4聚 508: 将 INITIALIZE FOR CAPP LOAD命令的响应 4艮文返回给终端; 其中, INITIALIZE FOR CAPP LOAD命令的响应 4艮文由 Data + swl + sw2 组成, 当命令执行成功时, 则响应 4艮文中的状态码 swl和 sw2为' 9000' , 相应 地, 数据域 Data中包含的数据有: 交易前的 CPU电子钱包的余额、 CPU钱包 的联机交易序号、 密钥版本号、 算法标识、 伪随机数和 MAC1 , 当命令执行不 成功时, 则响应 4艮文中的状态码 swl和 sw2不为' 9000' , 并且也不存在数据域 Data; 具体地, 在本实施例中, INITIALIZE FOR CAPP LOAD命令的响应 4艮文 具体为: 00 00 00 00 00 01 02 01 01 02 03 04 00 01 Bl 0A 90 00。 步骤 509: 接收终端发送的更新记录命令 UPDATE RECORD; 在本实施例中, 更新记录命令 UPDATE RECORD用于更新复合应用专用 文件中的相应记录中的数据; 复合应用专用文件由文件头和文件体组成, 文件头具体包括: 2个字节的 FILE ID , 1个字节的 FILE TYPE , 2个字节的 FILE SIZE , 1个字节的 AC1、 1个字节的 AC2和 2个字节的 RFU, 其中当 FILE TYPE为 00时, 表示该文 件为二进制文件, 当 FILE TYPE为 01 时, 表示该文件为定长记录文件, 当 FILE TYPE为 02时, 表示该文件为变长记录文件, 当 FILE TYPE为 03时, 表示该文件为循环文件, 当 FILE TYPE为 05时, 表示该文件为密钥文件, 相 应地, 二进制文件对应的 FILE SIZE为文件大小, 定长记录文件对应的 FILE SIZE为记录条数和记录长度, 变长记录文件对应的 FILE SIZE为记录条数和 记录最大长度,循环文件对应的 FILE SIZE为记录条数和记录长度, 密钥文件 对应的 FILE SIZE为记录条数和记录长度, 并且 AC 1为读文件权限, AC2为 写文件权限; 文件体中为复合应用专用文件的数据; 具体地, 在本实施例中, 复合应用专用文件具体为定长记录文件, 则 FILE
TYPE为 01 , 且 FILE SIZE为记录条数和记录长度, 具体为 OA 10 , 文件体中 的内容为空; 进一步地, UPDATE RECORD命令 4艮文由 CLA + INS + P I + P2 + Lc + Data组成, 其中 P I 和 P2用于指定将哪个文件的第几条记录作为复合应用专 用文件的记录, Lc为 Data中的数据的长度加上 4个字节,本实施例中, UPDATE RECORD命令具体为: 80 DC 03 68 08 00 00 80 00 , 其中, 00为 CLA, DC为 INS , 03为 P I , 04为 P2 , 08为 Lc, 00 00 80 00为 Data; 并且 UPDATE RECORD命令的数据域中即为要写入复合应用专用文件的 相应记录中的新数据, 其中, 由于复合应用专用文件中的每条记录对应的具体 应用可以由发卡方自定义, 数据域中的数据也可以是自定义的, 如在本实施例 中自定义数据域中的数据具体为费率值, 则将该费率值写入复合应用专用文件 中用于写费率值的记录中, 具体地, 在本实施例中具体定义费率值为 80 % ; 相应地, 当定义费率值为 80%时, 更新记录命令中的数据可以不是 80 % , 可以是 125 % , 还可以是 20 % , 或者, 更新记录命令的数据中可以不包括费率 值, 而由 CPU 卡对复合圏存初始化命令中包含的交易金额进行判断, 根据交 易金额生成一个费率值, 将这个生成的费率值写入复合应用专用文件的相应记 录中, 或者, 更新记录命令的数据中包含一个费率值和该费率值的前提条件, 由于本实施例中的复合应用专用文件具体为定长记录文件, 则预先约定该复合 应用专用文件中的每一条记录具体包含一种前提条件下的费率值, 如当消费时 的交易金额大于 200元, 小于 300元时, 费率值为负 20元或者费率值为 90 % , 表示消费时满 200减 20或者满 200打 9折, 或当消费时的交易金额大于 500 元, 小于 600元时, 则费率值为负 100元或者费率值为 80 % , 表示消费时满 500减 100或者满 500打 8折等等, 具体复合应用专用文件中的每一条记录对 应的前提条件可以由发卡方预先定义的, 并且在该种前提条件下的费率值也是 由发卡方自定义的。 步骤 510: 判断 UPDATE RECORD命令中是否存在短文件标识符 SFI域, 若存在, 则执行步骤 511 , 若不存在, 则执行步骤 512; 其中, 判断更新记录命令 UPDATE RECORD中是否存在 SFI域的方法具 体为: 判断 UPDATE RECORD命令中的 P2的高 5位是否全为 0, 若是, 则表 示命令中存在 SFI域, 即 P2的高 5位即是 SFI值, 否则, 表示命令中不存在 SFI域; 具体地, 本实施例中 UPDATE RECORD命令中的 P2为 68, 表示 P2的高 5位为 01101 , 存在 SFI域。 步骤 511 : 查找 CPU卡当前应用下是否存在一个文件的 SFI值与 UPDATE RECORD命令中的 SFI值相同, 若不存在, 则执行步骤 512, 若存在, 则执行 步骤 513; 步骤 512: 向终端返回状态码 0x6A82, 同时终止执行此次复合圏存交易; 步骤 513: 将步骤 511 中查找得到的文件作为复合应用专用文件, 并根据 UPDATE RECORD 命令中指定的记录号在该复合应用专用文件中查找相应的 记录, 若没有找到相应的记录, 则执行步骤 514, 若找到, 则执行步骤 515; 具体地, 在本实施例中, UPDATE RECORD命令中的 PI为 03 , 因此上述 复合应用专用文件中记录号为 03的记录即为需要查找的记录。 步骤 514: 向终端返回状态码 0x6A83 , 同时终止执行此次复合圏存交易; 步骤 515 : 检查 UPDATE RECORD命令中的数据域的长度是否大于步骤 513 中查找得到的记录的指定长度, 若大于, 则执行步骤 516, 若不大于, 则 执行步 4聚 517; 在本实施例中, 由于复合应用专用文件是定长记录文件, 且复合应用专用 文件中的 FILE SIZE为记录条数和记录长度,所以复合应用专用文件中的记录 长度由 FILE SIZE的值决定, 由于本实施例中 UPDATE RECORD命令中 Lc 的值为 08, FILE SIZE的值为 OA 10, 所以命令中的数据域的长度不大于复合 应用专用文件的长度。 步骤 516: 向终端返回状态码 0x6A84, 同时终止执行此次复合圏存交易; 步骤 517: 将 UPDATE RECORD命令中的数据域中的数据写入查找得到 的记录中, 替换该记录中的原有内容; 在本实施例中, 具体将费率值 80 %写入该记录中, 替换该记录中的原有内 容; 由于本实施例中复合应用专用文件中的记录中的原有内容为空, 因此直接 将 UPDATE RECORD命令中的数据 i或中的 00 00 80 00写入复合应用专用文件 中的 ΐ己录号为 03的 ΐ己录中即可; 相应地, 当更新记录命令中的费率值为 125 %时, 则写入复合应用专用文 件的相应记录中的数据具体为 125 % , 当更新记录命令中的费率值为 20 %时, 则写入复合应用专用文件的相应记录中的数据具体为 20 %; 或者, 当更新记录命令的数据中可以不包括费率值, 而由 CPU 卡对复合 圏存初始化命令中包含的交易金额进行判断, 按照预先约定的规则根据交易金 额生成一个费率值, 再将这个生成的费率值写入复合应用专用文件的相应记录 中, 例如, 当复合圏存初始化命令中的交易金额为 800元时, 即小于预先约定 的下限时, 具体如为 2000时, 则生成一个数据 95 % , 或者 105 % , 或者 5 % , 因此将 95 %或者 105 %或者 5 %写入复合应用专用文件的相应记录中, 而当复 合圏存初始化命令中的交易金额为 5000 元时, 即在预先约定的下限与上限之 间日寸, 具体^口为 2000 JiJ 6000日寸, M生成一个数据 80 %或者 125 %或者 20 % , 因此将 80 %或者 125 %或者 20 %写入复合应用专用文件的相应记录中,或者当 复合圏存初始化命令中的交易金额为 8000元时,则生成一个数据 75 %或者 133 %或者 25 % , 即大于预先约定的下限时, 具体如为 6000时, 因此将 75 %或者 133 %或者 25 %写入复合应用专用文件的相应记录中; 或者, 当复合应用专用文件中的每条记录对应的是不同前提下的费率值 时, 则将更新记录命令的数据中包含的费率值和该费率值的前提条件写入相应 的记录中, 如将费率值负 20元或者 90 %以及该费率值的前提条件消费时的交 易金额大于 200元, 小于 300元写入相应的 ΐ己录中, 或者将费率值负 100元或 者 80 %以及该费率值的前提条件消费时的交易金额大于 500元,小于 600元写 入相应的记录中等等。 步骤 518: 将 UPDATE RECORD命令的响应 4艮文返回给终端; 其中, UPDATE RECORD命令的响应 4艮文由 swl + sw2组成, 不存在数据 域 data, 当命令执行成功时, 则返回的响应 4艮文为 '9000' , 当命令执行不成功 时, 则返回的响应 4艮文不为' 9000,, 具体本实施例中返回的响应 4艮文为 90 00。 步骤 519: 接收终端发送的复合圏存命令 CREDIT FOR CAPP LOAD, 读 取命令数据域中的数据并保存; 在本实施例中, 复合圏存命令 CREDIT FOR CAPP LOAD用于复合圏存交 易; CREDIT FOR CAPP LOAD命令 4艮文由 CLA + INS + P1 + P2 + Lc + Data +
Le组成, 其中 Data中的数据具体包括: 交易日期、 交易时间和第二报文鉴别 码 MAC2; 具体地, 本实施例中接收到的 CREDIT FOR CAPP LOAD命令具体为: 80 52 00 00 0B 07 DA 06 08 OA 14 2D 00 01 Al 0B 08,其中, 80为 CLA, 52为 INS , 00为 PI , 00为 P2, 0B为 Lc, 07 DA 06 08为 Data中的交易日期, OA 14 2D 为 Data中的交易时间, 00 01 Al 0B为 Data中的 MAC2, 08为 Le。 步骤 520: 验证数据中的第二报文鉴别码 MAC2是否有效, 若无效, 则执 行步 4聚 521 , 若有效, 则执行步 4聚 522; 在本实施例中, -险证 MAC2是否有效的方法, 具体为: 将交易金额、 交易类型标识、 终端机编号、 交易日期和交易时间顺序链接, 然后使用步骤 506中生成的过程密钥对链接得到的数据进行加密, 再比较加密 后得到的数据的前四个字节与 CREDIT FOR CAPP LOAD 命令数据域中的 MAC2是否相同, 若不相同, 则 MAC2无效, 若相同, 则 MAC2有效。 步骤 521 : 向终端返回状态码 0x9302, 提示 MAC2无效; 步骤 522: 将电子钱包的联机交易序号加 1 , 将交易金额直接加到电子钱 包的余额上; 在本实施例中, 当交易金额为 1000元, 电子钱包的余额为 0元时, 则将 交易金额 1000元加到电子 4 包的余额上, 得到新的余额 1000元。 步骤 523: 更新电子 4 包的交易明细; 具体地为: 将电子钱包的联机交易序号、 交易金额、 交易类型标识、 终端 机编号、 交易日期和交易时间顺序链接组成一个记录来更新标准交易明细; 步骤 524: 计算交易验证码 TAC; 在本实施例中, 计算交易验证码 TAC码, 具体为: 用内部密钥 DTK左右 8个字节进行异或运算, 并将交易后的电子钱包的 余额、 加 1前的电子钱包的联机交易序号、 交易金额、 交易类型标识、 终端机 编号、 交易日期和交易时间顺序链接, 再利用异或运算得到的结果对链接得到 的数据进行加密, 得到的加密后的数据即为 TAC码。 步骤 525: 将 CREDIT FOR CAPP LOAD命令的响应 4艮文返回给终端; 其中, CREDIT FOR CAPP LOAD命令的响应 4艮文由 data + swl + sw2组 成, 当命令执行成功时, 则返回的响应 4艮文中的状态码 swl和 sw2为 '9000' , 相应地, 响应报文的数据域中的数据具体为 TAC 码, 当命令执行不成功时, 则返回的响应 4艮文中的状态码 swl和 sw2不为' 9000,, 响应 4艮文中不存在数据 域 ^ 具体地, 在本实施例中返回的 CREDIT FOR CAPP LOAD命令的响应 4艮文 为 00 05 D2 BC 90 00。 步骤 526:读取消费初始化命令 INITIALIZE FOR PURCHASE中的数据并 保存; 在本实施例中, 消费初始化命令 INITIALIZE FOR PURCHASE用于初始 化消费交易, INITIALIZE FOR PURCHASE命令 4艮文由 CLA + INS + PI + P2 +Lc + Data + Le组成, 其中 Data中的数据具体为密钥索引号、 交易金额和终端 机编号; 具体地, 在本实施例中, 接收到的 INITIALIZE FOR PURCHASE命令具 体为: 80 50 01 02 0B 02 00 00 00 C8 00 00 00 00 00 01 OF, 其中 80为 CLA, 50 为 INS , 01为 P1 , 02为 P2, 定义为电子 4 包的标识, 0B为 Lc, 02为 Data 中的密钥索引号, 00 00 00 C8为 Data中的交易金额, 00 00 00 00 00 01为 Data 中的终端机编号, OF为 Le。 步骤 527:检查自身是否支持上述 INITIALIZE FOR PURCHASE命令中包 含的密钥索引号, 若不支持, 则执行步骤 528, 若支持, 则执行步骤 529; 步骤 528: 返回状态码 0x9403给终端, 并终止操作; 步骤 529:按照预先约定的算法对 INITIALIZE FOR PURCHASE命令中包 含的交易金额和复合应用专用文件的相应记录中的值进行运算, 得到新金额; 在本实施例中, 预先约定的算法包括乘法、 除法、 加法和减法, 以及所述 四种算法的各种组合; 进一步地, 复合应用专用文件的记录中的值为费率值, 具体为 80 % , 因此 若当消费时的交易金额为 200元时, 则对交易金额 200元与复合专用文件中的 费率值 80 %进行乘法运算, 得到的新金额为 160元; 而当复合应用专用文件的记录中的费率值为 125 %时, 则对交易金额 200 元与复合专用文件中的费率值 125 %进行除法运算, 得到的新金额为 160元; 而当复合应用专用文件的记录中的费率值为 20 %时,则对交易金额 200元 与复合专用文件中的费率值 20 %进行乘法运算,得到 40元,再对交易金额 200 元与 40元进行减法运算, 得到的新金额为 160元; 或者, 当消费时的交易金额为 550元时, 则该交易金额 550元满足的前提 条件是交易金额大于 500元小于 600元, 因此才艮据该前提条件在相应的记录中 就可以找到相应的费率值, 具体的在相应的记录中自定义费率值为负 100元, 则在消费时, 自动对交易金额 550元与相应记录中的费率值负 100元进行加法 运算, 得到新金额为 450元。 步骤 530: 读取电子钱包的余额, 判断上述新金额是否超过电子钱包的余 额与透支限额的和, 若是, 则执行步骤 531 , 若否, 则执行步骤 532; 步骤 531 : 返回^ I 态码 0x9401给终端, 并终止操作; 步 4聚 532: 生成一个伪随机数和一个过程密钥; 在本实施例中, 过程密钥用于 CPU电子钱包或 Ml电子钱包的消费交易, 过程密钥是用密钥 DPK分散得到的。 步骤 533: 发送 INITIALIZE FOR PURCHASE命令的响应 4艮文给终端; 其中, INITIALIZE FOR PURCHASE响应 4艮文由 Data + swl + sw2组成, 当命令执行成功时,则返回给终端的响应 4艮文中的状态码 swl和 sw2为 '9000' , 且响应报文 Data中包含的数据具体为电子钱包的余额、 CPU电子钱包的脱机 交易序号、 透支限额、 密钥版本号、 算法标识和伪随机数, 若命令执行不成功, 则返回给终端的响应 4艮文中只含有状态码 swl和 sw2, 且状态码 swl和 sw2 不为' 9000,; 具体地, 本实施例中返回给终端的 INITIALIZE FOR PURCHASE响应 4艮 文为: 00 00 4B 00 00 01 00 00 64 02 03 01 02 03 04 90 00。 步骤 534: 接收终端发送的消费命令 DEBIT FOR PURCHASE, 读取命令 中的数据并保存; 在本实施例中, DEBIT FOR PURCHASE命令用于进行消费操作; 其中, DEBIT FOR PURCHASE命令 4艮文也由 CLA + INS + P1 + P2 + Lc + Data + Le组成, Data中的数据具体为: 终端交易序号、 交易日期、 交易时间 和第三鉴别码 MAC3; 具体地, 在本实施例中, 接收到的 DEBIT FOR PURCHASE命令具体为: 80 54 01 00 0F 00 00 00 01 7D AO 06 09 OF 27 13 01 OA Dl 0C 08, 其中 80为 CLA, 54为 INS , 01为 PI , 00为 P2, OF为 Lc, 00 00 00 01为 Data中的终 端交易序号, 7D AO 06 09为 Data中的交易日期, OF 27 13为 Data中的交易时 间, 01 OA Dl 0C为 Data中的 MAC3 , 08为 Le。 步骤 535:使用步骤 532中生成的过程密钥来 -险证 DEBIT FOR PURCHASE 命令中包含的 MAC3是否有效, 若无效, 则执行步骤 536, 若有效, 则执行步 骤 537; 在本实施例中, -险证 DEBIT FOR PURCHASE命令中包含的 MAC3是否 有效的方法, 具体为: 将交易金额、 交易类型标识、 终端机编号、 终端的交易日期和终端的交易 时间顺序链接, 用步骤 532中生成的过程密钥对链接得到的数据进行加密, 再 比较得到的力。密后的数据的前四个字节与 DEBIT FOR PURCHASE命令中包含 的 MAC3是否 目同, 若不 目同, 则 MAC3无效, 若 4目同, 则 MAC3有效。 步骤 536: 返回状态码 0x9302给终端, 终止操作; 步骤 537: 将电子钱包的脱机交易序号加 1 , 并从电子钱包的余额中扣减 步骤 529中得到的新金额; 步骤 538: 更新电子 4 包的交易明细; 在本实施例中, 需要更新的电子钱包的相关交易明细具体为: 交易金额、 交易类型标识、 终端编号、 交易日期和交易时间, 具体地, CPU卡将交易金额、 交易类型标识、 终端编号、 交易日期和交易时间顺序链接组成一个记录以便更 新。 步骤 539: 生成第四报文鉴别码 MAC4, 然后计算交易验证码 TAC码; 在本实施例中, 生成第四 4艮文鉴别码 MAC4方法具体为: 用步骤 532中生成的过程密钥对交易金额进行加密, 得到的加密后的数据 的前四个字节即为第四 艮文鉴别码 MAC4。 其中, 利用异或运算得到的结果来计算 TAC码的方法具体为: 用 DTK左右 8个字节进行异或运算, 并将交易金额、 交易类型标识、 终 端机编号、 终端交易序号、 终端的交易日期和终端的交易时间顺序链接, 并用 异或运算得到的结果对链接得到的数据进行加密, 得到的加密后的数据的前四 个字节即为 TAC码。 步骤 540: 返回 DEBIT FOR PURCHASE命令的响应 4艮文给终端, 交易结 束。 其中, DEBIT FOR PURCHASE命令的响应 4艮文由 data + swl + sw2组成, 当命令执行成功时, 则响应 4艮文中的状态码 swl和 sw2为' 9000' , 相应地, 数 据域 data具体为 TAC码和 MAC4, 当命令执行不成功时, 则响应 4艮文中的状 态码 swl和 sw2不为' 9000' , 且不包含数据域; 具体地,本实施例中 DEBIT FOR PURCHASE命令的响应 4艮文为: 01 0D B 1 09 00 02 EA B 1 90 00。 进一步地, 在本实施例中, 当复合应用专用文件为二进制文件时, 因此 CPU 卡接收到的对复合应用专用文件进行更新的命令就不是更新记录命令 UPDATE RECORD, 而是 UPDATE CAPP DATA CACHE命令, 其中 CPU卡接 收到 UPDATE CAPP DATA CACHE命令之后的具体操作如下: 步骤 509,: 接收终端发送的更新复合应用专用文件的命令 UPDATE CAPP DATA CACHE; 在本实施例中, 更新复合应用专用文件的命令 UPDATE CAPP DATA
CACHE用于更新复合应用专利文件中的数据; 具体地, UPDATE CAPP DATA CACHE命令 4艮文由 CLA + INS + P1 + P2 + Lc + Data组成,本实施例中, UPDATE CAPP DATA CACHE命令具体为: 80 D6 92 B l 04 00 01 20 00, 其中, 80为 CLA, D6为 INS , 92为 P I , B 1为 P2 , 04 为 Ix, 00 01 20 00 ^ Data; 并且 UPDATE CAPP DATA CACHE命令的数据域 Data中的数据为要写入 复合应用专用文件的新数据, 其中, 由于复合应用专用文件的具体应用可以由 发卡方自定义, 因此数据域中的数据也可以是自定义的, 如在本实施例中复合 应用专用文件可以自定义为费率文件, 则相应地, 数据域中的数据具体为费率 值, 在本实施例中具体定义费率值为 120 % ; 具体地, 在本实施例中, 复合应用专用文件具体为二进制文件, 则 FILE TYPE为 00 ,且 FILE SIZE为文件大小,具体为 00 0B ,文件体中的内容为空。 步骤 510,: 判断接收到的 UPDATE CAPP DATA CACHE命令中是否存在 SFI域, 若存在, 则执行步骤 511,, 若不存在, 则执行步骤 512,; 在本实施例中, 判断 UPDATE CAPP DATA CACHE命令中是否存在 SFI i或具体为: 判断 UPDATE CAPP DATA CACHE命令中的 PI的高三位是否为 100, 若是, 则表示命令中存在 SFI域, PI的低 5位即为 SFI域, 否则, 表示 命令中不存在 SFI i或; 具体地, 本实施例中 UPDATE CAPP DATA CACHE命令中的 PI为 92, 表 示 P1的高三位为 100, 存在 SFI i或。 步骤 511,:查找 CPU卡当前应用下是否存在一个文件的 SFI值与 UPDATE CAPP DATA CACHE命令中的 SFI值相同, 若不存在, 则执行步骤 512' , 若存 在, 则执行步 4聚 513,; 步骤 512,: 向终端返回状态码 0x6A82, 同时终止执行此次复合圏存交易; 步骤 513' : 将步骤 51 Γ中查找得到的文件作为复合应用专用文件, 并检查 UPDATE CAPP DATA CACHE命令中的数据域的长度是否大于复合应用专用 文件的长度, 若大于, 则执行步骤 514,, 若不大于, 则执行步骤 515,; 在本实施例中, 由于复合应用专用文件是二进制文件, 所以复合应用专用 文件的长度具体为 FILE SIZE 的值, 具体即为判断 UPDATE CAPP DATA CACHE命令中 Lc的值是否大于复合应用专用文件 FILE SIZE的值, 由于本 实施例中 UPDATE CAPP DATA CACHE命令中 Lc的值为 04, FILE SIZE的 值为 00 OB , 所以命令中的数据域的长度不大于复合应用专用文件的长度。 步骤 514,: 向终端返回状态码 0x6A84, 同时终止执行此次复合圏存交易; 步骤 515' : 将 UPDATE CAPP DATA CACHE命令中的数据域中的数据写 入复合应用专用文件中, 替换该复合应用专用文件中的原有内容; 在本实施例中, 具体将费率值 120 %写入该复合应用专用文件中, 替换其 原有内容; 由于本实施例中复合应用专用文件中的原有内容为空, 因此直接将 UPDATE CAPP DATA CACHE命令中的数据 i或中的 00 01 20 00写入复合应用 专用文件中即可。 步骤 516,: 将 UPDATE CAPP DATA CACHE命令的响应 4艮文返回给终端; 其中, UPDATE CAPP DATA CACHE命令的响应 4艮文由 swl + sw2组成, 不存在数据域 data, 当 UPDATE CAPP DATA CACHE命令执行成功时, 则响 应 4艮文为 '9000,, 当 UPDATE CAPP DATA CACHE命令执行不成功时, 则响应 4艮文不为' 9000'。 本实施例提供了一种对 CPU 卡内的电子钱包进行消费的方法, 该方法可 以使整个复合圏存的过程更安全, 防止釆取非法的手段去^ ί'爹改 CPU 卡中特定 的复合应用专用文件, 并且该方法中通过对复合应用专用文件中写入新的数 据, 简化了分级打折优惠业务的实现,在消费时自动对消费的金额进行处理, 更 方便管理, 从而节省了管理的成本。 以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于 此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应 所述以权利要求的保护范围为准。

Claims

权 利 要 求 书
1. 一种对电子钱包进行操作的方法, 其特征在于, 所述方法包括:
CPU卡进入终端的非接触式感应区内, 所述 CPU卡上电并初始化; 接收所述终端发送的操作初始化命令, 读取所述操作初始化命令中 的数据并保存, 所述数据包括交易金额, 所述操作初始化命令为复合圏 存初始化命令或消费初始化命令;
如果所述操作初始化命令为复合圏存初始化命令, 则进行复合圏存 初始化操作; 接收所述终端发送的更新复合应用专用文件命令, 查找复 合应用专用文件; 将预先约定的数据写入所述复合应用专用文件的存储 空间中, 替换原有内容; 接收所述终端发送的复合圏存命令, 读取所述 复合圏存命令中的数据并保存; 按照预先约定的算法对所述交易金额与 所述复合应用专用文件中的数据进行运算, 得到新金额, 将所述得到新 金额加到电子钱包的余额上, 得到新余额;
如果所述操作初始化命令为消费初始化命令, 按照预先约定的算法 对所述交易金额和复合应用专用文件中的相应记录中的值进行计算, 得 到新金额; 读取所述电子钱包的余额, 判断所述新金额是否超过所述电 子 4 包的余额与透支限额的和; 若是, 则向所述终端返回所述电子 4 包 余额不足的信息, 终止操作; 若否, 则生成一个伪随机数和一个过程密 钥, 将所述消费初始化命令的响应报文返回给所述终端; 接收所述终端 发送的消费命令, 读取所述消费命令终的数据并保存; 从所述电子钱包 的余额中扣减所述新金额, 得到新的金额, 并将所述消费命令的响应报 文返回给所述终端。
2. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令中的数据还包括: 密钥索引号和终端机编号。
3. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述预 先约定的算法包括乘法、 除法、 加法和减法, 以及所述四种算法的各种 组合。
4. 如权利要求 2所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述按照预先约定的算法对所述交 易金额和复合应用专用文件中的相应记录中的值进行运算之前, 所述方 法还包括:
所述 CPU卡检查自身是否支持所述密钥索引号;
若不支持, 则向终端返回 CPU卡不支持所述密钥索引号的信息, 终 止操作;
若支持, 则按照预先约定的算法对所述交易金额和复合应用专用文 件中的相应记录中的值进行运算。 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述消费命令中的数据包括: 终端 交易号, 交易日期, 交易时间和第三鉴别码。 如权利要求 5所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述从所述电子钱包的余额中扣减 所述新金额之前, 所述方法还包括:
验证所述第三鉴别码是否有效;
若无效, 则向终端返回第三鉴别码无效 的信息, 终 止操作; 若有效, 则将所述电子 4 包的脱机交易序号加 1 , 从所述电子 4 包 的余额中扣减所述新金额。 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述从电子钱包的余额中扣减所述 新金额, 得到新的余额之后, 所述方法还包括:
更新所述电子钱包的交易明细;
生成第四报文鉴别码和验证码。 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述等待接收终端发送的命令的同 时, 所述方法还包括:
接收所述终端发送的复合圏存初始化命令时, 读取所述复合圏存初 始化命令中的数据并保存, 进行复合圏存初始化操作;
接收所述终端发送的更新记录命令, 更新复合应用专用文件中的相 应记录中的数据; 接收所述终端发送的复合圏存命令, 进行复合圏存操作。
9. 如权利要求 8所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述更新复合应用专用文件中的相 应记录中的数据的步骤为:
查找所述复合应用专用文件中的相应 ΐ己录;
判断所述更新记录命令中的数据的长度是否大于所述查找得到的记 录的长度;
若是, 则向所述终端返回所述记录存储空间不够的信息, 终止操作; 若否, 则更新所述查找得到的记录中的数据。
10. 如权利要求 9所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述查找复合应用专用文件中的相 应记录的操作为:
判断所述更新记录命令中是否存在短文件标识符;
若不存在所述短文件标识符, 则向所述终端返回未找到复合应用专 用文件的信息, 终止操作;
若存在所述短文件标识符, 则检查是否存在一个文件的短文件 标识符的值与所述短文件标识符的值相同, 若不存在, 则向所述终 端返回未找到复合应用专用文件的信息, 终止操作, 若存在, 则将 所述检查到的文件作为复合应用专用文件, 并才艮据所述更新记录命 令中指定的记录号在所述复合应用专用文件中查找相应的记录; 若没有查找到, 则向终端返回未找到相应记录的信息, 终止操作;
若查找到, 则将查找到的记录作为需要更新的记录。
11. 如权利要求 9所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为消费初始化命令时, 所述更新查找得到的记录中的数据 的方法包括:
将所述更新记录命令中的数据写入所述查找得到的记录中, 替换原 有内容;
或者, 根据预先约定的规则对所述复合圏存初始化命令中包含的交易金额 进行判断, 并 居判断结果生成一个数据, 将所述生成的数据写入所述 查找得到的记录中, 替换原有内容。
12. 如权利要求 2所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述复合圏存初始化操作为: 所述 CPU卡检查自身是否支持所述密钥索引号;
若不支持,则向所述终端返回所述 CPU卡不支持所述密钥索引号的 信息, 终止操作;
若支持, 则生成一个伪随机数和一个过程密钥, 并用所述过程密钥 计算得到第一报文鉴别码;
将复合圏存初始化命令的响应 4艮文返回给所述终端。
13. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述查找复合应用专用文件的 操作为:
判断所述更新复合应用专用文件命令中是否存在短文件标识符; 若不存在, 则将当前文件作为复合应用专用文件;
若存在, 则检查当前应用下的文件中是否存在一个文件的短文件标 识符的值与所述短文件标识符相同;
若否, 则向终端返回未找到复合应用专用文件的信息, 终止操作; 若是, 则将得到的文件作为复合应用专用文件。
14. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述将预先约定的数据包括: 所述更新复合应用专用文件命令中包含的数据, 或者, 才艮据所述复 合圏存初始化命令中包含的交易金额生成的数据。
15. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述将预先约定的数据写入所 述复合应用专用文件的存储空间中之前, 所述方法还包括:
判断所述预先约定的数据的长度是否大于所述复合应用专用文件的 存储空间的大小; 若是, 向所述终端返回所述复合应用专用文件的存储空间不够的信 息, 终止操作; 若否, 将将预先约定的数据写入所述复合应用专用文件的存储空间 中。
16. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述将预先约定的数据写入所 述复合应用专用文件的存储空间中, 替换原有内容之后, 所述方法还包 括:
将更新复合应用专用文件命令的响应报文返回给所述终端。
17. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述复合圏存命令中的数据包 括: 交易日期、 交易时间和第二报文鉴别码;
所述按照预先约定的算法对所述交易金额与所述复合应用专用文件 中的数据进行运算之前, 所述方法还包括:
验证所述第二报文鉴别码是否有效;
若无效, 则向所述终端返回第二艮文鉴别码无效的信息, 终止操作; 若有效, 则将所述电子钱包的联机交易序号加 1 , 并按照预先约定 的算法对所述交易金额与所述复合应用专用文件中的数据进行运算。
18. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述将得到的新金额加到电子 钱包的余额上, 得到新余额之后, 所述方法还包括:
更新所述电子钱包的交易明细; 计算交易验证码;
将所述复合圏存命令的响应 4艮文返回给所述终端。
19. 如权利要求 1所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述更新复合应用专用文件命 令还为: 更新记录命令;
所述查找复合应用专用文件的操作还具体为: 查找复合应用专用文 件, 并查找所述复合应用专用文件中的相应记录。 如权利要求 19所述的对电子钱包进行操作的方法, 其特征在于, 所述操 作初始化命令为复合圏存初始化命令时, 所述查找复合应用专用文件, 并查找所述复合应用专用文件中的相应记录的方法为:
判断所述更新记录命令中是否存在短文件标识符;
若不存在, 则向所述终端返回未找到复合应用专用文件的信息, 终 止操作;
若存在, 则检查当前应用下的文件中是否存在一个文件的短文件标 识符的值与所述短文件标识符相同;
若否, 则向终端返回未找到复合应用专用文件的信息, 终止操作; 若是, 则将得到的文件作为复合应用专用文件, 并根据所述更新记 录命令中指定的记录号在所述复合应用专用文件中查找相应的记录; 若没有查找到, 则向终端返回未找到需要更新的记录的信息, 终止 操作;
若查找到, 则将查找得到的记录作为需要更新的记录。
PCT/CN2011/076590 2010-06-29 2011-06-29 一种对电子钱包进行操作的方法 WO2012000438A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/519,187 US10878404B2 (en) 2010-06-29 2011-06-29 Method for operating an e-purse

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201010214132.6 2010-06-29
CN201010213920.3 2010-06-29
CN 201010213920 CN102044114B (zh) 2010-06-29 2010-06-29 一种对电子钱包进行消费的方法
CN2010102141326A CN102013132B (zh) 2010-06-29 2010-06-29 一种对电子钱包进行复合圈存的方法

Publications (1)

Publication Number Publication Date
WO2012000438A1 true WO2012000438A1 (zh) 2012-01-05

Family

ID=45401402

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076590 WO2012000438A1 (zh) 2010-06-29 2011-06-29 一种对电子钱包进行操作的方法

Country Status (2)

Country Link
US (1) US10878404B2 (zh)
WO (1) WO2012000438A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326793A (zh) * 2015-06-30 2017-01-11 阿里巴巴集团控股有限公司 信息处理方法及装置
US10600046B2 (en) * 2006-09-24 2020-03-24 Rfcyber Corporation Method and apparatus for mobile payments
US11470179B2 (en) 2019-01-09 2022-10-11 Margo Networks Private Limited Content delivery network system and method
US11695855B2 (en) 2021-05-17 2023-07-04 Margo Networks Pvt. Ltd. User generated pluggable content delivery network (CDN) system and method
US11860982B2 (en) 2022-05-18 2024-01-02 Margo Networks Pvt. Ltd. Peer to peer (P2P) encrypted data transfer/offload system and method
US11930439B2 (en) 2019-01-09 2024-03-12 Margo Networks Private Limited Network control and optimization (NCO) system and method

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013095486A1 (en) 2011-12-22 2013-06-27 Intel Corporation Multi user electronic wallet and management thereof
CN103544037B (zh) * 2013-10-29 2016-08-17 飞天诚信科技股份有限公司 一种支持OpenSC的软硬件驱动的实现方法
CN108681466B (zh) * 2018-03-27 2023-11-07 广东岭南通股份有限公司 一种基于格式化分组指令的cpu卡控制方法、电子设备及存储介质
CN111091379B (zh) * 2019-12-25 2023-04-18 飞天诚信科技股份有限公司 一种对智能卡分段操作的实现方法及***
US11720975B2 (en) * 2020-11-05 2023-08-08 Fmr Llc Systems and methods for multi-purse transaction file splitting
CN115941833A (zh) * 2022-11-21 2023-04-07 深圳市雪球科技有限公司 一种开通交通卡优化的方法、***、设备及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277399A (zh) * 1999-03-19 2000-12-20 城市集团发展中心有限公司 使用点奖励确定的***和方法
CN1700222A (zh) * 2004-09-21 2005-11-23 陈澍 开放性多商户共享会员卡***及其构建方法
CN101281666A (zh) * 2008-05-06 2008-10-08 北京握奇数据***有限公司 一种含Mifare功能模块的智能卡及其数据更新方法
CN101645184A (zh) * 2009-09-10 2010-02-10 北京握奇数据***有限公司 多钱包的扩展、交易初始化的方法和装置
CN101799955A (zh) * 2009-11-20 2010-08-11 北京飞天诚信科技有限公司 一种对双电子钱包进行操作的方法
CN101799954A (zh) * 2009-11-20 2010-08-11 北京飞天诚信科技有限公司 一种对双电子钱包进行圈存的方法
CN102013132A (zh) * 2010-06-29 2011-04-13 北京飞天诚信科技有限公司 一种对电子钱包进行复合圈存的方法
CN102044114A (zh) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 一种对电子钱包进行消费的方法

Family Cites Families (89)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5557518A (en) * 1994-04-28 1996-09-17 Citibank, N.A. Trusted agents for open electronic commerce
NL9401406A (nl) * 1994-08-31 1996-04-01 Nederland Ptt Betaalsysteem met verbeterde integriteit.
US5744787A (en) * 1994-09-25 1998-04-28 Advanced Retail Systems Ltd. System and method for retail
US5596642A (en) * 1994-09-30 1997-01-21 Electronic Payment Services, Inc. Network settlement performed on consolidated information
US6036088A (en) * 1995-03-15 2000-03-14 Hitachi, Ltd Method and apparatus for processing IC card found
DK0826215T3 (da) * 1995-05-09 2001-05-07 Smartmove Nz Ltd Kortgrænseflade
US6076075A (en) * 1995-09-25 2000-06-13 Cardis Enterprise International N.V. Retail unit and a payment unit for serving a customer on a purchase and method for executing the same
JP3366808B2 (ja) * 1996-07-18 2003-01-14 株式会社日立製作所 電子財布
IL119486A0 (en) * 1996-10-24 1997-01-10 Fortress U & T Ltd Apparatus and methods for collecting value
US7020638B1 (en) * 1996-11-18 2006-03-28 Microsoft Corporation System and method for flexible micropayment of low value electronic assets
US7917760B2 (en) * 1997-02-21 2011-03-29 Multos Limited Tamper resistant module having separate control of issuance and content delivery
US6330978B1 (en) * 1997-04-29 2001-12-18 Diebold Incorporated Electronic purse card value system card security method
US6105006A (en) * 1997-12-22 2000-08-15 Motorola Inc Transaction authentication for 1-way wireless financial messaging units
JP3717031B2 (ja) * 1998-06-05 2005-11-16 富士通株式会社 電子マネー装置、方法、カード並びに電子マネー処理プログラムを記録したコンピュータ読取り可能な記録媒体
US7248855B2 (en) * 1998-09-15 2007-07-24 Upaid Systems, Ltd. Convergent communications system and method with a rule set for authorizing, debiting, settling and recharging a mobile commerce account
US6390374B1 (en) * 1999-01-15 2002-05-21 Todd Carper System and method for installing/de-installing an application on a smart card
US7729986B1 (en) * 1999-07-30 2010-06-01 Visa International Service Association Smart card transactions using wireless telecommunications network
WO2001043094A2 (en) * 1999-11-29 2001-06-14 Microsoft Corporation System and method for flexible micropayment of low value electronic assets
AU770158B2 (en) * 2000-01-28 2004-02-12 Visa Cape Town (Pty) Ltd System for conducting commercial transactions
US20100223186A1 (en) * 2000-04-11 2010-09-02 Hogan Edward J Method and System for Conducting Secure Payments
US7523067B1 (en) * 2000-08-02 2009-04-21 Softbankbb Corporation Electronic settlement system, settlement apparatus, and terminal
US7155411B1 (en) * 2000-09-28 2006-12-26 Microsoft Corporation Integrating payment accounts and an electronic wallet
EP1341105A4 (en) * 2000-11-08 2006-10-25 Matsushita Electric Ind Co Ltd PRIVATE ELECTRONIC VALUE BANKING SYSTEM
BR0202291A (pt) * 2001-01-31 2003-06-10 Ntt Docomo Inc Aperfeiçoamento introduzido em método e aparado para a entrega de um programa para o módulo de armazenagem de um terminal móvel
GB2409090B (en) * 2001-04-06 2005-08-17 Freedom Card Ltd Payment system
EP1396805A4 (en) * 2001-06-11 2006-11-08 Sony Corp ELECTRONIC MONEY SYSTEM
FR2827058B1 (fr) * 2001-07-09 2005-05-27 A S K Systeme de caisse electronique pour porte-monnaie electronique
US8082575B2 (en) * 2002-03-28 2011-12-20 Rampart-Id Systems, Inc. System, method and apparatus for enabling transactions using a user enabled programmable magnetic stripe
US7769689B2 (en) * 2003-10-27 2010-08-03 First Data Corporation Methods and systems for processing transactions for integrated credit and stored-value programs
GB0330179D0 (en) * 2003-12-30 2004-02-04 Ecebs Ltd Improved smartcard system
US7882361B2 (en) * 2004-02-05 2011-02-01 Oracle America, Inc. Method and system for accepting a pass code
US11599873B2 (en) * 2010-01-08 2023-03-07 Blackhawk Network, Inc. Systems and methods for proxy card and/or wallet redemption card transactions
US20130054470A1 (en) * 2010-01-08 2013-02-28 Blackhawk Network, Inc. System for Payment via Electronic Wallet
DE602005011529D1 (de) * 2004-06-07 2009-01-22 Proton World Int Nv Programmausführungssteuerung
SG10201404410XA (en) * 2004-06-25 2014-10-30 Ian Charles Ogilvy A transaction processing method, apparatus and system
US20060095732A1 (en) * 2004-08-30 2006-05-04 Tran Thang M Processes, circuits, devices, and systems for scoreboard and other processor improvements
US8234215B2 (en) * 2005-06-24 2012-07-31 Cng Financial Corporation Method for prepaid debit card with overdraft capabilities
US20070168260A1 (en) * 2005-09-30 2007-07-19 Mastercard International Incorporated Payment apparatus and method
JP2007148644A (ja) * 2005-11-25 2007-06-14 Sharp Corp データ記憶装置、icカード及びデータ記憶方法
US7657486B2 (en) * 2005-12-09 2010-02-02 Mastercard International Incorporated Techniques for co-existence of multiple stored value applications on a single payment device managing a shared balance
US8027919B2 (en) * 2006-02-01 2011-09-27 Sean Macguire Method and apparatus for allowing secured overdrafts of reloadable debit card accounts
CN100438409C (zh) * 2006-06-22 2008-11-26 北京飞天诚信科技有限公司 具有金融交易报文处理能力的智能卡及其工作方法
EP1873728B1 (en) * 2006-06-29 2013-11-27 Incard SA Method for configuring an IC Card in order to receive personalization commands
CN100409150C (zh) * 2006-09-07 2008-08-06 北京飞天诚信科技有限公司 一种提高hid设备通讯速度的方法
US7992792B2 (en) * 2006-12-18 2011-08-09 Fundamo (Proprietary) Limited Portable payment device
US8045956B2 (en) * 2007-01-05 2011-10-25 Macronix International Co., Ltd. System and method of managing contactless payment transactions using a mobile communication device as a stored value device
US20090197641A1 (en) * 2008-02-06 2009-08-06 Broadcom Corporation Computing device with handheld and extended computing units
US20080208697A1 (en) * 2007-02-23 2008-08-28 Kargman James B Secure system and method for payment card and data storage and processing via information splitting
US7832634B1 (en) * 2007-03-23 2010-11-16 Sprint Communication Company L.P. Customer care intelligent routing
US8548908B2 (en) * 2007-04-11 2013-10-01 First Data Corporation Mobile commerce infrastructure systems and methods
CN100465992C (zh) * 2007-05-16 2009-03-04 北京飞天诚信科技有限公司 一种非接触式卡及其控制方法
CN100533490C (zh) * 2007-05-29 2009-08-26 北京飞天诚信科技有限公司 通过条件判断来启动智能卡指纹身份识别的方法及装置
US20090063312A1 (en) * 2007-08-28 2009-03-05 Hurst Douglas J Method and System for Processing Secure Wireless Payment Transactions and for Providing a Virtual Terminal for Merchant Processing of Such Transactions
US9311766B2 (en) * 2007-09-12 2016-04-12 Devicefidelity, Inc. Wireless communicating radio frequency signals
US20090069049A1 (en) * 2007-09-12 2009-03-12 Devicefidelity, Inc. Interfacing transaction cards with host devices
CN100565597C (zh) * 2007-11-16 2009-12-02 北京飞天诚信科技有限公司 一种自助充值的***和方法
CA2710868A1 (en) * 2008-01-07 2009-07-16 Security First Corp. Systems and methods for securing data using multi-factor or keyed dispersal
US8151100B2 (en) * 2008-02-06 2012-04-03 Broadcom Corporation Operating system for a computing device with handheld and extended computing units
US8064952B2 (en) * 2008-02-06 2011-11-22 Broadcom Corporation A/V control for a computing device with handheld and extended computing units
US20090198989A1 (en) * 2008-02-06 2009-08-06 Broadcom Corporation Bios for a computing device with handheld and extended computing units
US8117370B2 (en) * 2008-02-06 2012-02-14 Broadcom Corporation IC for handheld computing unit of a computing device
US7895365B2 (en) * 2008-02-06 2011-02-22 Broadcom Corporation File storage for a computing device with handheld and extended computing units
US20100063903A1 (en) * 2008-03-10 2010-03-11 Thayne Whipple Hierarchically applied rules engine ("hare")
AU2009243169B2 (en) * 2008-04-29 2014-06-05 Visa U. S. A. Inc. Authorization system with split messaging
CA2728136C (en) * 2008-05-18 2015-02-10 Google Inc. Secured electronic transaction system
US7797248B1 (en) * 2008-07-11 2010-09-14 Sprint Communications Company L.P. Automated confirmation of transit card fund replenishment
US20100036741A1 (en) * 2008-08-04 2010-02-11 Marc Cleven Application currency code for dynamic currency conversion transactions with contactless consumer transaction payment device
US20100042517A1 (en) * 2008-08-12 2010-02-18 The Westem Union Company Universal loyalty systems and methods
WO2010037204A1 (en) * 2008-10-03 2010-04-08 Consumer Mt Inc. System and method for providing a universal electronic wallet
US20100125510A1 (en) * 2008-11-17 2010-05-20 Smith Steven M System and method of conducting transactions using a mobile wallet system
US20100217835A1 (en) * 2009-02-26 2010-08-26 Broadcom Corporation Dockable handheld computing device with file transfer and methods for use therewith
US8090890B2 (en) * 2009-02-26 2012-01-03 Broadcom Corporation Dockable handheld computing device with video application and methods for use therewith
US7987309B2 (en) * 2009-02-26 2011-07-26 Broadcom Corporation Dockable handheld computing device with graphical user interface and methods for use therewith
US20100299255A1 (en) * 2009-05-21 2010-11-25 Nizam Antoo Cash redemption of funded portable consumer transaction device without purchase transaction requirements
CN101567109B (zh) * 2009-06-03 2012-01-04 普天信息技术研究院有限公司 一种集成支付和收款功能的装置、***和交易方法
US8719165B2 (en) * 2009-07-13 2014-05-06 Empire Technology Development, Llc Delegated transactions over mobile
WO2011060662A1 (zh) * 2009-11-20 2011-05-26 北京飞天诚信科技有限公司 一种对双电子钱包进行圈存的方法
US9218557B2 (en) * 2010-03-02 2015-12-22 Gonow Technologies, Llc Portable e-wallet and universal card
US8321345B2 (en) * 2010-06-02 2012-11-27 Visa International Service Association Trusted internal interface
US20120095852A1 (en) * 2010-10-15 2012-04-19 John Bauer Method and system for electronic wallet access
US9607293B2 (en) * 2010-11-29 2017-03-28 Barclays Bank Plc Method and system for account management and electronic wallet access on a mobile device
US8306916B2 (en) * 2010-11-29 2012-11-06 Barclays Bank Plc Method and system for digital document management on a mobile device
US20120143706A1 (en) * 2010-10-15 2012-06-07 Crake David A Method and System for Improved Electronic Wallet Access
CN102064944B (zh) * 2010-11-30 2013-01-09 飞天诚信科技股份有限公司 一种安全发卡方法、发卡设备和***
US20120259698A1 (en) * 2011-04-11 2012-10-11 Yurow A Pierre Electronic Currency Management System
WO2012162351A1 (en) * 2011-05-23 2012-11-29 Mastercard International, Inc. Combicard transaction method and system having an application parameter update mechanism
US10380585B2 (en) * 2011-06-02 2019-08-13 Visa International Service Association Local usage of electronic tokens in a transaction processing system
US20130191279A1 (en) * 2012-01-20 2013-07-25 Bank Of America Corporation Mobile device with rewritable general purpose card
US8898088B2 (en) * 2012-02-29 2014-11-25 Google Inc. In-card access control and monotonic counters for offline payment processing system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277399A (zh) * 1999-03-19 2000-12-20 城市集团发展中心有限公司 使用点奖励确定的***和方法
CN1700222A (zh) * 2004-09-21 2005-11-23 陈澍 开放性多商户共享会员卡***及其构建方法
CN101281666A (zh) * 2008-05-06 2008-10-08 北京握奇数据***有限公司 一种含Mifare功能模块的智能卡及其数据更新方法
CN101645184A (zh) * 2009-09-10 2010-02-10 北京握奇数据***有限公司 多钱包的扩展、交易初始化的方法和装置
CN101799955A (zh) * 2009-11-20 2010-08-11 北京飞天诚信科技有限公司 一种对双电子钱包进行操作的方法
CN101799954A (zh) * 2009-11-20 2010-08-11 北京飞天诚信科技有限公司 一种对双电子钱包进行圈存的方法
CN102013132A (zh) * 2010-06-29 2011-04-13 北京飞天诚信科技有限公司 一种对电子钱包进行复合圈存的方法
CN102044114A (zh) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 一种对电子钱包进行消费的方法

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10600046B2 (en) * 2006-09-24 2020-03-24 Rfcyber Corporation Method and apparatus for mobile payments
CN106326793A (zh) * 2015-06-30 2017-01-11 阿里巴巴集团控股有限公司 信息处理方法及装置
US11470179B2 (en) 2019-01-09 2022-10-11 Margo Networks Private Limited Content delivery network system and method
US11930439B2 (en) 2019-01-09 2024-03-12 Margo Networks Private Limited Network control and optimization (NCO) system and method
US11695855B2 (en) 2021-05-17 2023-07-04 Margo Networks Pvt. Ltd. User generated pluggable content delivery network (CDN) system and method
US11860982B2 (en) 2022-05-18 2024-01-02 Margo Networks Pvt. Ltd. Peer to peer (P2P) encrypted data transfer/offload system and method

Also Published As

Publication number Publication date
US20120296819A1 (en) 2012-11-22
US10878404B2 (en) 2020-12-29

Similar Documents

Publication Publication Date Title
WO2012000438A1 (zh) 一种对电子钱包进行操作的方法
JP5462420B2 (ja) セキュアなアプリケーションディレクトリ
JP6671333B2 (ja) セキュア要素を用いない支払取引処理
JP6374906B2 (ja) トラックデータ暗号化
US8359630B2 (en) Method and system for implementing a dynamic verification value
JP4597529B2 (ja) 金融取引で使用するための認証の仕組みおよび方法
CN104603809B (zh) 在移动设备上使用虚拟卡促进交易的***和方法
US10147077B2 (en) Financial transaction method and system having an update mechanism
CN100438409C (zh) 具有金融交易报文处理能力的智能卡及其工作方法
BR112014020191A2 (pt) cartões de pagamento descartáveis
CN101799954B (zh) 一种对双电子钱包进行圈存的方法
CN102044114B (zh) 一种对电子钱包进行消费的方法
BRPI0813326B1 (pt) Método para ofuscar um identificador de conta, meio legível por computador, cartão inteligente, método para descriptografar um identificador de conta ofuscado, e, computador servidor
US20100274722A1 (en) Apparatus, method, and computer program product for recovering torn smart payment device transactions
WO2011060662A1 (zh) 一种对双电子钱包进行圈存的方法
BR112012022918A2 (pt) Computador servidor, e, método.
TW200907815A (en) Computer hardware metering
KR20110013187A (ko) 저장장치를 이용한 컨텐츠 또는 서비스 제공 시스템 및 방법, 그 drm서버 및 저장장치, 이를 위한 기록매체
CN102013132B (zh) 一种对电子钱包进行复合圈存的方法
CN101799955B (zh) 一种对双电子钱包进行操作的方法
CN110930156B (zh) 一种基于m1介质的安全提升方法,***以及射频ic卡
TWI667624B (zh) 用以與近接付款裝置實施安全的磁條卡交易的方法與裝置
CN2929835Y (zh) 具有金融交易报文处理能力的智能卡
KR20220084797A (ko) 가상카드번호 생성 스마트카드와 가상카드번호 복호화 장치
TWM502910U (zh) 行動支付設備

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11800183

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13519187

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11800183

Country of ref document: EP

Kind code of ref document: A1