This discussion is archived
3 Replies Latest reply: Feb 15, 2013 11:34 AM by 981922 RSS

Install applet failed when calling (RSAPrivateCrtKey)KeyBuilder.buildKey()

991038 Newbie
Currently Being Moderated
Hi readers,

I am newbie to Java card applet development. I have written a applet to calculate RSA signature with the fixed RSA CRT components and data sent by CAD.

When I run the applet using Emulator, I get 0x64 44:
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 90, SW2: 00
CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 0b, 09, a0, 00, 00, 04, e0, 00, 01, 00, 01, 00, Le: 00, SW1: 64, SW2: 44

I debugged applet code and I see that below line is the issue.

privateCrtKey = (RSAPrivateCrtKey)KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_CRT_PRIVATE, KeyBuilder.LENGTH_RSA_2048, false);
asymSignature = Signature.getInstance(Signature.ALG_RSA_SHA_PKCS1, false);

please help me to sort out this issue. thanks.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points