无法获取dll文件的第三方数字签名

时间:2019-02-25 13:02:06

标签: c# digital-signature

我正在使用以下代码来验证特定dll的签名:

 var runspaceConfiguration = RunspaceConfiguration.Create();
        using (var runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration))
        {
            runspace.Open();
            using (var pipeline = runspace.CreatePipeline())
            {
                pipeline.Commands.AddScript(scriptCommand);
                var results = pipeline.Invoke();
                runspace.Close();

                var signature = results[0].BaseObject as Signature;
                if (signature.Status != SignatureStatus.NotSigned)
                {
                    Console.WriteLine(signature.StatusMessage);
                }

            }
        }

在dll的属性中,我可以看到Microsoft(sha256)和第三方(sha1)的签名。该代码无助于检查第三方签名。 我该怎么办?

0 个答案:

没有答案