javacard applet develop question- profile decode
-
- Posts: 10
- Joined: Fri Jan 06, 2017 3:28 am
- Points :276
- Contact:
javacard applet develop question- profile decode
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?
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?
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3053
- Contact:
Re: javacard applet develop question- profile decode
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.
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
-
- Posts: 10
- Joined: Fri Jan 06, 2017 3:28 am
- Points :276
- Contact:
Re: javacard applet develop question- profile decode
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
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3053
- Contact:
Re: javacard applet develop question- profile decode
From JC API:
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.
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
-
- Posts: 10
- Joined: Fri Jan 06, 2017 3:28 am
- Points :276
- Contact:
Re: javacard applet develop question- profile decode
thanks very much for your suggestion
- UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3053
- Contact:
Re: javacard applet develop question- profile decode
sense and simplicity
Who is online
Users browsing this forum: No registered users and 33 guests