C# 获取文件的数字签名信息

来源:互联网 发布:centos 格式化u盘 编辑:程序博客网 时间:2024/05/22 19:12

using System.Security.Cryptography.X509Certificates;

 

X509Certificate cert = X509Certificate.CreateFromSignedFile(filename);

 

如果是要取文件的'name of signer',在cert.Subject属性中取CN值。

 

还有一个方式是调用Win API, 参考MSDN这篇文章<How To Get Information from Authenticode Signed Executables>