0

I am trying to import a key into the card, but it is giving response as 6F00 (UNKNOWN ERROR).The procedure i followed to import a key is

  1. Load the (MUSCLE) applet
  2. Initialize the applet
  3. Verify the pin
  4. create the object with id (FF FF FF FE):

-> B0 5A 00 00 0E FF FF FF FE 00 00 00 44 00 00 00 00 00 00 00
<- 90 00

  1. write into the object

-> B0 54 00 00 8D FF FF FF FE 00 00 00 00 84 00 01 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<- 90 00

  1. Import key

-> B0 32 04 00 07 00 00 FF FF 00 00 00 00
<- 6F 00

Please provide a solution for the above problem.

123r789
  • 1,600
  • 3
  • 22
  • 33
  • 7 bytes seems to be a bit low for importing a key. Before we have to read the full spec., what kind of key are you trying to import? – Maarten Bodewes Jul 19 '13 at 22:45
  • I am trying to import RSA public key of 128 bytes size, which is stored in the object FF FF FF FE in step (5). – 123r789 Jul 23 '13 at 10:46
  • Interesting, because I don't see any key... – Maarten Bodewes Jul 23 '13 at 10:50
  • I followed the guidelines provided in mcardport-1.2.1.pdf book for import a key into java card.According to this book first we need to create a object with id FF FF FF FE and write the key blob into this object then import key. In step (5) the command consist of not only a key it is a key blob. – 123r789 Jul 23 '13 at 11:47
  • That may be, but I would expect a key - or at least the modulus of an RSA key - to contain random looking bytes, not just a bunch of zero's. As Java Card's RSAPrivateKey can be quite picky, I would not expect it to accept this data. – Maarten Bodewes Jul 23 '13 at 13:15

1 Answers1

0

If you are still looking for the solution: 7 bytes seems to be a bit high for importing a key... ;)

The ACL in the data block is only six bytes, so this might cause your error. The following "optional parameters" are AFAIK completely unused.