The easiest way I can think of is to use powershell, but from within managed code:
using System.Management.Automation;
void Foo(string path) {
PowerShell shell = PowerShell.Create();
shell.AddScript(String.Format("Get-AuthenticodeSignature {0}", path));
Signature sig = shell.Invoke()[0] as Signature;
bool isValid = sig.Valid;
}
(from memory, therefore, it cannot be completely syntactically correct)
source
share