Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- X509Certificate theSigner = X509Certificate.CreateFromSignedFile ("c:\r\1.dll");
- Console.Write("certificate info :"+ theSigner.GetCertHashString());
- }
- catch (Exception ex)
- {
- Console.WriteLine("No digital signature ");
- }
- using System.Security.Cryptography.X509Certificates;
- namespace ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Выбираем и открываем хранилище с сертификатами
- var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
- store.Open(OpenFlags.ReadOnly);
- //Проходим по всем сертификатам и что то с ними делаем
- foreach (X509Certificate2 cert in store.Certificates)
- {
- //В данном участке кода будут все сертификаты из указанного хранилища
- }
- //Закрываем хранилище
- store.Close();
- }
- }
- }
Add Comment
Please, Sign In to add comment