输入条件:SysKind=0--->EasmChip的操作,SysKind=1-->CpuCard的操作,KeyId密钥标识符
输出项目:RetData=0x00操作成功;RetData=0xFF此操作失败。
unsigned char Internalauthen(bool SysKind,unsigned char KeyId) { unsigned char i,Ret; Ret=0xff; CmdBuf[CLA] = 0x00; CmdBuf[INS] = 0x88; CmdBuf[P01] = 0x00; CmdBuf[P02] = KeyId; CmdBuf[P03] = 8; for(i = 0; i < 3; i ++) { CosCommand(SysKind,2,8); if( SwBuf[0] == 0x61 ) { Ret = GetResponse(SysKind,SwBuf[1]=SwBuf[1]&0x0f); if(Ret == 0) { break; } } } if(i < 3) { return 0x00; } else { return 0xff; } }