Beispiel #1
0
        /// <summary>
        /// Получить список получателей зашифрованного файла
        /// </summary>
        /// <param name="file">Зашифрованный файл</param>
        /// <remarks>wftesto.exe g file.cry</remarks>
        public static int GetAbonents(string file)
        {
            int ret;

            if ((ret = Wbotho.CryptoInit("", "")) > 0)
            {
                Console.WriteLine("CryptoInit error : {0}", ret);
                return(ret);
            }
            ushort count;

            ushort[] list;
            if ((ret = Wbotho.GetCryptKeysF(file, out count, out list, "")) > 0)
            {
                Console.WriteLine("GetCryptKeysF error : {0}", ret);
                return(ret);
            }
            Wbotho.CryptoDone();
            Console.WriteLine("File {0} is encrypted for these abonents :", file); //новое: исправлено слово
            for (int i = 0; i < count; i++)
            {
                Console.WriteLine("ID{0} - {1}", i + 1, list[i]);
            }
            Wbotho.FreeMemory(list);
            return(ret);
        }