JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Question about javacard getInstance() API

JavaCard Applet Development Related Questions and Answers.
nearsunshine
Posts: 8
Joined: Wed Aug 12, 2015 6:27 am
Points :21
Contact:

Question about javacard getInstance() API

Post by nearsunshine » Thu Jan 21, 2016 2:18 am

I know that there are many getInstance methods(e.g. Cipher class, Cipher.getInstance(byte algorithm,boolean externalAccess) throws CryptoException.) in java card API.

My Question:
How many instances will I get if I call Cipher.getInstance(...) twice consecutively?
In RAM, only one instance at all times or each instance per getInstance method invocation?

Tarantino
Posts: 101
Joined: Wed Aug 19, 2015 1:56 am
Points :478
Contact:

Re: Question about javacard getInstance() API

Post by Tarantino » Thu Jan 21, 2016 10:02 pm

getInstance() allocates memory from EEPROM not RAM for each call.
The greatest glory in living lies not in never falling, but in rising every time we fall.--Nelson Mandela

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

Re: Question about javacard getInstance() API

Post by UNKNwYSHSA » Thu Jan 21, 2016 10:16 pm

1 getInstance() create instance for each time this method called. Because instance of Cipher/Signature/RandomData/MessageDigest/KeyAgreement/Checksum has method init/update/doFinal, each instance need to save their own instance data, the instance can not be shared.
2 The RAM space are allocated for each instance.
sense and simplicity

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

Re: Question about javacard getInstance() API

Post by UNKNwYSHSA » Thu Jan 21, 2016 10:22 pm

Tarantino wrote:getInstance() allocates memory from EEPROM not RAM for each call.

There has any variables (internal data) ban be stored in RAM.
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 44 guests

JavaCard OS : Disclaimer