예제 #1
0
        // 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);
        }
예제 #2
0
 static extern WinVerifyTrustResult WinVerifyTrust(
     [In] IntPtr hwnd,
     [In][MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,
     [In] WinTrustData pWVTData
     );