输入条件:KeyId密钥标识符
输出项目:RetData=0x00操作成功;RetData=0xFF此操作失败。
更改密钥,80/84,D4,01/3x,apduidc,lc,keydata;入口:无;出口0x00此操作成功,0xFF此操作失败
unsigned char EsamChipChangeKey(unsigned char Sign, unsigned char Flag) { unsigned char i; CmdBuf[CLA] = 0x84; CmdBuf[INS] = 0xD4; CmdBuf[P01] = Sign; CmdBuf[P02] = Flag; CmdBuf[P03] = 0x18; for(i = 0; i < 5; i ++) { CosCommand(0,2,0x18); if((SwBuf[0] == 0x90) && (SwBuf[1] == 0x00)) { break; } } if(i < 5) { return 0x00; } else { return 0xff; } }