// call WinTrust.WinVerifyTrust() to check embedded file signature public static bool VerifyEmbeddedSignature(string fileName, WinVerifyTrustResult expectedResult) { WinTrustData wtd = new WinTrustData(fileName); Guid guidAction = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2); WinVerifyTrustResult result = WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd); bool ret = (result == expectedResult); return(ret); }
static extern WinVerifyTrustResult WinVerifyTrust( [In] IntPtr hwnd, [In][MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID, [In] WinTrustData pWVTData );