我正在使用以下代码来验证特定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)的签名。该代码无助于检查第三方签名。 我该怎么办?