22 if (x509Store ==
null)
32 if (x509Store ==
null)
76 return GetRemoteCertificate(securityContext, retrieveCollection:
false, out remoteCertificateCollection);
81 return GetRemoteCertificate(securityContext, retrieveCollection:
true, out remoteCertificateCollection);
86 remoteCertificateCollection =
null;
87 if (securityContext ==
null)
96 if (safeFreeCertContext !=
null && !safeFreeCertContext.
IsInvalid)
103 if (safeFreeCertContext !=
null && !safeFreeCertContext.
IsInvalid)
105 if (retrieveCollection)
116 return x509Certificate;
121 global::Interop.SspiCli.SecPkgContext_IssuerListInfoEx ctx =
default(global::Interop.SspiCli.SecPkgContext_IssuerListInfoEx);
127 if (flag && ctx.cIssuers != 0)
129 array =
new string[ctx.cIssuers];
130 Span<global::Interop.SspiCli.CERT_CHAIN_ELEMENT> span =
new Span<global::Interop.SspiCli.CERT_CHAIN_ELEMENT>((
void*)sspiHandle.
DangerousGetHandle(),
array.Length);
131 for (
int i = 0; i < span.Length; i++)
133 if (span[i].cbSize != 0)
135 byte[] encodedDistinguishedName =
new Span<byte>((
void*)span[i].pCertContext, checked((
int)span[i].cbSize)).
ToArray();
160 store.Open(OpenFlags.OpenExistingOnly);
static SafeAccessTokenHandle InvalidHandle
static unsafe string[] GetRequestCertificateAuthorities(SafeDeleteContext securityContext)
static X509Certificate2 GetRemoteCertificate(SafeDeleteContext securityContext, out X509Certificate2Collection remoteCertificateCollection)
static X509Certificate2 GetRemoteCertificate(SafeDeleteContext securityContext)
static readonly object s_syncObject
static X509Store OpenStore(StoreLocation storeLocation)
static SslPolicyErrors VerifyCertificateProperties(SafeDeleteContext securityContext, X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string hostName)
static volatile X509Store s_myCertStoreEx
static X509Store EnsureStoreOpened(bool isMachineStore)
static X509Certificate2 GetRemoteCertificate(SafeDeleteContext securityContext, bool retrieveCollection, out X509Certificate2Collection remoteCertificateCollection)
static volatile X509Store s_myMachineCertStoreEx
static unsafe SslPolicyErrors BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string hostName)
static readonly System.Net.SSPISecureChannelType SSPISecureChannel
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static bool QueryContextAttributes_SECPKG_ATTR_ISSUER_LIST_EX(ISSPIInterface secModule, SafeDeleteContext securityContext, ref global::Interop.SspiCli.SecPkgContext_IssuerListInfoEx ctx, out SafeHandle sspiHandle)
static SafeFreeCertContext QueryContextAttributes_SECPKG_ATTR_REMOTE_CERT_CONTEXT(ISSPIInterface secModule, SafeDeleteContext securityContext)
static X509Certificate2Collection GetRemoteCertificatesFromStoreContext(SafeFreeCertContext certContext)
IntPtr DangerousGetHandle()
static string Format(string resourceFormat, object p1)
static string net_log_open_store_failed
static void RunImpersonated(SafeAccessTokenHandle safeAccessTokenHandle, Action action)