Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FindCertificateWithPrivateKey()

static X509Certificate2 System.Net.Security.SecureChannel.FindCertificateWithPrivateKey ( object instance,
bool isServer,
X509Certificate certificate )
inlinestaticpackage

Definition at line 125 of file SecureChannel.cs.

126 {
127 if (certificate == null)
128 {
129 return null;
130 }
131 if (System.Net.NetEventSource.Log.IsEnabled())
132 {
133 System.Net.NetEventSource.Log.LocatingPrivateKey(certificate, instance);
134 }
135 try
136 {
138 if (x509Certificate != null)
139 {
140 if (x509Certificate.HasPrivateKey)
141 {
142 if (System.Net.NetEventSource.Log.IsEnabled())
143 {
144 System.Net.NetEventSource.Log.CertIsType2(instance);
145 }
146 return x509Certificate;
147 }
149 {
150 x509Certificate.Dispose();
151 }
152 }
153 string thumbprint = x509Certificate.Thumbprint;
154 X509Store x509Store = CertificateValidationPal.EnsureStoreOpened(isServer);
155 if (x509Store != null)
156 {
159 {
160 if (System.Net.NetEventSource.Log.IsEnabled())
161 {
162 System.Net.NetEventSource.Log.FoundCertInStore(isServer, instance);
163 }
165 }
166 }
167 x509Store = CertificateValidationPal.EnsureStoreOpened(!isServer);
168 if (x509Store != null)
169 {
172 {
173 if (System.Net.NetEventSource.Log.IsEnabled())
174 {
175 System.Net.NetEventSource.Log.FoundCertInStore(!isServer, instance);
176 }
178 }
179 }
180 }
182 {
183 }
184 if (System.Net.NetEventSource.Log.IsEnabled())
185 {
186 System.Net.NetEventSource.Log.NotFoundCertInStore(instance);
187 }
188 return null;
189 }
static readonly System.Net.NetEventSource Log
static X509Certificate2 MakeEx(X509Certificate certificate)

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Net.CertificateValidationPal.EnsureStoreOpened(), System.Net.NetEventSource.Log, and System.Net.Security.SecureChannel.MakeEx().

Referenced by System.Net.Security.SslAuthenticationOptions.SslAuthenticationOptions(), System.Net.Security.SecureChannel.AcquireClientCredentials(), and System.Net.Security.SecureChannel.AcquireServerCredentials().