243 references to Win32
System.Windows.Forms (243)
parent\parent\parent\public\Internal\NDP\Inc\mansign.cs (86)
351throw new CryptographicException(Win32.TRUST_E_NOSIGNATURE); 361throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 369throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 385throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 394throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 427throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 435throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 456throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 464m_strongNameSignerInfo = new CmiStrongNameSignerInfo(Win32.TRUST_E_FAIL, publicKeyToken); 474m_strongNameSignerInfo.ErrorCode = Win32.TRUST_E_BAD_DIGEST; 475throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 518m_authenticodeSignerInfo = new CmiAuthenticodeSignerInfo(Win32.TRUST_E_FAIL); 523Win32.AXL_SIGNER_INFO signerInfo = new Win32.AXL_SIGNER_INFO(); 524signerInfo.cbSize = (uint) Marshal.SizeOf(typeof(Win32.AXL_SIGNER_INFO)); 525Win32.AXL_TIMESTAMPER_INFO timestamperInfo = new Win32.AXL_TIMESTAMPER_INFO(); 526timestamperInfo.cbSize = (uint) Marshal.SizeOf(typeof(Win32.AXL_TIMESTAMPER_INFO)); 527Win32.CRYPT_DATA_BLOB licenseBlob = new Win32.CRYPT_DATA_BLOB(); 532int hr = Win32.CertVerifyAuthenticodeLicense(ref licenseBlob, (uint) verifyFlags, ref signerInfo, ref timestamperInfo); 533if (Win32.TRUST_E_NOSIGNATURE != (int) signerInfo.dwError) { 537Win32.CertFreeAuthenticodeSignerInfo(ref signerInfo); 538Win32.CertFreeAuthenticodeTimestamperInfo(ref timestamperInfo); 540if (hr != Win32.S_OK) { 559throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 569throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 575throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 581throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 590if (m_authenticodeSignerInfo.ErrorCode == Win32.TRUST_E_NOSIGNATURE) { 599throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 604throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 612int hr = Win32._AxlGetIssuerPublicKeyHash(signerCert.Handle, ref pIssuerKeyHash); 613if (hr != Win32.S_OK) { 618Win32.HeapFree(Win32.GetProcessHeap(), 0, pIssuerKeyHash); 623throw new CryptographicException(Win32.TRUST_E_FAIL); 636throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 640throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 645throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 654throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 670throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 675throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 690throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 695throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 715throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 728Win32.CRYPT_DATA_BLOB modulusBlob = new Win32.CRYPT_DATA_BLOB(); 729Win32.CRYPT_DATA_BLOB exponentBlob = new Win32.CRYPT_DATA_BLOB(); 738int hr = Win32._AxlRSAKeyValueToPublicKeyToken(ref modulusBlob, ref exponentBlob, ref pComputedToken); 739if (hr != Win32.S_OK) { 744Win32.HeapFree(Win32.GetProcessHeap(), 0, pComputedToken); 751throw new CryptographicException(Win32.TRUST_E_FAIL); 756throw new CryptographicException(Win32.TRUST_E_FAIL); 776throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 788int hr = Win32._AxlGetIssuerPublicKeyHash(signerCert.Handle, ref pIssuerKeyHash); 789if (hr != Win32.S_OK) 795Win32.HeapFree(Win32.GetProcessHeap(), 0, pIssuerKeyHash); 826throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 830throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 835throw new CryptographicException(Win32.NTE_BAD_KEY); 841Win32.CRYPT_DATA_BLOB publicKeyBlob = new Win32.CRYPT_DATA_BLOB(); 846int hr = Win32._AxlPublicKeyBlobToPublicKeyToken(ref publicKeyBlob, ref pPublicKeyToken); 847if (hr != Win32.S_OK) { 852Win32.HeapFree(Win32.GetProcessHeap(), 0, pPublicKeyToken); 868throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 887throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 915throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1021Win32.CRYPT_DATA_BLOB timestampBlob = new Win32.CRYPT_DATA_BLOB(); 1032Win32.CRYPT_DATA_BLOB licenseBlob = new Win32.CRYPT_DATA_BLOB(); 1037int hr = Win32.CertTimestampAuthenticodeLicense(ref licenseBlob, timeStampUrl, ref timestampBlob); 1038if (hr != Win32.S_OK) { 1046Win32.HeapFree(Win32.GetProcessHeap(), 0, timestampBlob.pbData); 1073throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1327internal CmiAuthenticodeSignerInfo (Win32.AXL_SIGNER_INFO signerInfo, 1328Win32.AXL_TIMESTAMPER_INFO timestamperInfo) { 1345if ((int) timestamperInfo.dwError != Win32.TRUST_E_NOSIGNATURE) { 1421internal CmiAuthenticodeTimestamperInfo (Win32.AXL_TIMESTAMPER_INFO timestamperInfo) {
parent\parent\parent\public\Internal\NDP\Inc\mansign2.cs (154)
163throw new CryptographicException(Win32.TRUST_E_NOSIGNATURE); 174m_strongNameSignerInfo = new CmiStrongNameSignerInfo(Win32.TRUST_E_FAIL, publicKeyToken); 189m_strongNameSignerInfo.ErrorCode = Win32.TRUST_E_BAD_DIGEST; 190throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 248m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_NOSIGNATURE; 249throw new CryptographicException(Win32.TRUST_E_NOSIGNATURE); 262m_authenticodeSignerInfo = new CmiAuthenticodeSignerInfo(Win32.TRUST_E_FAIL); 269Win32.AXL_SIGNER_INFO signerInfo = new Win32.AXL_SIGNER_INFO(); 270signerInfo.cbSize = (uint)Marshal.SizeOf(typeof(Win32.AXL_SIGNER_INFO)); 271Win32.AXL_TIMESTAMPER_INFO timestamperInfo = new Win32.AXL_TIMESTAMPER_INFO(); 272timestamperInfo.cbSize = (uint)Marshal.SizeOf(typeof(Win32.AXL_TIMESTAMPER_INFO)); 273Win32.CRYPT_DATA_BLOB licenseBlob = new Win32.CRYPT_DATA_BLOB(); 278int hr = Win32.CertVerifyAuthenticodeLicense(ref licenseBlob, (uint)verifyFlags, ref signerInfo, ref timestamperInfo); 279if (Win32.TRUST_E_NOSIGNATURE != (int)signerInfo.dwError) 284Win32.CertFreeAuthenticodeSignerInfo(ref signerInfo); 285Win32.CertFreeAuthenticodeTimestamperInfo(ref timestamperInfo); 287if (hr != Win32.S_OK) 325m_authenticodeSignerInfo = new CmiAuthenticodeSignerInfo(Win32.TRUST_E_FAIL); 331throw new CryptographicException(Win32.TRUST_E_NOSIGNATURE); 354throw new CryptographicException(Win32.TRUST_E_CERT_SIGNATURE); 368m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_FAIL; 369throw new CryptographicException(Win32.TRUST_E_FAIL); 373m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_EXPLICIT_DISTRUST; 374throw new CryptographicException(Win32.TRUST_E_EXPLICIT_DISTRUST); 388m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_SUBJECT_FORM_UNKNOWN; 389throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 423((Win32.WTPF_IGNOREREVOKATION & policies) == Win32.WTPF_IGNOREREVOKATION)) 431chain.ChainPolicy.ApplicationPolicy.Add(new Oid(Win32.szOID_KP_LIFETIME_SIGNING)); 448AuthenticodeSignerInfo.ErrorCode = Win32.TRUST_E_SUBJECT_NOT_TRUSTED; 449throw new CryptographicException(Win32.TRUST_E_SUBJECT_NOT_TRUSTED); 462m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_FAIL; 463throw new CryptographicException(Win32.TRUST_E_FAIL); 467AuthenticodeSignerInfo.ErrorCode = Win32.TRUST_E_SUBJECT_NOT_TRUSTED; 468throw new CryptographicException(Win32.TRUST_E_SUBJECT_NOT_TRUSTED); 480AuthenticodeSignerInfo.ErrorCode = Win32.TRUST_E_CERT_SIGNATURE; 481throw new CryptographicException(Win32.TRUST_E_CERT_SIGNATURE); 523m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_SUBJECT_FORM_UNKNOWN; 524throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 536m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_CERT_SIGNATURE; 537throw new CryptographicException(Win32.TRUST_E_CERT_SIGNATURE); 580m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_CERT_SIGNATURE; 581throw new CryptographicException(Win32.TRUST_E_CERT_SIGNATURE); 598throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 607throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 627throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 637throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 678throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 687throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 712throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 779m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_TIME_STAMP; 780throw new CryptographicException(Win32.TRUST_E_TIME_STAMP); 796if (0 == string.Compare(cao.Oid.Value, Win32.szOID_RSA_signingTime, StringComparison.Ordinal)) 800if (0 == string.Compare(d.Oid.Value, Win32.szOID_RSA_signingTime, StringComparison.Ordinal)) 836m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_TIME_STAMP; 837throw new CryptographicException(Win32.TRUST_E_TIME_STAMP); 850m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_TIME_STAMP; 851throw new CryptographicException(Win32.TRUST_E_TIME_STAMP); 868m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_NO_SIGNER_CERT; 869throw new CryptographicException(Win32.TRUST_E_NO_SIGNER_CERT); 878if ((time == null) && (0 == string.Compare(cao.Oid.Value, Win32.szOID_RSA_signingTime, StringComparison.Ordinal))) 882if (0 == string.Compare(d.Oid.Value, Win32.szOID_RSA_signingTime, StringComparison.Ordinal)) 890else if ((messageDigest == null) && (0 == string.Compare(cao.Oid.Value, Win32.szOID_RSA_messageDigest, StringComparison.Ordinal))) 894if (0 == string.Compare(d.Oid.Value, Win32.szOID_RSA_messageDigest, StringComparison.Ordinal)) 921(e.HResult != Win32.NTE_BAD_HASH)) 928if (algOid == Win32.szOID_NIST_sha256) 932else if (algOid == Win32.szOID_OIWSEC_sha1) 953m_authenticodeSignerInfo.ErrorCode = Win32.NTE_BAD_HASH; 954throw new CryptographicException(Win32.NTE_BAD_HASH); 963m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_TIME_STAMP; 964throw new CryptographicException(Win32.TRUST_E_TIME_STAMP); 984chain.ChainPolicy.ApplicationPolicy.Add(new Oid(Win32.szOID_PKIX_KP_TIMESTAMP_SIGNING)); 993m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_TIME_STAMP; 994throw new CryptographicException(Win32.TRUST_E_TIME_STAMP); 1000m_authenticodeSignerInfo.ErrorCode = Win32.TRUST_E_SUBJECT_NOT_TRUSTED; 1001throw new CryptographicException(Win32.TRUST_E_SUBJECT_NOT_TRUSTED); 1018if (!Win32.CryptVerifyTimeStampSignature( 1034Win32.CryptMemFree(ppTsContext); 1037Win32.CertFreeCertificateContext(ppTsSigner); 1040Win32.CertCloseStore(phStore, 0); 1106if (0 == string.Compare(Win32.szOID_KP_LIFETIME_SIGNING, oid.Value, StringComparison.Ordinal)) 1160throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1172throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1179throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1187throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1197if (m_authenticodeSignerInfo.ErrorCode == Win32.TRUST_E_NOSIGNATURE) 1208throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1214throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1222int hr = Win32._AxlGetIssuerPublicKeyHash(signerCert.Handle, ref pIssuerKeyHash); 1223if (hr != Win32.S_OK) 1229Win32.HeapFree(Win32.GetProcessHeap(), 0, pIssuerKeyHash); 1235throw new CryptographicException(Win32.TRUST_E_FAIL); 1249throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1254throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1260throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1270throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1288throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1295throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1313throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1320throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1341throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1357Win32.CRYPT_DATA_BLOB modulusBlob = new Win32.CRYPT_DATA_BLOB(); 1358Win32.CRYPT_DATA_BLOB exponentBlob = new Win32.CRYPT_DATA_BLOB(); 1367int hr = Win32._AxlRSAKeyValueToPublicKeyToken(ref modulusBlob, ref exponentBlob, ref pComputedToken); 1368if (hr != Win32.S_OK) 1374Win32.HeapFree(Win32.GetProcessHeap(), 0, pComputedToken); 1382throw new CryptographicException(Win32.TRUST_E_FAIL); 1389throw new CryptographicException(Win32.TRUST_E_FAIL); 1411throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1423int hr = Win32._AxlGetIssuerPublicKeyHash(signerCert.Handle, ref pIssuerKeyHash); 1424if (hr != Win32.S_OK) 1430Win32.HeapFree(Win32.GetProcessHeap(), 0, pIssuerKeyHash); 1499throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1504throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1514throw new CryptographicException(Win32.NTE_BAD_KEY); 1531Win32.CRYPT_DATA_BLOB publicKeyBlob = new Win32.CRYPT_DATA_BLOB(); 1536int hr = Win32._AxlPublicKeyBlobToPublicKeyToken(ref publicKeyBlob, ref pPublicKeyToken); 1537if (hr != Win32.S_OK) 1543Win32.HeapFree(Win32.GetProcessHeap(), 0, pPublicKeyToken); 1560throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 1586throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1599throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1634throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1647throw new CryptographicException(Win32.TRUST_E_BAD_DIGEST); 1770string algId = useSha256 ? Win32.szOID_NIST_sha256 : Win32.szOID_OIWSEC_sha1; 1787Win32.CRYPT_TIMESTAMP_PARA para = new Win32.CRYPT_TIMESTAMP_PARA() 1798if (!Win32.CryptRetrieveTimeStamp( 1814var timestampContext = (Win32.CRYPT_TIMESTAMP_CONTEXT)Marshal.PtrToStructure(ppTsContext, typeof(Win32.CRYPT_TIMESTAMP_CONTEXT)); 1822Win32.CryptMemFree(ppTsContext); 1825Win32.CertFreeCertificateContext(ppTsSigner); 1828Win32.CertCloseStore(phStore, 0); 1854Win32.CRYPT_DATA_BLOB timestampBlob = new Win32.CRYPT_DATA_BLOB(); 1862Win32.CRYPT_DATA_BLOB licenseBlob = new Win32.CRYPT_DATA_BLOB(); 1867int hr = Win32.CertTimestampAuthenticodeLicense(ref licenseBlob, timeStampUrl, ref timestampBlob); 1868if (hr != Win32.S_OK) 1877Win32.HeapFree(Win32.GetProcessHeap(), 0, timestampBlob.pbData); 1909throw new CryptographicException(Win32.TRUST_E_SUBJECT_FORM_UNKNOWN); 2028throw new CryptographicException(Win32.TRUST_E_SYSTEM_ERROR); //Throws a System Trust error
winforms\Managed\System\WinForms\TrustManager.cs (3)
320if (error == Win32.TRUST_E_EXPLICIT_DISTRUST || error == TRUST_E_REVOKED) 326if (error == Win32.TRUST_E_SUBJECT_NOT_TRUSTED) 366if (signedManifest.StrongNameSignerInfo != null && signedManifest.StrongNameSignerInfo.ErrorCode != Win32.TRUST_E_BAD_DIGEST) {