10 Replies Latest reply on Aug 13, 2009 5:05 PM by 843851

    Java Card Version

    843851
      Hi all;
      I'm a newbie in Java Cards and this is my first post in this forum,
      I have a javacard with no documantation, How can I know which OS is installed on it and what is the version of my javacard, i.e: Version 2.0, 2.1, 2.2 ...

      previouse thanks and regards
        • 1. Re: Java Card Version
          safarmer
          Hi,

          To get the card recognition data (as deffined in GlobalPlatform) you can use the GET DATA APDU and retrieve tag '66'.

          The APDU is: 80 CA 00 66 00. This has to be sent to the card manager.

          The card recognition data will come back as a byte array with a TLV structure. The structure is deffined in the GP card spec (available from the GP website at [http://globalplatform.org/specificationscard.asp|http://globalplatform.org/specificationscard.asp]) in section F.2 Structure of Card Recognition Data in the card spec v2.1.1.

          Here is an example response that has been indented to show where each of the nested TLV's would be.
          66 4C 
             73 4A 
                06 07 2A864886FC6B01 
                60 0C 
                   06 0A 2A864886FC6B02020101 
                63 09 
                   06 07 2A864886FC6B03 
                64 0B 
                   06 09 2A864886FC6B040215 
                65 0B 
                   06 09 2B8510864864020103 
                66 0C 
                   06 0A 2B060104012A026E0102 
          Some of the details from this are:
          Global Platform version : 2.1.1
          Global Platform Secure Channel Protocol: 02 option 15
          Java Card version : 2.2

          This should at least help you find out the GlobalPlatform and Java Card version of the card.

          Cheers,
          Shane
          • 2. Re: Java Card Version
            843851
            Soooo much thanks for your soon and helpfull reply

            I'm using eclipse, when I send the command you told via Jcop I recieved this result :

            66 4C 73 4A 06 07 2A 86 48 86 FC 6B 01 60 0C 06
            0A 2A 86 48 86 FC 6B 02 02 01 01 63 09 06 07 2A
            86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B
            04 02 15 65 0B 06 09 2B 85 10 86 48 64 02 01 01
            66 0C 06 0A 2B 06 01 04 01 2A 02 6E 01 02 90 00

            I visited site address you mentioned but couldn't find somewhere which I can undrestand what these bytes means..
            would you please help me more in this part eaither

            thanks again for your care
            • 3. Re: Java Card Version
              safarmer
              Since you are using JCOP Tools you can use the easy way :) The two commands you are after are get-cplc and get-data. They will format the response for you. Here is an example shell session.
              cm>  get-cplc
                IC Fabricator                      : FFFF
                IC Type                            : FFFF
                Operating System ID                : 1291
                Operating System release date      : FFFF
                Operating System release level     : 0100
                IC Fabrication Date                : 4D4D
                IC Serial Number                   : 4D4D4D4D
                IC Batch Identifier                : 4D4D
                IC Module Fabricator               : 4082
                IC Module Packaging Date           : 9215 (3.8.2009)
                ICC Manufacturer                   : 1293
                IC Embedding Date                  : 9215 (3.8.2009)
                IC Pre-Personalizer                : 0000
                IC Pre-Perso. Equipment Date       : 0000
                IC Pre-Perso. Equipment ID         : 00000000
                IC Personalizer                    : 0000
                IC Personalization Date            : 0000
                IC Perso. Equipment ID             : 00000000
              cm>  get-data 0066
              Global Platform version                : 2.1.1
              Global Platform Secure Channel Protocol: 02 option 15
              Java Card version                      : 2.2
              Cheers,
              Shane
              • 4. Re: Java Card Version
                Sebastien_Lorquet
                well, try to understand how the TLV format is made.

                one or two bytes are the tag, followed by a length, then by LENGTH bytes.

                we said to you, run the "get data" command with tag 66, so the answer gives you this tag

                Just follow the same decoding as indicated in the previous post!
                T=66 L=4C {
                     T=73 L=4A {
                          T=06 L=07 {
                               2A 86 48 86 FC 6B 01 
                          }
                          T=60 L=0C {
                               T=06 L=0A {
                                    2A 86 48 86 FC 6B 02 *02 01 01* 
                               }
                          }
                          T=63 L=09 {
                               T=06 L=07 {
                                    2A 86 48 86 FC 6B 03
                               }
                          }
                          T=64 L=0B {
                               T=06 L=09 {
                                    2A 86 48 86 FC 6B 04 *02 15* 
                               }
                          }
                          T=65 L=0B {
                               T=06 L=09 {
                                    2B 85 10 86 48 64 *02 01 01* 
                               }
                          }
                          T=66 L=0C {
                               T=06 L=0A {
                                    2B 06 01 04 01 2A 02 6E 01 02
                               }
                          }
                     }
                } 
                SW=90 00
                So you have a 2.1.1 javacard
                • 5. Re: Java Card Version
                  843851
                  what an active forum i is.. thanks all for responses

                  let me know u that I use get-data 0066 in Jcop and get this result :
                  => 80 CA 00 66 00
                  (32875 usec)
                  <= 66 4C 73 4A 06 07 2A 86 48 86 FC 6B 01 60 0C 06 fLsJ..*.H..k.`..
                  0A 2A 86 48 86 FC 6B 02 02 01 01 63 09 06 07 2A .*.H..k....c...*
                  86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B .H..k.d...*.H..k
                  04 02 15 65 0B 06 09 2B 85 10 86 48 64 02 01 01 ...e...+...Hd...
                  66 0C 06 0A 2B 06 01 04 01 2A 02 6E 01 02 90 00 f...+....*.n....
                  Status: No Error
                  Global Platform version : 2.1.1
                  Global Platform Secure Channel Protocol: 02 option 15
                  Java Card version : 2.2


                  so why there is the difference, cause you told my Java Card version is 2.1.1 but using get-data command,Jcop told me my Java Card Version is 2.2 ??!!
                  • 6. Re: Java Card Version
                    safarmer
                    From GP Card Spec 2.1.1
                    Note 1: Removed

                    Note 2: Tag '60': The OID {globalPlatform 2 v} identifies a card that conforms to the GlobalPlatform Card Specification version “v”. Thus a card conforming to the GlobalPlatform Card Specification 2.1 would use OID {globalPlatform 2 2 1} and a card conforming to the GlobalPlatform Card Specification 2.1.1 would use OID {globalPlatform 2 2 1 1}.

                    Note 3: Removed

                    Note 4: Tag '64'. The OID {globalPlatform 4 scp i} identifies the Secure Channel Protocol of the Issuer Security Domain. "scp" identifies the Secure Channel Protocol identifier as defined in Section 8.6 - Secure Channel Protocol Identifier."i" identifies the eventual implementation options such as implicit or explicit initiation as defined in Appendix D.1.1 - SCP01 Secure Channel for SCP '01' and Appendix E.1.1 - SCP02 Secure Channel for SCP '02'.

                    Note 5: The data object with tag '65' may contain information about the GlobalPlatform implementation details or commonly used Card Issuer options. Such information shall be TLV encoded. The structure of this data object is under definition by GlobalPlatform.

                    Note 6: The value of the data object with tag '66' is not defined by Global Platform. It may contain information about the card and chip implementation, such as the operating system/runtime environment or a security kernel. Such information shall be TLV encoded.
                    I am not convinced that the value in tag 65 is the Java card version. In the response I posted earlier, The value was: 65 0B 06 09 2B8510864864*020103* which would indicate Java Card version 2.1.3 (does that even exist?) and I can guarentee that the cards I am using are JC 2.2.1. From the above notes it would come from either 65 or 66 but I am unsure of how. I would have to go with the value that JCOP Tools gives you.

                    Cheers,
                    Shane
                    • 7. Re: Java Card Version
                      843851
                      at last, I think the best answer is JCOP's answer which tell me the java card version is 2.2
                      any suggestion about Those byte structure will be regarded :)
                      thanks
                      • 8. Re: Java Card Version
                        843851
                        With this tag it is not possible to distinct between the minor versions, e.g. a Java Card 2.2.1 and 2.2.2 card.
                        • 9. Re: Java Card Version
                          843851
                          Hello,
                          safarmer wrote:
                          I am not convinced that the value in tag 65 is the Java card version. In the response I posted earlier, The value was: 65 0B 06 09 2B8510864864*020103* which would indicate Java Card version 2.1.3 (does that even exist?) and I > can guarentee that the cards I am using are JC 2.2.1. From the above notes it would come from either 65 or 66 but I am unsure of how. I would have to go with the value that JCOP Tools gives you.
                          I'm also not convinced about that since I also get this
                          65 0B 06 09 2B 85 10 86 48 64 *02 01 03*
                          When I use the JCSystem function on my applet, I get the 2.2 version
                          JCSystem.getVersion()
                          lexdabear wrote:With this tag it is not possible to distinct between the minor versions, e.g. a Java Card 2.2.1 and 2.2.2 card.
                          So is there a way to get the "micro" version somehow ?

                          Thanks,
                          regards Tex
                          • 10. Re: Java Card Version
                            843851
                            1. Get hold of the product documentation.
                            2. Try to load a Java Card version. If it is not supported it will fail.