// call WinTrust.WinVerifyTrust() to check embedded file signature
        public static bool VerifyEmbeddedSignature(string fileName)
        {
            WinTrustFileInfo wtfi = null;
            WinTrustData     wtd  = null;

            try
            {
                wtfi = new WinTrustFileInfo(fileName);
                wtd  = new WinTrustData(wtfi);
                Guid guidAction             = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2);
                WinVerifyTrustResult result = WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd);
                return(result == WinVerifyTrustResult.Success);
            }
            finally
            {
                wtfi?.Dispose();
                wtd?.Dispose();
            }
        }
 private static extern WinVerifyTrustResult WinVerifyTrust(
     [In] IntPtr hwnd,
     [In][MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,
     [In] WinTrustData pWVTData
     );