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