Exemplo n.º 1
0
        public static WinVerifyTrustResult VerifyEmbeddedSignature(string fileName)
        {
            using var wtfi = new WinTrustFileInfo(fileName);
            using var wtd  = new WinTrustData(wtfi);
            var guidAction = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2);

            return(WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd));
        }
Exemplo n.º 2
0
        public static bool VerifyEmbeddedSignature(string fileName)
        {
            using var wtfi = new WinTrustFileInfo(fileName);
            using var wtd  = new WinTrustData(wtfi);
            var guidAction = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2);
            var result     = WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd);

            return(result == WinVerifyTrustResult.Success ||
                   result == WinVerifyTrustResult.UntrustedRoot ||
                   result == WinVerifyTrustResult.CertChaining);
        }
Exemplo n.º 3
0
 private static extern WinVerifyTrustResult WinVerifyTrust(
     [In] IntPtr hwnd,
     [In][MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,
     [In] WinTrustData pWVTData
     );