个性化智能卡上的私钥

时间:2015-09-15 13:07:15

标签: smartcard apdu

我对私钥和公钥容器上的PUT DATA命令有一些问题。

根据我的规范,这些容器不接受GENERATE ASYMMETRIC KEY PAIR命令,只接受PUT DATA安全消息传递。

00 DB 3FFF Lc [DATA]

以下是应用安全消息传递之前的数据:

70 82 029F 
    BF9005 82 0299
        7F48 82 0294 
            92 81 81 00fd5ab35d5ce5cfc2b7e9549330f121079cc10135647e9093a713d1897b582b5629615e3f8d2523bef4f884ff2ea18342f81944322f7c2ed9f1648874578aea1c3b12700abe86283b4cd5727922c7d25a0a319829c051266c42039c4383d272ab7d3ffd2bdb0f620bc1e37c2c2c4b54ba3698c375b18f694b5b62e2cb458a981f
            93 81 81 00df8c67d5094e3a11c19fd67ca988e80d886f723f9af3db43f5e30f85eb1f405c266f3149824aec7c67172289c5996755ca06dee83a2285cf8621822afd03f88e0324b04d400ef73325291ef7665f1368b6d25ba85417e2b41a501113493b406569b7cf00bb3936cb0a3662e4592d94d811c26efe03cc35f0890077eca3ce2f57
            94 81 81 0090c88ab961c2b15c8269bdd151fe9703d81ddea623be610b02d7c24c81ad4b5b51e4f805215f867a782256859cfe1923f12047673d67d712cdeca0dff32494d3a3038200740b681d5b8849fa05c92b2fa07f7985e4a9a30ed9298c61d0ccf17abce7bdd3bcb93502ef54519752afc520967107c917006dab7d27c9747126d8ce
            95 81 81 00c2f9011df176fe1b48b36d1dd5454bf8f2be6972b082e23a6f12c6677a1fd141fe986b129749a4a7b918642989b64c30c6839342d7de46a3fcac3482ec38009077396a362a874e00ccd15ac63468f8cdc818809468e74a9d777415d6b364ca508514307e8697e109514e02ea6fb00d653cccf566e69d8a17af1d7b919953de5b
            96 81 81 0090c88ab961c2b15c8269bdd151fe9703d81ddea623be610b02d7c24c81ad4b5b51e4f805215f867a782256859cfe1923f12047673d67d712cdeca0dff32494d3a3038200740b681d5b8849fa05c92b2fa07f7985e4a9a30ed9298c61d0ccf17abce7bdd3bcb93502ef54519752afc520967107c917006dab7d27c9747126d8ce

我使用10 CLA按数据包发送此数据。 应用安全消息传递后,我的CLA变为:1C0C,用于最后一个命令。

以下是安全消息传递之前的APDU,但链接之后:

10DB3FFF6c7082029FBF90058202997F4882029492818100fd5ab35d5ce5cfc2b7e9549330f121079cc10135647e9093a713d1897b582b5629615e3f8d2523bef4f884ff2ea18342f81944322f7c2ed9f1648874578aea1c3b12700abe86283b4cd5727922c7d25a0a319829c051266c42
10DB3FFF6c039c4383d272ab7d3ffd2bdb0f620bc1e37c2c2c4b54ba3698c375b18f694b5b62e2cb458a981f93818100df8c67d5094e3a11c19fd67ca988e80d886f723f9af3db43f5e30f85eb1f405c266f3149824aec7c67172289c5996755ca06dee83a2285cf8621822afd03f88e03
10DB3FFF6c24b04d400ef73325291ef7665f1368b6d25ba85417e2b41a501113493b406569b7cf00bb3936cb0a3662e4592d94d811c26efe03cc35f0890077eca3ce2f579481810090c88ab961c2b15c8269bdd151fe9703d81ddea623be610b02d7c24c81ad4b5b51e4f805215f867a78
10DB3FFF6c2256859cfe1923f12047673d67d712cdeca0dff32494d3a3038200740b681d5b8849fa05c92b2fa07f7985e4a9a30ed9298c61d0ccf17abce7bdd3bcb93502ef54519752afc520967107c917006dab7d27c9747126d8ce95818100c2f9011df176fe1b48b36d1dd5454bf8f2
10DB3FFF6cbe6972b082e23a6f12c6677a1fd141fe986b129749a4a7b918642989b64c30c6839342d7de46a3fcac3482ec38009077396a362a874e00ccd15ac63468f8cdc818809468e74a9d777415d6b364ca508514307e8697e109514e02ea6fb00d653cccf566e69d8a17af1d7b9199
10DB3FFF6c53de5b9681810090c88ab961c2b15c8269bdd151fe9703d81ddea623be610b02d7c24c81ad4b5b51e4f805215f867a782256859cfe1923f12047673d67d712cdeca0dff32494d3a3038200740b681d5b8849fa05c92b2fa07f7985e4a9a30ed9298c61d0ccf17abce7bdd3bc
00DB3FFF1bb93502ef54519752afc520967107c917006dab7d27c9747126d8ce

每次卡片都会给我一个状态字:6A80,这意味着命令中的数据不正确

我还试过RSA公钥容器,我读了公共数据:

70 82 011E 
    BFA005 82 0118 
        7F49 82 0113 
            80 01 1A 
            81 82 0100 D2E4E1BA0228DBB12F3274CB27E33492C3525B198D778D00F0404900B956C7B4013ECDE01FBDFAC68B037339F8847E9BDC69F1AD2B177C93621305D3660A8A4E2085F85E9B030DA6AC35342249ACBD18563F9B72E7955D02E94098E675623DC9E870E761D27ED2926538DF62F8722C97D9450DA8E05F168F9C42F1EE885C446B613BF549B962022DD6BD6C8FBCF4BD9D7000DC189495C768A88B40D090D1EF01065F815E8A9904620A7E5B44C917168C1C2B35E428CC0E39A22768F5C8BA65346AD35C03813F46C44B80830343F23DB471ACE99B6AE03987B822CB37ED541DB5B29239D31197170A7F9671C0F23DC8C1B4C655EF901BB91BEE716C4999919ADF
            82 04 00010001
            5F4C 00 
            5F20 00 

删除了一些内容(例如5F20 tag, 80 tag

70 82 0115
    BFA005 82 010F
        7F49 82 010A 
            81 82 0100 D2E4E1BA0228DBB12F3274CB27E33492C3525B198D778D00F0404900B956C7B4013ECDE01FBDFAC68B037339F8847E9BDC69F1AD2B177C93621305D3660A8A4E2085F85E9B030DA6AC35342249ACBD18563F9B72E7955D02E94098E675623DC9E870E761D27ED2926538DF62F8722C97D9450DA8E05F168F9C42F1EE885C446B613BF549B962022DD6BD6C8FBCF4BD9D7000DC189495C768A88B40D090D1EF01065F815E8A9904620A7E5B44C917168C1C2B35E428CC0E39A22768F5C8BA65346AD35C03813F46C44B80830343F23DB471ACE99B6AE03987B822CB37ED541DB5B29239D31197170A7F9671C0F23DC8C1B4C655EF901BB91BEE716C4999919ADF
            82 04 00010001

所以数据很好,它们来自容器本身。

在应用安全消息之前我的apdu:

10DB3FFF4070820115BFA00582010F7F4982010A81820100D2E4E1BA0228DBB12F3274CB27E33492C3525B198D778D00F0404900B956C7B4013ECDE01FBDFAC68B037339F8
10DB3FFF40847E9BDC69F1AD2B177C93621305D3660A8A4E2085F85E9B030DA6AC35342249ACBD18563F9B72E7955D02E94098E675623DC9E870E761D27ED2926538DF62F8
10DB3FFF40722C97D9450DA8E05F168F9C42F1EE885C446B613BF549B962022DD6BD6C8FBCF4BD9D7000DC189495C768A88B40D090D1EF01065F815E8A9904620A7E5B44C9
10DB3FFF4017168C1C2B35E428CC0E39A22768F5C8BA65346AD35C03813F46C44B80830343F23DB471ACE99B6AE03987B822CB37ED541DB5B29239D31197170A7F9671C0F2
00DB3FFF193DC8C1B4C655EF901BB91BEE716C4999919ADF820400010001

在这里,我得到了6A80

卡片ATR:3B7F1800000031B8645023ECC173940180829000

我的申请自2年起开始投入生产。核心(APDU的传输,安全消息传递管理器等)工作正常。

这里是规范的摘录:http://hpics.li/7eb3240(不能将图片放在堆栈上)

有人知道我的APDU有什么问题吗?

0 个答案:

没有答案