WinVerifyTrust to check for a specific signature?

后端 未结 4 2059

I\'m implementing a process elevation helper for Windows. It\'s a program that will run in elevated mode and launch other programs with administrator privileges without disp

4条回答
  •  庸人自扰
    2020-12-01 12:00

    To get the certificate information from signed code use this:

    using System.Security.Cryptography.X509Certificates;
    X509Certificate basicSigner = X509Certificate.CreateFromSignedFile(filename);
    X509Certificate2 cert = new X509Certificate2(basicSigner);
    

    Then you can get the cert details like this:

    Console.WriteLine(cert.IssuerName.Name);
    Console.WriteLine(cert.SubjectName.Name);
    // etc
    

提交回复
热议问题