Example #1
0
        /// <summary>
        /// Выгрузить все ключи из памяти драйвера (новое)
        /// </summary>
        /// <remarks>wftesto.exe r</remarks>
        public static int ResetKeys()
        {
            int        ret;
            SlotsTable table = new SlotsTable();

            table.Slots = new UsrKeysInfo[16];
            uint count;

            if ((ret = Wbotho.GetDrvInfo(ref table, out count)) > 0)
            {
                Console.WriteLine("GetDrvInfo error : {0}", ret);
                return(ret);
            }
            for (int i = 0; i < count; i++)
            {
                if (table.Slots[i].Num[0] != '\0') //crypto
                {
                    ret += ResetKey(table.Slots[i].Num);
                }
                else if (table.Slots[i].Nump[0] != '\0') //sign
                {
                    ret += ResetKey(table.Slots[i].Nump);
                }
            }
            return(ret == 0 ? ret : 1);
        }
Example #2
0
        /// <summary>
        /// Получить перечень загруженных в память драйвера ключей
        /// </summary>
        /// <remarks>wftesto.exe l</remarks>
        public static int ListKeys()
        {
            int        ret;
            SlotsTable table = new SlotsTable();

            table.Slots = new UsrKeysInfo[16];
            uint count;

            if ((ret = Wbotho.GetDrvInfo(ref table, out count)) > 0)
            {
                Console.WriteLine("GetDrvInfo error : {0}", ret);
                return(ret);
            }
            Console.WriteLine();
            Console.Write("DrvInfo:");
            for (int i = 0; i < count; i++)
            {
                Console.WriteLine();
                Console.WriteLine("Slot : {0}", table.Slots[i].KeySlotNumber);
                Console.WriteLine("NUM  : {0}", table.Slots[i].Num);
                Console.WriteLine("NUMP : {0}", table.Slots[i].Nump);
            }
            return(ret);
        }
Example #3
0
 public static extern ushort GetDrvInfo(ref SlotsTable table, out uint count);