Page 1 of 1

Implement a simple JavaCard API

Posted: Thu Jun 15, 2017 1:59 am
by nikonai
I have to write a simple JCVM in C language,but I am experiencing a problem. Such as method invoke,if I invoke a method in a package,the byte-code is in the cap file. But if it is in JavaCard API like apdu.getbuffer(),how can I implement it? I just need to implement a simple version of JavaCard API, please help.

Re: Implement a simple JavaCard API

Posted: Thu Jun 15, 2017 11:26 pm
by btwtiger
1. Change your applet build process to intercept the generated classes before JAVA CARD bytecode conversion, and make a jar;
2. Dynamically load this jar in a driver program;
3. Using reflection , call the entry point "install()" in the loaded class - this will call the applet constructor and try to call back register() - you will have to implement this API and others.

Re: Implement a simple JavaCard API

Posted: Fri Jun 16, 2017 5:54 am
by nikonai
Thank you for your help. Now I am confused about a basic question.
Does the java card API stored in a card in cap file form?

Re: Implement a simple JavaCard API

Posted: Fri Jun 16, 2017 6:15 am
by btwtiger
It is up to your implementation.