예제 #1
0
        /// <summary>
        /// 根据文件标识选择文件ID
        /// </summary>
        /// <returns></returns>
        public ApduMsg SelectFileById(ushort fileId)
        {
            string cmd = "00A4000002";

            byte[] data = SendStrCommand(cmd + CPUCardHelper.ConvertoHEX(fileId, 4));
            return(ApduMsg.GetApduByData(data));
        }
예제 #2
0
 public override string ToString()
 {
     return(string.Format("CLA:{0},INS:{1} P1:{2} P2:{3} LC:{4} Data:{5} LE:{6} MSG \r\n",
                          CPUCardHelper.ConvertoHEX(CLA),
                          CPUCardHelper.ConvertoHEX(INS),
                          CPUCardHelper.ConvertoHEX(P1),
                          CPUCardHelper.ConvertoHEX(P2),
                          CPUCardHelper.ConvertoHEX(LC),
                          BitConverter.ToString(Data),
                          CPUCardHelper.ConvertoHEX(LE.Value),
                          Msg));
 }
예제 #3
0
        public static string GetSendCmdNote(byte CLA,byte INS) 
        {
            string CLAStr  = CPUCardHelper.ConvertoHEX(CLA);
            string INSStr = CPUCardHelper.ConvertoHEX(INS);
            string cmd = CLAStr + INSStr;
            if (AllSendMsgDic.TryGetValue(cmd, out string msg))
            {
                return msg;
            }
            return "未找到指令" + cmd;


        }
예제 #4
0
 public override string ToString()
 {
     try
     {
         return(CmdNote + "\r\n" + string.Format("CLA:{0},INS:{1} P1:{2} P2:{3} LC:{4} Data:{5} LE:{6} MSG \r\n",
                                                 CPUCardHelper.ConvertoHEX(CLA),
                                                 CPUCardHelper.ConvertoHEX(INS),
                                                 CPUCardHelper.ConvertoHEX(P1),
                                                 CPUCardHelper.ConvertoHEX(P2),
                                                 CPUCardHelper.ConvertoHEX(LC),
                                                 BitConverter.ToString(Data),
                                                 CPUCardHelper.ConvertoHEX((LE) ?? (ushort)0),
                                                 Msg));
     }
     catch (Exception ex)
     {
         return("解析命令出错" + ex.Message);
     }
 }