Hi,
I'm using JavaCard Development Kit and I have script file where I place all my apdu commands. I create instance of Cipher object inside my applet constructor. When I use ALG_RSA_NOPAD, my first apdu command fail.
I have a following code:
Cipher cipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
and when I create Cipher object like this, I receive execution error when I send this command to simulator:
//create applet instance
0x80 0xB8 0x00 0x00 0x09 0x07 0xA0 0x00 0x00 0x00 0x03 0x20 0x10 0x00 0x7F;
response on the above apdu command is:
CLA: 80, INS: b8, P1: 00, P2: 00, Lc: 09, 07, a0, 00, 00, 00, 03, 20, 10, 00, Le: 00, SW1: 64, SW2: 44
When I change algorithm, and use ALG_RSA_PKCS1 instead of ALG_RSA_NOPAD, my applet is created succesfully, but I read that I cannot use ALG_RSA_PKCS1 because "This algorithm is only suitable for messages of limited length. The total number of input bytes processed may not be more than k-11, where k is the RSA key's modulus size in bytes", and my message is same size as modulus.
Does anybody have idea how to solve this?
Thanks,
Vuk