0

我正在尝试将FFFFFFFFFFFF密钥加载到omnikey 5321 阅读器的易失性内存中。但我得到一个错误SW1 SW2: 69 86。谁能建议为什么?(也许omnikey 不支持编写易失键?)。

这是代码:

bcla = 0xFF;
bins = 0x82;
bp1 =0x0     // Load key in volatile memory
bp2 = 0x20  // store in the volatile memory
len = 0x6;       // Length = 6 bytes
sendBuffer[0] = bcla;
sendBuffer[1] = bins;
sendBuffer[2] = bp1;
sendBuffer[3] = bp2;
sendBuffer[4] = len;

// Now, copy the actual key to the send buffer
for (int k =0 ;k<=5;k++)
         sendBuffer[k + 5] = str3[k]; // This will copy FFFFFFFFFFFF key


// then make call to scardtransmit.. also set length of send buffer to 11
4

1 回答 1

1

69 86 表示"Command not Allowed"

尝试这个.....

CLA = FF

INS = 82

P1 = 00

P2 = 60/61(密钥 ID,密钥 A 为 60,密钥 B 为 61)

Lc = 06(数据字段中的密钥长度)

数据字段 = 6 个字节的密钥值

例子:

FF 82 00 60 06 FFFFFFFFFFFF

于 2013-09-17T05:15:18.797 回答