Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

javacard applet develop question- profile decode

JavaCard Applet Development Related Questions and Answers.
z535539710
Posts: 10
Joined: Fri Jan 06, 2017 3:28 am
Points :276
Contact:

javacard applet develop question- profile decode

Post by z535539710 » Wed Mar 15, 2017 4:00 am

1. Why it is recommended to create all new objects at applet installation time in javacard?
2. Since my javacard applet is designed to decode profiles encoded in TLV structure using DER encoding,I have to new objects dynamically during the decoding process. how can I release the objects when the decoding process finished, or is there a better way to realize this? :)

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: javacard applet develop question- profile decode

Post by UNKNwYSHSA » Wed Mar 15, 2017 6:41 am

1 To check if the memory space is enough, required algorithm is supported, or ..., before you run applet commands.
2 Call api JCSystem.requestObjectDeletion() at the end of the command, unreferenced objects will be reclaimed before next APDU processing, and use api JCSystem.isObjectDeletionSupported() to check if the function is supported by the JCVM.
sense and simplicity

z535539710
Posts: 10
Joined: Fri Jan 06, 2017 3:28 am
Points :276
Contact:

Re: javacard applet develop question- profile decode

Post by z535539710 » Wed Mar 15, 2017 9:32 pm

UNKNwYSHSA wrote:1 To check if the memory space is enough, required algorithm is supported, or ..., before you run applet commands.
2 Call api JCSystem.requestObjectDeletion() at the end of the command, unreferenced objects will be reclaimed before next APDU processing, and use api JCSystem.isObjectDeletionSupported() to check if the function is supported by the JCVM.


Thanks very much for your answer, and I have another question:

if my card support GC, then will the JCSystem.requestObjectDeletion bring additional performance consumption? How to estimate the influence?

Thanks again and expecting your answer

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: javacard applet develop question- profile decode

Post by UNKNwYSHSA » Wed Mar 15, 2017 10:15 pm

From JC API:
This method is invoked by the applet to trigger the object deletion service of the Java Card runtime environment. If the Java Card runtime environment implements the object deletion mechanism, the request is merely logged at this time. The Java Card runtime environment must schedule the object deletion service prior to the next invocation of the Applet.process() method.


The GC process influence the next APDU process, not the APDU contains JCSystem.requestObjectDeletion().
If you take care of the next APDU. The only way is optimize your code, produce fewer template objects when command processing.
Notice: Both the new operation and GC take effect on performance.
sense and simplicity

z535539710
Posts: 10
Joined: Fri Jan 06, 2017 3:28 am
Points :276
Contact:

Re: javacard applet develop question- profile decode

Post by z535539710 » Wed Mar 15, 2017 10:38 pm

thanks very much for your suggestion :D

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: javacard applet develop question- profile decode

Post by UNKNwYSHSA » Thu Mar 16, 2017 4:12 am

:D
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 31 guests

JavaCard OS : Disclaimer