1) select Card Manager byte[] selectAPDU = Uti.asHex("00A4 0400 08 A000000003000000 ");
2) get data p2 = E0 APDU "80 CA 00 E0 00"
this returns E024C00401018010C00402018010C00403018010C00401038010C00402038010C00403038010
which we can unpack knowing tags E0 and C0 as
E024
C004 01018010 id = 01 vers = 01 type = 80 (DES) length = 10 (16 decimal)
C004 02018010
C004 03018010
C004 01038010 version 03 I believe this is after me adding version 3 keys...
C004 02038010
C004 03038010
with tag C1 and CLA 00 get get data C1 <<<00BD>>>Sequence Counter of the default Key Version Number ???
with tag C1 and CLA 80 C10200C5 which looks better sequence counter (?) is C5 ???
This is said to be used to derive session keys??
In practice we use the 108100..00 derivation data, so when is this sequence counter used??
It is said that only SCP02 responds to C1,so there's a test for you...
Note the GetData CLA can be 00 or 80 80 is better.....
there is an undocumented CLA of FF which returns 2DB3BB28 irrespective of p2 .....
seems to be uid String getUID = "FF CA 00 00 00";
------------------------------------
get data tag 66
664C
734A
0607 2A864886FC6B01
600C 060A 2A864886FC6B 02 020101 211 ie GPCard Spec 2.1.1
6309 0607 2A864886FC6B 03 IIN and CIN not seen here...
640B 0609 2A864886FC6B 04 0215 scp 02 i 15 'implementation option'
650B 0609 2B8510864864020103 GP does not say
660C 060A 2B060104012A026E0102 GP does not say
IIN tag 42 not seen here
CIN tag 45 not seen here
2A864886FC6B seems to be {globalPlatform}
12840114283 dec -> 2FD54986B Hex
{iso(1) member-body(2) country-USA(840) Global-Platform(114283)}
so do I decode these few items the 'hard' way
or do I find a library for ISO/IEC 7816-4 structure.
(the 'difficult' way)
---------------------------------------------------------
No comments:
Post a Comment