81 references to CAPI
System.IdentityModel (81)
System\IdentityModel\CryptoApi.cs (8)
253[DllImport(CAPI.CRYPT32, CharSet = CharSet.Unicode, SetLastError = true)] 262[DllImport(CAPI.CRYPT32, CharSet = CharSet.Unicode, SetLastError = true)] 272[DllImport(CAPI.CRYPT32, SetLastError = true)] 280[DllImport(CAPI.CRYPT32, SetLastError = true)] 287[DllImport(CAPI.CRYPT32, SetLastError = true)] 368return CAPI.CertCloseStore(handle, 0); 395return CAPI.CertFreeCertificateContext(handle); 421CAPI.CertFreeCertificateChain(handle);
System\IdentityModel\SecurityUtils.cs (2)
192bool readPolicy = (CAPI.S_OK == CAPI.BCryptGetFipsAlgorithmMode(out fipsEnabled));
System\IdentityModel\Selectors\X509CertificateChain.cs (41)
22public const uint DefaultChainPolicyOID = CAPI.CERT_CHAIN_POLICY_BASE; 89if (certificate.Extensions[CAPI.szOID_CRL_DIST_POINTS] != null || 90certificate.Extensions[CAPI.szOID_AUTHORITY_INFO_ACCESS] != null) 101BuildChain(this.useMachineContext ? new IntPtr(CAPI.HCCE_LOCAL_MACHINE) : new IntPtr(CAPI.HCCE_CURRENT_USER), 113CAPI.CERT_CHAIN_POLICY_PARA PolicyPara = new CAPI.CERT_CHAIN_POLICY_PARA(Marshal.SizeOf(typeof(CAPI.CERT_CHAIN_POLICY_PARA))); 114CAPI.CERT_CHAIN_POLICY_STATUS PolicyStatus = new CAPI.CERT_CHAIN_POLICY_STATUS(Marshal.SizeOf(typeof(CAPI.CERT_CHAIN_POLICY_STATUS))); 118PolicyPara.dwFlags = (uint)chainPolicy.VerificationFlags | CAPI.CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG; 120if (!CAPI.CertVerifyCertificateChainPolicy(new IntPtr(this.chainPolicyOID), 129if (PolicyStatus.dwError != CAPI.S_OK) 153CAPI.CERT_CHAIN_PARA ChainPara = new CAPI.CERT_CHAIN_PARA(); 154ChainPara.cbSize = (uint)Marshal.SizeOf(typeof(CAPI.CERT_CHAIN_PARA)); 163ChainPara.RequestedUsage.dwType = CAPI.USAGE_MATCH_TYPE_AND; 172ChainPara.RequestedIssuancePolicy.dwType = CAPI.USAGE_MATCH_TYPE_AND; 186if (!CAPI.CertGetCertificateChain(hChainEngine, 214CAPI.CERT_CONTEXT certContext = (CAPI.CERT_CONTEXT)Marshal.PtrToStructure(pCertContext, typeof(CAPI.CERT_CONTEXT)); 224SafeCertStoreHandle certStoreHandle = CAPI.CertOpenStore( 225new IntPtr(CAPI.CERT_STORE_PROV_MEMORY), 226CAPI.X509_ASN_ENCODING | CAPI.PKCS_7_ASN_ENCODING, 228CAPI.CERT_STORE_ENUM_ARCHIVED_FLAG | CAPI.CERT_STORE_CREATE_NEW_FLAG, 247if (!CAPI.CertAddCertificateLinkToStore(certStoreHandle, 249CAPI.CERT_STORE_ADD_ALWAYS, 266= CAPI.CertCreateCertificateContext( certContext.dwCertEncodingType, 281CAPI.CERT_CONTEXT intermediatesCertContext = (CAPI.CERT_CONTEXT) Marshal.PtrToStructure( intermediatesCert.Handle, typeof( CAPI.CERT_CONTEXT ) ); 292if (!CAPI.CertAddCertificateLinkToStore(certStoreHandle, 294CAPI.CERT_STORE_ADD_ALWAYS, 369dwFlags |= CAPI.CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY; 372dwFlags |= CAPI.CERT_CHAIN_REVOCATION_CHECK_END_CERT; 374dwFlags |= CAPI.CERT_CHAIN_REVOCATION_CHECK_CHAIN; 376dwFlags |= CAPI.CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT;
System\IdentityModel\Selectors\X509CertificateStore.cs (28)
89SafeCertStoreHandle certStoreHandle = CAPI.CertOpenStore(new IntPtr(CAPI.CERT_STORE_PROV_SYSTEM), 90CAPI.X509_ASN_ENCODING | CAPI.PKCS_7_ASN_ENCODING, 128dwFindType = CAPI.CERT_FIND_SUBJECT_STR; 143CAPI.CRYPTOAPI_BLOB blob = new CAPI.CRYPTOAPI_BLOB(); 147dwFindType = CAPI.CERT_FIND_HASH; 148pvFindPara = SafeHGlobalHandle.AllocHGlobal(CAPI.CRYPTOAPI_BLOB.Size); 156dwFindType = CAPI.CERT_FIND_ANY; 164dwFindType = CAPI.CERT_FIND_ISSUER_STR; 172dwFindType = CAPI.CERT_FIND_ANY; 195dwFindType = CAPI.CERT_FIND_ANY; 210dwFindType = CAPI.CERT_FIND_ANY; 227pCertContext = CAPI.CertFindCertificateInStore(this.certStoreHandle, 228CAPI.X509_ASN_ENCODING | CAPI.PKCS_7_ASN_ENCODING, 252pCertContext = CAPI.CertFindCertificateInStore(this.certStoreHandle, 253CAPI.X509_ASN_ENCODING | CAPI.PKCS_7_ASN_ENCODING, 277if (dwFindType == CAPI.CERT_FIND_ANY) 310cert.Extensions[CAPI.SubjectKeyIdentifierOid] as X509SubjectKeyIdentifierExtension; 361dwFlags |= CAPI.CERT_STORE_READONLY_FLAG; 364dwFlags |= CAPI.CERT_STORE_MAXIMUM_ALLOWED_FLAG; 369dwFlags |= CAPI.CERT_STORE_OPEN_EXISTING_FLAG; 371dwFlags |= CAPI.CERT_STORE_ENUM_ARCHIVED_FLAG; 374dwFlags |= CAPI.CERT_SYSTEM_STORE_LOCAL_MACHINE; 376dwFlags |= CAPI.CERT_SYSTEM_STORE_CURRENT_USER;
System\IdentityModel\Selectors\X509CertificateValidator.cs (1)
61ntAuthChainTrust = new ChainTrustValidator(false, null, CAPI.CERT_CHAIN_POLICY_NT_AUTH);
System\IdentityModel\Tokens\X509NTAuthChainTrustValidator.cs (1)
20private uint chainPolicyOID = CAPI.CERT_CHAIN_POLICY_NT_AUTH;