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)
162var key = new SslContextCacheKey(protocols, sslAuthenticationOptions.CertificateContext?.TargetCertificate.GetCertHash(HashAlgorithmName.SHA256)); 176if (!sslAuthenticationOptions.CertificateContext!.SslContexts!.TryGetValue(serverCacheKey, out SafeSslContextHandle? handle)) 181SafeSslContextHandle cached = sslAuthenticationOptions.CertificateContext!.SslContexts!.GetOrAdd(serverCacheKey, handle); 272if (sslAuthenticationOptions.CertificateContext != null && sslAuthenticationOptions.IsServer) 274SetSslCertificate(sslCtx, sslAuthenticationOptions.CertificateContext.CertificateHandle, sslAuthenticationOptions.CertificateContext.KeyHandle); 276if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Count > 0) 278if (!Ssl.AddExtraChainCertificates(sslCtx, sslAuthenticationOptions.CertificateContext.IntermediateCertificates)) 284if (sslAuthenticationOptions.CertificateContext.OcspStaplingAvailable) 308if (sslAuthenticationOptions.CertificateContext == null) 313Debug.Assert(sslAuthenticationOptions.CertificateContext.CertificateHandle != null); 314Debug.Assert(sslAuthenticationOptions.CertificateContext.KeyHandle != null); 316int retVal = Ssl.SslUseCertificate(ssl, sslAuthenticationOptions.CertificateContext.CertificateHandle); 322retVal = Ssl.SslUsePrivateKey(ssl, sslAuthenticationOptions.CertificateContext.KeyHandle); 328if (sslAuthenticationOptions.CertificateContext.IntermediateCertificates.Count > 0) 330if (!Ssl.AddExtraChainCertificates(ssl, sslAuthenticationOptions.CertificateContext.IntermediateCertificates)) 354(sslAuthenticationOptions.CertificateContext == null && sslAuthenticationOptions.CertSelectionDelegate != null)) 362Debug.Assert(sslAuthenticationOptions.CertificateContext != null); 363if (sslAuthenticationOptions.CertificateContext == null || 364sslAuthenticationOptions.CertificateContext.SslContexts == null) 436if (sslAuthenticationOptions.CertificateContext != null || 454if (sslAuthenticationOptions.CertificateContext != null) 456if (sslAuthenticationOptions.CertificateContext.Trust?._sendTrustInHandshake == true) 458SslCertificateTrust trust = sslAuthenticationOptions.CertificateContext!.Trust!; 480byte[]? 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)