Пример #1
0
        public APDUResponse ProcessCommand(string cmdClass, string cmdIns, APDUParam apduParam)
        {
            byte        bClass      = byte.Parse(cmdClass, NumberStyles.AllowHexSpecifier);
            byte        bIns        = byte.Parse(cmdIns, NumberStyles.AllowHexSpecifier);
            APDUCommand apduCommand = new APDUCommand(bClass, bIns, 0, 0, null, 0);

            apduCommand.Update(apduParam);

            return(ExecuteApduCommand(apduCommand));
        }
Пример #2
0
        /// <summary>
        /// Process a simple APDU command, Parameters can be provided in the APDUParam object
        /// </summary>
        /// <param name="command">APDU command name</param>
        /// <param name="apduParam">Parameters for the command</param>
        /// <returns>An APDUResponse object with the response of the card </returns>
        public APDUResponse ProcessCommand(string apduName, APDUParam apduParam)
        {
            APDUCommand apduCmd = null;

            // Get the base APDU
            apduCmd = APDUByName(apduName);
            if (apduCmd == null)
            {
                throw new ApduCommandException(ApduCommandException.NoSuchCommand);
            }

            apduCmd.Update(apduParam);

            return(ExecuteApduCommand(apduCmd));
        }