private void LoadKeyCommand(ISecureChannel session, string description, byte keySlot, LoadKeyCommand.KeyType keyType, LoadKeyCommand.Persistence persistence, LoadKeyCommand.Transmission transmission, LoadKeyCommand.KeyLength keyLength, string key)
            {
                var loadKeyCommand = new Readers.AViatoR.Components.LoadKeyCommand();

                string input  = loadKeyCommand.GetApdu(keySlot, keyType, persistence, transmission, keyLength, key);
                string output = session.SendCommand(input);

                ConsoleWriter.Instance.PrintCommand(description + key, input, output);
            }
Esempio n. 2
0
        public static void ReadBinaryiClassCommand(ISecureChannel secureChannel, string description, ReadBinaryCommand.ReadOption readOption, byte blockNumber, byte expectedlength, BookNumber book = BookNumber.Book0, PageNumber page = PageNumber.Page0)
        {
            var readBinaryCommand = new Readers.AViatoR.Components.ReadBinaryCommand();

            string input  = readBinaryCommand.GetiClassReadApdu(readOption, blockNumber, expectedlength, book, page);
            string output = secureChannel.SendCommand(input);

            ConsoleWriter.Instance.PrintCommand(description + "0x" + blockNumber.ToString("X2"), input, output);
        }
Esempio n. 3
0
        public static void GeneralAuthenticateiClass(ISecureChannel secureChannel, string description, BookNumber book, PageNumber page, GeneralAuthenticateCommand.ImplicitSelection implicitSelection, GeneralAuthenticateCommand.iClassKeyType keyType, byte keySlot)
        {
            var generalAuthenticateCommand = new Readers.AViatoR.Components.GeneralAuthenticateCommand();

            string input =
                generalAuthenticateCommand.GetiClassApdu(book, page, implicitSelection, keyType, keySlot);
            string output = secureChannel.SendCommand(input);

            ConsoleWriter.Instance.PrintCommand(description + keySlot.ToString("X2"), input, output);
        }
Esempio n. 4
0
        public static void UpdateBinaryCommand(ISecureChannel secureChannel, string description, UpdateBinaryCommand.Type type, byte blockNumber, string data)
        {
            var updateBinaryCommand = new UpdateBinaryCommand();

            string input = updateBinaryCommand.GetApdu(Readers.AViatoR.Components.UpdateBinaryCommand.Type.Plain,
                                                       blockNumber, data);
            string output = secureChannel.SendCommand(input);

            ConsoleWriter.Instance.PrintCommand(description + "0x" + blockNumber.ToString("X2"), input, output);
        }
Esempio n. 5
0
        public static void UpdateBinaryCommand(ISecureChannel secureChannel, string description, UpdateBinaryCommand.Type type, byte blockNumber, string data)
        {
            var updateBinaryCommand = new UpdateBinaryCommand();

            string input = updateBinaryCommand.GetApdu(Readers.AViatoR.Components.UpdateBinaryCommand.Type.Plain,
                                                       blockNumber, data);
            string output = secureChannel.SendCommand(input);

            Console.WriteLine($"0x{blockNumber.ToString("X2")}  Input: {input}  Output: {output}");
        }