Abstract:
The invention relates to smartcard under SecureMMC standard, the card being connected to a host through a MMC bus and being compliant to ISO/IEC7816 standard. According to the invention, the card is multi-application operation capable and a determined number N of commands can be processed in the card in parallel, being the number of logical channels the card can support, the card has means for using a command or a response which is encapsulated in an information field of a bloc frame, said bloc frame also having at least a prologue field for at least identifying the source node application and the destination node application in a NAD datum, and the card has means for as long as the number p of active commands in the card is lower than N and none is completed, the card is in Secure_Idle state.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims priority to PCT Application PCT/IB2007/003715, filed Nov. 30, 2007, and EPO Application 06301198.5, filed Nov. 30, 2006, the disclosures of which are incorporated herein by reference. 
     
    
     FIELD OF THE INVENTION 
       [0002]    This invention describes a new way of operating an MMC device, based on the current SecureMMC 2.0 Interface Layer specification and that remove said constraint and allow multiple applications on the device to execute in parallel. 
       BACKGROUND OF THE INVENTION 
       [0003]    Current invention relates to smartcard and more particularly to multimedia cards (MMC) under SecureMMC standard. It allows starting, running and querying multiple applications in parallel/concurrently in a card connected to a host through a MMC bus. It has applications in the electronic, computing and telecommunication industries where MMC cards compliant with SecureMMC standard are fabricated and used. 
         [0004]    The newly defined SecureMMC 2.0 protocol defines a method for APDU commands to be transported over the MMC bus using the MMC protocol. However, while keeping as close as possible to the current ISO7816 specification, limitations with respect to the logical channel management as specified in ISO7816 4 is also inherited. 
         [0005]    While logical channel management as specified in IS07816 4, allows for multiple applications to be running in parallel at the same time, the T=0 and T=1 transport protocol as specified in IS07816 3, allow only one command to be send to one of the application at any one time (T=0 is the asynchronous half duplex character transmission protocol and T=1 is the asynchronous half duplex block transmission protocol). Thus even though multiple application are active, at any one time, only one of them is running. 
         [0006]    For a device operating system that supports both logical channel and multithreading, the above constraints does not allow for efficient use of the device. 
       SUMMARY OF THE INVENTION 
       [0007]    The invention is about a smartcard under SecureMMC standard, the card being connected to a host through a MMC bus, exchanges of commands/responses between the card and the host being compliant to at least one standard of the ISO/IEC7816 family of standards, the command and response being in the form of Application Protocol Data Unit (APDU) instructions, the card, in mono-application operation, having means for processing one command sent from the host to the card with a WRITE_SEC_CMD instruction, the card having means for providing a response to the host related to the processed command when receiving from the host a READ_SEC_CMD read instruction, the card having means for setting and resetting a SEC_CARD_EVENTS bit in a status register of the card as a mean to inform the host the processing of the command is completed, said bit being set when the card has completed the processing of the command and said bit being reset when the host has read the card, the card having states with at least: 
         [0008]    a Secure_Idle state when the card is waiting for data or command and not in error, 
         [0009]    a Secure_In_Progress state while processing a command, 
         [0010]    a Secure_Data_Available state when processing is completed. 
         [0011]    According to the invention, the card is multi-application operation capable and a determined number N of commands can be processed in the card in parallel, said predetermined number N of commands the card can proceed in parallel being the number of logical channels N the card can support, the card has means for using a command or a response which is encapsulated in an information field of a bloc frame, said bloc frame also having at least a prologue field for at least identifying the source node application and the destination node application in a NAD datum, in the case of a command the source identified being the host application identity and the destination identified being the related card application identity, and in the case of a response the source identified being the card application identity and the destination identified being the related host application identity, and the card has means for: as long as the number p of active commands in the card is lower than N and none is completed, the card is in Secure_Idle state, an active command being a command which is being processed, and that when the number p of active commands in the card is equal to N, the card switch to Secure_In_Progress state, the completion of any command switching the card to Secure_Data_Available state, a transition from Secure_Idle state to Secure_Data_Available state being added and a transition from Secure_Data_Available state to Secure_Data_Available state being added. 
         [0012]    The commands such as READ/WRITE_SEC_CMD . . . are part of the SecureMMC 2.0 standard (and of its variations) as defined in the Interface layer specification issued by the MMCA Technical Committee. More precisely, READ/WRITE_SEC_CMD are MMC command set and for the commands which are used in the invention, WRITE_SEC_CMD: Write Token is a mean to package APDU command over the MMC line and READ_SEC_CMD: Read Token is a mean to retrieve APDU command response from the card through MMC line. 
         [0013]    Following means, possibly used in all possible technical combinations, are also considered in the invention: 
         [0014]    the smartcard has means for the bloc frame encapsulating a command or a response also to have an epilogue field, 
         [0015]    the epilogue field is reserved for future use, RFU, and is 0000 h (two bytes/characters long), 
         [0016]    the smartcard has means for the prologue field also to have a length field, 
         [0017]    the smartcard has means for the bloc frame encapsulating a command or a response to have: 
         [0018]    the prologue field made of a NAD one byte datum and of a length two bytes datum, 
         [0019]    the information field of at least one byte, and 
         [0020]    the epilogue field of two bytes, 
         [0021]    the smartcard has means for the NAD one byte datum to have four bits for the identification of the destination node application and four bits for the identification of the source node application, 
         [0022]    the identifications of the source node application and the destination node application are numbers, 
         [0023]    the smartcard has means for switching from mono-application operation to multi-application operation and reverse in response to a Protocol_Type_Selection (PTS) request, said sent from the host to the card with a WRITE_SEC_CMD, being three bytes long with an initial PTSS character equal to FFh, a PTS0 character storing the protocol identification, its four most significant bits being null, and a checksum PCK character equal to PTSS xor PTS0, 
         [0024]    the smartcard has means for informing the host that it is multi-application operation capable along with the data sent from the card to the host after the card is reset, 
         [0025]    the smartcard has means for processing multiple commands which are encapsulated in an information field of one bloc frame, 
         [0026]    the smartcard has means for sending multiple responses back to the host and which are encapsulated in an information field of one bloc frame. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0027]    Features and other aspects of embodiments of the present invention are explained in the following description taking in conjunction with the accompanying drawings, wherein: 
           [0028]      FIG. 1  illustrates the known state of art represents the internal SecureMMC states and state transitions; 
           [0029]      FIG. 2  illustrates the internal SecureMMC states and state transitions for the multi-applications operation according to the invention; and 
           [0030]      FIG. 3  illustrates an example of state transitions in multi-applications operation of SecureMMC. 
       
    
    
     DETAILED DESCRIPTION 
       [0031]    Various embodiments of the present invention will now be described in greater detail with reference to the drawings. 
         [0032]    Thanks to the new APM command set protocol of the invention, multiple APDU commands can be serviced in parallel and individual (or multiple) responses to be transmitted to the host asynchronously. The advantage is that if a multi threaded OS is present in the device, its resource can be used much more efficiently. This will also enable multiple applications on the host to communicate with the device more efficiently. 
         [0033]    The core benefit of the invention is full utilization of multiple logical channels. The invention leverages on the increased bandwidth and robustness of more recent transport protocols and increased processing power of present microprocessors allowing for more applications to exist and run seemingly concurrent to each other. Thanks to the invention, an inherent abstraction between the transport protocol and the logical channel address mechanism is obtained. 
         [0034]    The general principles of known operation of smartcards under the SecureMMC 2.0 interface specification are now described. This known operation only allows mono-application operation of the smartcard. The SecureMMC 2.0 interface specification specify a method in which smartcard commands and responses are to be transported over the MMC bus. The specification specify the MMC commands, registers and state machine which a SecureMMC compliant device has to follow. 
         [0035]    An Application Protocol Data Unit (APDU) command is transmitted from the host to the SecureMMC compliant device (a smartcard in the current instance) through the WRITE_SEC_CMD: Write Token command. The response and status code of the command is retrieved by the host through the READ_SEC_CMD: Read Token command. The data in both command and response are formatted in accordance to ISO7816 4, as depicted in the following representation of the APDU data format: 
         [0000]    
       
         
               
               
               
               
               
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 CLA 
                 INS 
                 P1 
                 P2 
                 P3 
                 DATA (P3 bytes) 
               
               
                   
                   
               
               
                   
                 (CLA stands for Class Byte, INS for Instruction Byte, P1-P3 for Parameter bytes) 
               
             
          
         
       
     
         [0036]    and of the APDU response format: 
         [0000]    
       
         
               
               
               
             
           
               
                   
               
             
             
               
                 DATA 
                 SW1 
                 SW2 
               
               
                   
               
               
                 (SW1-SW2 stands for Status Bytes) 
               
             
          
         
       
     
         [0037]    The state transition for APDU command set as specify in the SecureMMC 2.0 interface specification is represented in  FIG. 1  of the known state of art. 
         [0038]    In a partial explanation of  FIG. 1 , mostly related to command and response activities, the host shall first send a APDU command over to the SecureMMC compliant device. Upon receiving the command, the SecureMMC compliant device will switch its internal state to Secure_In_Progress, meaning the device is processing the command and thus not able to accept new commands. Upon completion of the command, the device will move the state to Secure_Data_Available. A SEC_CARD_EVENT bit in the card status register will also be set by the device as a mean to notify the host that processing is completed and that the host can retrieve the response and status code. 
         [0039]    The host shall then issue a READ_SEC_CMD: Read Token to retrieve the response and status code of the previous completed command. The SecureMMC compliant device shall then set its internal state back to Secure_Idle, ready to receive the next APDU command from the host. In this workflow which follows ISO7816 4, only one APDU command can be sent and serviced at any one time. 
         [0040]    It should be noted that logical channel as described in ISO7816 4, allows multiple applications to be active at any one time. However, due to the constraint of the T=0 and T=1 protocol as specified in IS07816 3, only one command can be sent and executed by an application at any one time. As a consequence, with more advanced OS that supports multi threading, the logical channel behavior, as is defined in ISO7816 4, is inhibiting and thus not able to fully exploit a multi threaded capable OS. 
         [0041]    It should also be noted, as represented in  FIG. 1 , that transition  1  (Secure_Data_Available to Secure_Data_Available) and transition  2  (Secure_Idle to Secure_Data_Available) are provisioned to apply to the MMC Net command set and Socket Transport Protocol command set where the data transported over the SecureMMC interface layer follows network protocols and this is per se no help for multi-application. 
         [0042]    As this will now be described, the current invention allows the packing of multiple APDU command or response in a single WRITE_SEC_CMD and READ_SEC_CMD respectively. The new way of operating SecureMMC device also allows individual responses to be sent independently, thus not requiring the number of responses to match the WRITE_SEC_CMD. Thus faster applications need not wait for the slower one before their responses can be sent out to the host. 
         [0043]    The new operation which is a multi-application operation, also allow host application(s) to send multiple WRITE_SEC_CMD asynchronously for the APDU command set, while keeping to the same secure states but with the addition of state transitions for APDU command which are similar to the ones used for MMC Net command set and Socket Transport Protocol command set. 
         [0044]    A method for the host to query the device/card whether the new protocol is supported or not and to switch to this protocol if both the host and card supports it, will also be described. Lastly, a method for the host to query the card of the maximum number of concurrent applications (parallel executing applications) that can be executed, thus limiting the maximum number of APDU commands in a single WRITE_SEC_CMD, will be presented. 
         [0045]    In the multi-applications operation, the number of logical Channels limits the number of parallelizable applications in the device/card. The definition of logical channels is the same as defined in ISO7816 4 and logical channel management is as specified in ISO7816 4. This provides a means for the host to select multiple applications on the device. The maximum number of logical channels supported by the device is device-dependent. The maximum number of logical channels supported by the device can be embedded into the historical bytes of the Answer To Reset ATR, as specify in ISO7816 4 and the host may retrieve this information as described in SecureMMC 2.0 Interface specification, that is, through the GET_DATA command. In a variation, the maximum number of logical channels supported by the device may be sent to the host in response to a reset of the card. This information is available through the coding of the card capability byte of the historical bytes in the ATR. 
         [0046]    To allow multiple APDU commands to be packaged and directed to the correct on device application and for their responses to be identified and returned to the correct host application, this invention apply a variant of the T=1 block frame, as specified in ISO7816 3, as a way to wrap individual APDU command and responses. Multiple APDU commands and responses are then transmitted in WRITE_SEC_CMD and READ_SEC_CMD as a concatenation of the frames. 
         [0047]    The proposed block frame for each individual APDU command and response is depicted in the following table: 
         [0000]    
       
         
               
               
               
               
               
             
               
               
               
               
               
             
           
               
                   
                   
               
               
                   
                 Prologue field 
                   
                 Information field 
                 Epilogue field 
               
               
                   
                   
               
             
             
               
                   
               
             
          
           
               
                   
                 NAD 
                 LEN (2 bytes) 
                 APDU 
                 RFU (0000h) 
               
               
                   
                   
                   
                 command(s) or 
               
               
                   
                   
                   
                 response(s) 
               
               
                   
                   
                   
                 (&gt;=1 byte) 
               
               
                   
                   
               
               
                   
                 (NAD stands for Node Address, LEN for length, RFU for reserved for future use) 
               
             
          
         
       
     
         [0048]    In this table, each APDU command and response is now encapsulated in a block frame consisting of 3 bytes of header (Prologue field) and 2 bytes of trailer (Epilogue field). 
         [0049]    The NAD has similar meaning as described in ISO7816 3. The NAD allows to identify the source and the intended destination of the block. The format of NAD is shown in the following table: 
         [0000]    
       
         
               
               
               
               
               
               
               
               
               
             
               
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 B8 
                 B7 
                 B6 
                 B5 
                 B4 
                 B3 
                 B2 
                 B1 
               
             
          
           
               
                   
                 destination node addr 
                 source node addr 
               
               
                   
                   
               
             
          
         
       
     
         [0050]    If the Information field contains APDU command(s), then the source node addr identify the application on the host side and the destination node addr identify the application residing on the device/card. If the Information field contains responses, the reverse apply. 
         [0051]    The node address to identify an on device/card application may be the logical channel number assigned or opened by the host application. 
         [0052]    With multiple applications running in parallel and independently in the device and to allow APDU command(s) for the applications to be send independently, the state transitions for APDU command set is expanded. 
         [0053]    The new state transitions for SecureMMC APDU command set is as shown in  FIG. 2 . Essentially, the state transition ( 1 ) and ( 2 ) of  FIG. 1  are included as valid transitions for SecureMMC APDU command set of the multi-application operation. 
         [0054]    The meaning of Secure_Idle state now means that one or more logical channel (device application) are free to receive APDU commands. Secure_Data_Available state means response for one or more commands are available for the host. As the responses for the commands will be ready in different time and to allow the response to be sent asynchronously, the state transition Secure_Idle to Secure_Data_Available is added. And since it is also possible that while the host send a READ_SEC_CMD to retrieve the response(s), responses for other applications are ready. Thus after a READ_SEC_CMD, the state remains at Secure_Data_Available. 
         [0055]      FIG. 3  illustrates a sample state transitions. The scenario assumes that the device is able to support a maximum of 3 parallel Channels. 
         [0056]    As not all device OS supports multi threading or logical channel management, the new operation protocol as described in this document is meant as a second protocol. The default protocol is as specified in the SecureMMC Interface Layer, that is mono-application. 
         [0057]    In order for the host to know if this new protocol is supported, the described protocol id may be coded in the ATR (Answer To Reset), as specified in ISO7816 3. The host shall retrieve the ATR to see if a device supports this new protocol. 
         [0058]    To switch to the new protocol, the host shall send a PTS request to the device/card. The PTS request (and response) shall be coded as specified in ISO7816 3, as shown in the following table: 
         [0000]    
       
         
               
               
               
               
             
           
               
                   
                   
               
               
                   
                 PTSS 
                 PTS0 
                 PCK 
               
               
                   
                   
               
             
             
               
                   
                 character FFh 
                 Format character 
                 =PTSS xor PTS0 
               
               
                   
                   
               
             
          
         
       
     
         [0059]    The most significant four bits of PTS0 being null and the four least significant being the Protocol identification. 
         [0060]    Note that the PTS request shall be sent as the only command in the WRITE_SEC_CMD. The card shall respond with the exact pattern to acknowledge a successful protocol switching. 
         [0061]    As the PPS request is only 3 bytes long, the card is able to interpret it as a PTS request. 
         [0062]    Once the protocol is switched to the new protocol (multi-operation) as described in this document, the message format shall follows the one as described in this document. 
         [0063]    Although illustrative embodiments have been shown and described herein in detail, it should be noted and will be appreciated by those skilled in the art that there may be numerous variations and other embodiments that may be equivalent to those explicitly shown and described. For example, the scope of the present invention is not necessarily limited in all cases to execution of the aforementioned steps in the order discussed. Unless otherwise specifically stated, terms and expressions have been used herein as terms of description, not of limitation. Accordingly, the invention is not to be limited by the specific illustrated and described embodiments (or the terms or expressions used to describe them) but only by the scope of claims.