After locking myself our of one 6131 phone, and coming very close to doing the same with a second I thought I'd post a bit about my experience.
It's mentioned in the SDK User Guide however **Do not try and authenticate more than 10 times incorrectly. This will lock the element and prevent adding/deleting permenantly. There is no way Nokia can unlock this. **
Once the unlock midlet has been obtained and run through the phone, the following information is known (from the SDK User Guide):
ENC, MAC and KEY keys are all "404142434445464748494A4B4C4D4E4F".
The Keyset is "42".
Authentication must be done with "ENC & MAC" , which is Secure Channel Protocol 02 (SCP02)
The card follows GlobalPlatform specificaion 2.1.1
In order to talk to the secure element, APDUs must be sent, however it is not practical to just send these straight to the phone - some deployment tool must be used. I was unable to get the Sun JCDK (Java Card Development Kit) to interact with my cardreader (Cardman 5321), a co-worker had JLoad by Giesecke & Devrient, however this was too old to support spec 2.1.1 and the Sm@rtCafe toolkit is very expensive.
The GlobalPlatform sourceforce project (http://sourceforge.net/projects/globalplatform/) isn't directly related to the GlobalPlatform specification although does try and implement it. The latest GPShell tool does support spec 2.1.1 however it seems to have issues with the SCP02 (Check the mailing list for some thoughts, however I didn't fully understand it all).
JCOP is the tool that most people seem to talk about, however is also the hardest to obtain. IBM were working on it, however it is now tranfered to NXP - all requests are to be sent to NXP and I haven't heard of anyone actually getting a response from them. I eventually came across the site http://www.cs.ru.nl/~erikpoll/ooti2007/env_setup.txt which includes a working link to a download site. The easiest way to activate the plugin is to purchase a JCOP Engineering Sample Card - I got one from www.motechno.com for 50Euro; based in Germany but they do ship internationally starting at 9Euro (next day via FedEx is 29Euro). They don't actually list the card as a product on the site but e-mail them and they will confirm cost and provide a paypal link to send payment.
Once JCOP is activated bring up the JCOP shell and connect to Terminal (left icon on the top right), put the phone on the reader (activate secure application) and type in "/card"
> /card
--Waiting for card...
ATR=3B 88 80 01 00 73 C8 40 13 00 90 00 71 ;....s.@....q
ATR: T=0, T=1, Hist=0073C84013009000
=> 00 A4 04 00 07 A0 00 00 00 03 00 00 00 .............
(38813 usec)
<= 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 o..............e
01 FF 90 00 ....
Status: No Error
Then set the 3 different keys:
"set-key 42/1/DES-ECB/404142434445464748494A4B4C4D4E4F 42/2/DES-ECB/404142434445464748494A4B4C4D4E4F 42/3/DES-ECB/404142434445464748494A4B4C4D4E4F"
Start the authentication process with "init-update 42":
cm> init-update 42
=> 80 50 2A 00 08 C6 1E FE E6 7E 82 C8 5E 00 .P*......~..^.
(114726 usec)
<= 00 00 63 42 80 07 F6 A8 01 09 2A 02 00 0A FB 59 ..cB......*....Y
58 D6 62 71 DC 24 74 F9 04 54 15 F6 90 00 X.bq.$t..T....
Status: No Error
Finaly, perform external authentication "ext-auth enc":
cm> ext-auth enc
=> 84 82 03 00 10 98 2D 3D 7F F6 D8 78 F3 14 7C DD ......-=...x..|.
09 54 DF 6E BF .T.n.
(42657 usec)
<= 90 00 ..
Status: No Error
Confirm this is working by running "card-info":
cm> card-info
....
Card Manager AID : A000000003000000
Card Manager state : SECURED
Application: SELECTABLE (---L----) D276000005AB0503E0040101
Application: SELECTABLE (--------) D276000005AA0503E0050101
Application: SELECTABLE (--------) "HelloApplet.app"
Load File : LOADED (--------) A0000000035350 (Security Domain)
Load File : LOADED (--------) D276000005AA040360010410
Load File : LOADED (--------) D276000005AA0503E00401
Load File : LOADED (--------) D276000005AA0503E00501
Load File : LOADED (--------) "HelloApplet"
help <command> will bring up help for the different command and provide different options e.g. all the key types on set-key and authentication levels on ext-auth.
I'm still working on being able to write applets that sit in the secure element and midlets that interact with them - the InternalSecureCardMIDlet provided with the SDK doesn't work for me. If anyone works this out, feel free to tell me how you did it.
Hope the above helps.
-Jeff

Reply With Quote


