3 Replies Latest reply on Apr 2, 2020 12:37 PM by patrick.vh-Oracle

    create file record java card


      i'm new to java card, i'm studying the standards for development, a question arose, could someone help me? I did not find anywhere or document on how I access or create the structure of the javacard. follow the example I'm doing.


      public final static byte[] fci = {(byte) 0x6F, (byte) 0x1E,

        (byte) 0x84, (byte) 0x0E, (byte) 0x31, (byte) 0x50, (byte) 0x41, (byte) 0x59, (byte) 0x2E, (byte) 0x53, (byte) 0x59, (byte) 0x53, (byte) 0x2E, (byte) 0x44, (byte) 0x44, (byte) 0x46, (byte) 0x30, (byte) 0x31,

        (byte) 0xA5, (byte) 0x0C,

        (byte) 0x88, (byte) 0x01,(byte) 0x01,

        (byte) 0x5F, (byte) 0x2D, (byte) 0x02, (byte) 0x70, (byte) 0x74,

        (byte) 0x9F, (byte) 0x11, (byte) 0x01, (byte) 0x01};


      how do I create the file record structure?


      FCI  - ok

           FCI Proprietary template - ok

      File 1   ------------------- ?????

             Record 1  --------- ?????

                           ADF   -- ?????


      how it works? could someone explain to me?



        • 1. Re: create file record java card


          If I understand correctly, you're trying to implement an ISO 7816-4 File System (or likewise).
          The Java Card API does not contain a ready-to-use set of classes for these data structures, but there are some useful open source projects that you can use as starting point, for example here.


          • 2. Re: create file record java card

            Thanks a lot for the help.

            but could you explain to me with a simple example in code, how do I make this resource allocation to build a file system in java card???

            • 3. Re: create file record java card

              Again, Java Card API does not define any kind of FileSystem class that you could just instantiate to implement such file system (with data structure, access rights, and APDU command set to use it).


              However, Java Card is extensible and implementations may also embed additional standard API (e.g. SIM card - look for ETSI TS 102 241 - UICC API) or proprietary API that you could use.
              If instead such API are not available, you will have to create your own and the link provided above gives some good examples how to do this.