Esempio n. 1
0
        // call WinTrust.WinVerifyTrust() to check embedded file signature
        public static bool VerifyEmbeddedSignature(string fileName)
        {
            WinTrustFileInfo     wtfi       = new WinTrustFileInfo(fileName);
            WinTrustData         wtd        = new WinTrustData(wtfi);
            Guid                 guidAction = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2);
            WinVerifyTrustResult result     = WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd);
            bool                 ret        = (result == WinVerifyTrustResult.Success);

            wtfi.Dispose();
            wtd.Dispose();
            return(ret);
        }
Esempio n. 2
0
 static extern WinVerifyTrustResult WinVerifyTrust(
     [In] IntPtr hwnd,
     [In][MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,
     [In] WinTrustData pWVTData
     );