输入条件:SysKind=0--->EasmChip的操作,SysKind=1-->CpuCard的操作,KeyId密钥标识符
输出项目:RetData=0x00操作成功;RetData=0xFF此操作失败。
unsigned char Externalauthen(bool SysKind,unsigned char KeyId) { CmdBuf[CLA] = 0x00; CmdBuf[INS] = 0x82; CmdBuf[P01] = 0x00; CmdBuf[P02] = KeyId; CmdBuf[P03] = 0x08;//---------------------------------------------------CARD CpuCardSdaDirIn; if(!(CpuCardSdaInSt&BIT5)) { return 0xFF;//----------------------------------------------------------无卡 } CosCommand(SysKind,2,8);//----------------------------------------------CARD if( (SwBuf[0] == 0x90) && (SwBuf[1] == 0x00) ) { return 0x00; } else { return 0xff; } }