9 writes to CertificateContext
System.Net.Security (9)
System\Net\Security\SslAuthenticationOptions.cs (4)
52CertificateContext = sslClientAuthenticationOptions.ClientCertificateContext; 115CertificateContext = sslServerAuthenticationOptions.ServerCertificateContext; 126CertificateContext = SslStreamCertificateContext.Create(certificateWithKey, additionalCertificates: null, offline: false, trust: null, noOcspFetch: !ocspFetch); 138CertificateContext = SslStreamCertificateContext.Create(certificateWithKey);
System\Net\Security\SslStream.Protocol.cs (5)
584_sslAuthenticationOptions.CertificateContext ??= SslStreamCertificateContext.Create(selectedCert); 643_sslAuthenticationOptions.CertificateContext ??= SslStreamCertificateContext.Create(selectedCert!); 650_sslAuthenticationOptions.CertificateContext ??= SslStreamCertificateContext.Create(selectedCert!); 661_sslAuthenticationOptions.CertificateContext ??= SslStreamCertificateContext.Create(selectedCert); 739_sslAuthenticationOptions.CertificateContext = SslStreamCertificateContext.Create(selectedCert);
39 references to CertificateContext
System.Net.Security (39)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (25)
166var key = new SslContextCacheKey(protocols, sslAuthenticationOptions.CertificateContext?.TargetCertificate.GetCertHash(HashAlgorithmName.SHA256)); 180if (!sslAuthenticationOptions.CertificateContext!.SslContexts!.TryGetValue(serverCacheKey, out SafeSslContextHandle? handle)) 185SafeSslContextHandle cached = sslAuthenticationOptions.CertificateContext!.SslContexts!.GetOrAdd(serverCacheKey, handle); 278if (sslAuthenticationOptions.CertificateContext != null && sslAuthenticationOptions.IsServer) 280SetSslCertificate(sslCtx, sslAuthenticationOptions.CertificateContext.CertificateHandle, sslAuthenticationOptions.CertificateContext.KeyHandle); 282if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Count > 0) 284if (!Ssl.AddExtraChainCertificates(sslCtx, sslAuthenticationOptions.CertificateContext.IntermediateCertificates)) 290if (sslAuthenticationOptions.CertificateContext.OcspStaplingAvailable) 314if (sslAuthenticationOptions.CertificateContext == null) 319Debug.Assert(sslAuthenticationOptions.CertificateContext.CertificateHandle != null); 320Debug.Assert(sslAuthenticationOptions.CertificateContext.KeyHandle != null); 322int retVal = Ssl.SslUseCertificate(ssl, sslAuthenticationOptions.CertificateContext.CertificateHandle); 328retVal = Ssl.SslUsePrivateKey(ssl, sslAuthenticationOptions.CertificateContext.KeyHandle); 334if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Count > 0) 336if (!Ssl.AddExtraChainCertificates(ssl, sslAuthenticationOptions.CertificateContext.IntermediateCertificates)) 361(sslAuthenticationOptions.CertificateContext == null && sslAuthenticationOptions.CertSelectionDelegate != null)) 369Debug.Assert(sslAuthenticationOptions.CertificateContext != null); 370if (sslAuthenticationOptions.CertificateContext == null || 371sslAuthenticationOptions.CertificateContext.SslContexts == null) 443if (sslAuthenticationOptions.CertificateContext != null || 461if (sslAuthenticationOptions.CertificateContext != null) 463if (sslAuthenticationOptions.CertificateContext.Trust?._sendTrustInHandshake == true) 465SslCertificateTrust trust = sslAuthenticationOptions.CertificateContext!.Trust!; 487byte[]? ocspResponse = sslAuthenticationOptions.CertificateContext.GetOcspResponseNoWaiting();
System\Net\Security\SslStream.IO.cs (1)
579if (!VerifyRemoteCertificate(_sslAuthenticationOptions.CertValidationDelegate, _sslAuthenticationOptions.CertificateContext?.Trust, ref alertToken, out sslPolicyErrors, out chainStatus))
System\Net\Security\SslStream.Protocol.cs (12)
84return _sslAuthenticationOptions.CertificateContext?.TargetCertificate; 323if (_sslAuthenticationOptions.CertificateContext != null) 333_selectedClientCertificate = _sslAuthenticationOptions.CertificateContext.TargetCertificate; 335return _sslAuthenticationOptions.CertificateContext.TargetCertificate; 699tempCollection.Add(_sslAuthenticationOptions.CertificateContext!.TargetCertificate!); 712else if (_sslAuthenticationOptions.CertificateContext != null) 714selectedCert = _sslAuthenticationOptions.CertificateContext.TargetCertificate; 742Debug.Assert(_sslAuthenticationOptions.CertificateContext != null); 747bool sendTrustedList = _sslAuthenticationOptions.CertificateContext!.Trust?._sendTrustInHandshake ?? false; 773if (sslAuthenticationOptions.CertificateContext != null && cred != null) 782SslStreamCertificateContext certificateContext = sslAuthenticationOptions.CertificateContext; 875sendTrustList = _sslAuthenticationOptions.CertificateContext?.Trust?._sendTrustInHandshake ?? false;
System\Net\Security\SslStreamPal.Unix.cs (1)
199if (sslAuthenticationOptions.CertificateContext == null)