The Java Card Applet Development Process

2015. 1. 9. 09:47IT관련

반응형

Java Card는 CAP(Converted Applet)을 만들기 위해 아래와 같은 과정을 수행한다.




Step1
Java Compiler를 이용하여 Java --> class로 변환한다.

Step2
Java Card Simulator로 디버깅.

Step3
Java Card에 Applet을 load & install 하기 위해서는 반드시 compile된 class 파일들을 Java Card Converter를 이용하여 convert 해야만 한다.
Converter를 사용하면 총 3가지의 파일이 생성된다.
  1. JCA(Java Card Assembly)
  2. CAP(Converted Applet)
  3. EXP(Export file)

Convert를 해야 하는 이유
  • Java Card VM은 가장 작은 Java VM이라서 기능의 제약이 상당히 많고 Java Card VM이 porting 되는 H/W 역시 제약이 상당히 많다.
  • 이에 Java VM에서 Class loading시에 하는 일부의 기능을 runtime으로 하지 않고 Off-card VM이라고 불리는 Converter에서 하도록 하여 성능의 제약을 극복하고자 한다. 
    • Java clesses 검사
    • Java Card에서 지원하는 primitive를 사용하는지 검사
    • static 변수 초기화
    • Class, Method, Field들의 심볼 검사
    • Bytecode Optimize
    • Class의 allocation과 create
  • 위 기능을 Runtime에 하지 않고 미리 수행해서 실제 Java Card에서는 검사를 하지 않도록 함이다.

EXP
  • 이 파일은 CAP과 달리 Smart Card에 Load 되거나 Install 되는 것은 아니다.
  • Export 파일들은 package의 class들에 대한 public interface 정보를 포함하고 있다. 즉, package당 하나 존재한다.
  • 이 public interface 정보는 compile 하고자 하는 Applet이 다른 Package의 class들을 import 하였을때 Applet과 import 된 package를 link할 때 사용된다.


JCA
CAP
  • CAP file은 JAR format과 동일하다. 
  • CAP은 Convert를 통해 압축된 Binary 이며 off-card installation program으로 Card에 load & install 될 수 있다.
  • ComponentDescription
    HeaderContains general information about the CAP file and the package it defines.
    DirectoryLists the size of each of the components in the CAP file.
    AppletContains information about each of the applets defined in this package.
    ImportLists the set of packages that are imported by this package.
    Constant PoolContains information about the classes, methods, and fields referenced by elements in the Method component.
    ClassDescribes each of the classes defined in this package.
    MethodDescribes each of the methods declared in this package.
    Static FieldContains information required to create and initialize an image of all the static fields defined in this package.
    Reference LocationContains offsets required to access data in the Constant Pool component.
    ExportLists all static elements in this package that may imported by other packages.

Step4

Off-card installation program을 통해 Java Card에 CAP file을 load & install하여 테스트 한다.


반응형

'IT관련' 카테고리의 다른 글

파이선(Python) 셀프 스터디  (0) 2015.07.06
암호학에 대한 설명(비디오)  (0) 2015.04.23
신용거래(Transaction Processing) Flow  (1) 2014.06.25
EMV Command  (5) 2014.06.25
EMV 용어  (0) 2014.06.25