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

Problematic JCSystem.beginTransaction when used with generating RSA keys

JavaCard Applet Development Related Questions and Answers.
tay00000
Posts: 161
Joined: Tue Sep 27, 2016 10:58 am
Points :2326
Contact:

Problematic JCSystem.beginTransaction when used with generating RSA keys

Post by tay00000 » Tue Nov 01, 2016 5:08 am

Anyone have tried to generate RSA2048 bit keys while encapsulating the RSA keygen within the begin and commit transaction statements and returns a
out of memory status word or something along that line when used on an NXP JCOP 2.4.2 card ?

Code: Select all

JCSystem.beginTransaction();
keyPair = new KeyPair(KeyPair.ALG_RSA, (short) KeyBuilder.LENGTH_RSA_2048);
keyPair.genKeyPair();
JCSystem.commitTransaction();

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

Re: Problematic JCSystem.beginTransaction when used with generating RSA keys

Post by UNKNwYSHSA » Tue Nov 01, 2016 5:24 am

Transaction buffer size of jcop242R2 is 512 bytes.
So when generate RSA 2048 keypair, D is length 256, N is length 256, and N is write to private key object and public key object. Then the transaction data size > card transaction buffer size. Then raise the out of memory exception?
sense and simplicity

tay00000
Posts: 161
Joined: Tue Sep 27, 2016 10:58 am
Points :2326
Contact:

Re: Problematic JCSystem.beginTransaction when used with generating RSA keys

Post by tay00000 » Tue Nov 01, 2016 5:27 am

Oh my ... I forget all about the transaction buffer size. That explains it.

That means, use the genKeyPair() or setKey() unless wanting to incur into the transaction buffer via begin/commit transaction.

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

Re: Problematic JCSystem.beginTransaction when used with generating RSA keys

Post by UNKNwYSHSA » Tue Nov 01, 2016 5:37 am

All NVM wirte operations will be written into transaction buffer between JCSystem.beginTransaction() and JCSystem.commitTransaction/abortTransaction.
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 36 guests

JavaCard OS : Disclaimer