I'm using CAPICOM in a .NET 3.0 C# app to check an Authenticode signature on an exe file. I need to make sure that the certificate is listed as a Trusted Publisher. Using signedCode.Verify(true)
will show a dialog if the certificate is not already trusted, so the user can choose whether or not to do so. However, signedCode.Verify(false)
is verifying the signature even if it is not from a trusted publisher - presumably this is only checking that the certificate is valid.
How can I check that the signature on a file is from a valid and trusted certificate without the UI?