105 references to Subject
Aspire.Dashboard (2)
DashboardWebApplication.cs (2)
683context.ClientCertificate.Subject, 686context.ClientCertificate.Subject,
Certificate.Sample (2)
Startup.cs (2)
24new Claim(ClaimTypes.NameIdentifier, context.ClientCertificate.Subject, ClaimValueTypes.String, context.Options.ClaimsIssuer), 25new Claim(ClaimTypes.Name, context.ClientCertificate.Subject, ClaimValueTypes.String, context.Options.ClaimsIssuer)
dotnet-dev-certs (7)
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportSecurityHelpers.cs (1)
434certificate.Subject, certHashString, thumbprint)));
Http3SampleApp (1)
Startup.cs (1)
26await context.Response.WriteAsync($"Hello World! {context.Request.Protocol} {context.Connection.ClientCertificate?.Subject}");
InMemory.FunctionalTests (4)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
74if (cert.Subject.Contains(caName)) 91if (cert.Subject.Contains(caName))
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (2)
123internal string SubjectName => _cert.Subject; 125internal string OcspResponderSubjectName => (_ocspResponder ?? _cert).Subject;
Microsoft.AspNetCore.Authentication.Certificate (3)
CertificateAuthenticationHandler.cs (3)
124Logger.CertificateRejected("Self signed", clientCertificate.Subject); 133Logger.CertificateRejected("Chained", clientCertificate.Subject); 151Logger.CertificateFailedValidation(clientCertificate.Subject, chainErrors);
Microsoft.AspNetCore.Authentication.Test (2)
CertificateTests.cs (2)
912new Claim(ClaimTypes.NameIdentifier, context.ClientCertificate.Subject, ClaimValueTypes.String, context.Options.ClaimsIssuer), 913new Claim(ClaimTypes.Name, context.ClientCertificate.Subject, ClaimValueTypes.String, context.Options.ClaimsIssuer)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (7)
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (12)
CertificateManagerTests.cs (12)
57var httpsCertificate = Assert.Single(httpsCertificates, c => c.Subject == TestCertificateSubject); 59Assert.Equal(TestCertificateSubject, httpsCertificate.Subject); 119Output.WriteLine($"Certificate: {certificate.Subject} '{Convert.ToBase64String(certificate.Export(X509ContentType.Cert))}'."); 143var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 175var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 208var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 239var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 272var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 299var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 304var csr = new CertificateRequest(httpsCertificate.Subject + "Not", privateKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); 312Assert.NotEqual(_manager.Subject, wrongSubjectCertificate.Subject); 339var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject);
Microsoft.AspNetCore.Server.Kestrel.Core (9)
Internal\LoggerExtensions.cs (1)
18public static void LocatedDevelopmentCertificate(this ILogger<KestrelServer> logger, X509Certificate2 certificate) => LocatedDevelopmentCertificate(logger, certificate.Subject, certificate.Thumbprint);
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
TlsConfigurationLoader.cs (1)
179return string.Equals(certificate.Subject, CertificateManager.LocalhostHttpsDistinguishedName, StringComparison.Ordinal) &&
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
SniOptionsSelectorTests.cs (2)
243Assert.Equal("CN=leaf.com", fullChain[0].Subject); 245Assert.Equal("CN=Test Intermediate CA 2", fullChain[1].Subject);
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
74if (cert.Subject.Contains(caName)) 91if (cert.Subject.Contains(caName))
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (2)
123internal string SubjectName => _cert.Subject; 125internal string OcspResponderSubjectName => (_ocspResponder ?? _cert).Subject;
System.Net.Http (2)
src\libraries\Common\src\System\Net\Security\CertificateHelper.cs (2)
42NetEventSource.Info(candidateCerts, $"Skipping current X509Certificate2 {cert.GetHashCode()} since it doesn't have private key. Certificate Subject: {cert.Subject}, Thumbprint: {cert.Thumbprint}."); 51NetEventSource.Info(candidateCerts, $"Choosing X509Certificate2 {cert.GetHashCode()} as the Client Certificate. Certificate Subject: {cert.Subject}, Thumbprint: {cert.Thumbprint}.");
System.Net.Security (2)
System\Net\Security\SslStreamCertificateContext.cs (2)
82NetEventSource.Error(null, $"Failed to build chain for {target.Subject}"); 95NetEventSource.Error(null, $"Failed to build chain for {target.Subject} while trusting additional certificates");
System.Security.Cryptography (4)
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
79FindCore(subjectDistinguishedName, static (subjectDistinguishedName, cert) => StringComparer.OrdinalIgnoreCase.Equals(subjectDistinguishedName, cert.Subject));
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (1)
245if (StringComparer.Ordinal.Equals(cert.Subject, cert.Issuer))
System\Security\Cryptography\X509Certificates\OpenSslX509ChainEventSource.cs (1)
670CachingIntermediate(certificate.Subject);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
537sb.AppendLine(Subject);
System.Security.Cryptography.Xml (1)
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (1)
240keyName = "\"" + certificate.Subject + "\"";
Templates.Blazor.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
46ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _developmentCertificate.CertificateThumbprint,
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
Templates.Blazor.WebAssembly.Auth.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
46ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _developmentCertificate.CertificateThumbprint,
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
Templates.Blazor.WebAssembly.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
46ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _developmentCertificate.CertificateThumbprint,
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
Templates.Mvc.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
46ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _developmentCertificate.CertificateThumbprint,
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
Templates.Tests (8)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
46ServerCertificateCustomValidationCallback = (request, certificate, chain, errors) => (certificate.Subject != "CN=localhost" && errors == SslPolicyErrors.None) || certificate?.Thumbprint == _developmentCertificate.CertificateThumbprint,
src\Shared\CertificateGeneration\CertificateManager.cs (5)
200var filteredCertificates = certificates.Where(c => c.Subject == Subject); 437if (!string.Equals(certificate.Subject, Subject, StringComparison.Ordinal) || // Kestrel requires this 466var filteredCertificates = certificates.Where(c => c.Subject == Subject); 735var certificatesWithName = certificates.Where(c => c.Subject == Subject); 858$"{c.Thumbprint} - {c.Subject} - Valid from {c.NotBefore:u} to {c.NotAfter:u} - IsHttpsDevelopmentCertificate: {IsHttpsDevelopmentCertificate(c).ToString().ToLowerInvariant()} - IsExportable: {Instance.IsExportable(c).ToString().ToLowerInvariant()}";
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 282throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");