Пример #1
0
        private static void RevokeCertificate()
        {
            try
            {
                string           myName      = WindowsIdentity.GetCurrent().Name.Split('\\')[1];
                X509Certificate2 certificate = CertManager.GetCertificateFromStorage(StoreName.My, StoreLocation.LocalMachine, myName);

                NetTcpBinding binding = new NetTcpBinding();
                InitializeWindowsAuthentication(binding);
                EndpointAddress address          = new EndpointAddress(new Uri(ConfigurationSettings.AppSettings.Get("CMSProxy")));
                var             callbackInstance = new ServerCallback();
                cmsClient.RevokeCertificate(certificate);

                Console.WriteLine("Certificate CN={0} successfully revoked!", myName);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }