JavaCard Applet Development Related Questions and Answers.
-
tay00000
- Posts: 161
- Joined: Tue Sep 27, 2016 10:58 am
- Points :2326
-
Contact:
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();
-
UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
-
Contact:
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:
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.
-
UNKNwYSHSA
- Posts: 630
- Joined: Thu May 21, 2015 4:05 am
- Points :3055
-
Contact:
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
Users browsing this forum: No registered users and 36 guests
JavaCard OS : Disclaimer
Board Disclaimer
The views and comments posted in these fora are personal and do not necessarily represent the those of the Management of JavaCard OS.
The Management of JavaCard OS does not, under any circumstances whatsoever, accept any responsibility for any advice, or recommentations, made by, or implied by, any member or guest vistor of JavaCard OS that results in any loss whatsoever in any manner to a member of JavaCard OS, or to any other person.
Furthermore, the Management of JavaCard OS is not, and cannot be, responsible for the content of any other Internet site(s) that have been linked to from JavaCard OS.