380 references to StoreLocation
Aspire.Dashboard (4)
Configuration\DashboardOptions.cs (1)
63public StoreLocation? Location { get; set; }
ServiceClient\DashboardClient.cs (3)
196var location = _dashboardOptions.ResourceServiceClient.ClientCertificate.Location ?? StoreLocation.CurrentUser; 217public required StoreLocation Location { get; set; }
Binding.UDS.IntegrationTests (1)
ServiceHelper.cs (1)
50using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
Certificate.Optional.Sample (1)
Program.cs (1)
27"localhost", "My", StoreLocation.CurrentUser,
Client.ChannelLayer.IntegrationTests (3)
DuplexChannelWithSynchronizationContext.cs (3)
47StoreLocation.CurrentUser, 109StoreLocation.CurrentUser, 186StoreLocation.CurrentUser,
dotnet-dev-certs (31)
Program.cs (3)
303var certificates = certificateManager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 364var availableCertificates = CertificateManager.Instance.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 379var certificates = manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, exportPath.HasValue());
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
dotnet-svcutil-lib (25)
CmdCredentialsProvider.cs (1)
76X509Store certificateStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\X509SecurityTokenProvider.cs (1)
27public X509SecurityTokenProvider(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (4)
882internal static X509Certificate2 GetCertificateFromStore(StoreName storeName, StoreLocation storeLocation, 892internal static bool TryGetCertificateFromStore(StoreName storeName, StoreLocation storeLocation, 899private static X509Certificate2 GetCertificateFromStoreCore(StoreName storeName, StoreLocation storeLocation, 934private static Exception CreateCertificateLoadException(StoreName storeName, StoreLocation storeLocation,
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\X509CertificateInitiatorClientCredential.cs (4)
11internal const StoreLocation DefaultStoreLocation = StoreLocation.CurrentUser; 42public void SetCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName) 51public void SetCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\X509CertificateRecipientClientCredential.cs (6)
15internal const StoreLocation DefaultStoreLocation = StoreLocation.CurrentUser; 88public void SetDefaultCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName) 97public void SetDefaultCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue) 107public void SetScopedCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName, Uri targetService) 116public void SetScopedCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue, Uri targetService)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\X509ClientCertificateAuthentication.cs (3)
14internal const StoreLocation DefaultTrustedStoreLocation = StoreLocation.LocalMachine; 23bool useMachineContext = DefaultTrustedStoreLocation == StoreLocation.LocalMachine;
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\X509ServiceCertificateAuthentication.cs (6)
15internal const StoreLocation DefaultTrustedStoreLocation = StoreLocation.CurrentUser; 20private StoreLocation _trustedStoreLocation = DefaultTrustedStoreLocation; 43bool useMachineContext = DefaultTrustedStoreLocation == StoreLocation.LocalMachine; 79public StoreLocation TrustedStoreLocation 122bool useMachineContext = _trustedStoreLocation == StoreLocation.LocalMachine;
Http3SampleApp (1)
Program.cs (1)
27var cert = CertificateLoader.LoadFromStoreCert("localhost", StoreName.My.ToString(), StoreLocation.CurrentUser, false);
IIS.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
107using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
23using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 75using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
23using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 75using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
23using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 75using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
23using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 75using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
IIS.ShadowCopy.Tests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
23using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 75using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
IISExpress.FunctionalTests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
107using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
23using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 75using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine))
Infrastructure.Common (13)
CertificateManager.cs (12)
19private static StoreLocation s_PlatformSpecificRootStoreLocation = StoreLocation.LocalMachine; 39internal static StoreLocation PlatformSpecificRootStoreLocation 47using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 55s_PlatformSpecificRootStoreLocation = StoreLocation.CurrentUser; 60s_PlatformSpecificRootStoreLocation = StoreLocation.CurrentUser; 89StoreLocation storeLocation, 175StoreLocation storeLocation, 212return CertificateFromThumbprint(StoreName.My, StoreLocation.CurrentUser, thumbprint, validOnly); 218return CertificateFromThumbprint(StoreName.TrustedPeople, StoreLocation.CurrentUser, thumbprint, validOnly); 245certificate = AddToStoreIfNeeded(StoreName.My, StoreLocation.CurrentUser, certificate); 258certificate = AddToStoreIfNeeded(StoreName.TrustedPeople, StoreLocation.CurrentUser, certificate);
ServiceUtilHelper.cs (1)
77public static StoreLocation PlatformSpecificRootStoreLocation
InMemory.FunctionalTests (3)
HttpsConnectionMiddlewareTests.cs (1)
810using (var store = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser))
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
69using (X509Store store = new X509Store(StoreName.CertificateAuthority, StoreLocation.LocalMachine)) 86using (X509Store store = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser))
Kestrel.SampleApp (1)
Startup.cs (1)
128var localhostCert = CertificateLoader.LoadFromStoreCert("localhost", "My", StoreLocation.CurrentUser, allowInvalid: true);
Microsoft.AspNetCore.DataProtection (3)
XmlEncryption\CertificateResolver.cs (3)
31return GetCertificateFromStore(StoreLocation.CurrentUser, thumbprint) 32?? GetCertificateFromStore(StoreLocation.LocalMachine, thumbprint); 35private static X509Certificate2? GetCertificateFromStore(StoreLocation location, string thumbprint)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (9)
DataProtectionProviderTests.cs (7)
117[X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)] 124using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser)) 133var certificateStore = new X509Store(StoreName.My, StoreLocation.CurrentUser); 170[X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)] 173using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser)) 184using (var certificateStore = new X509Store(StoreName.My, StoreLocation.CurrentUser)) 268using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
X509StoreIsAvailableAttribute.cs (2)
13public X509StoreIsAvailableAttribute(StoreName name, StoreLocation location) 41public StoreLocation Location { get; }
Microsoft.AspNetCore.DeveloperCertificates.XPlat (28)
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (18)
CertificateManagerTests.cs (18)
56var httpsCertificates = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 113using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser)) 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); 251var importedCertificate = Assert.Single(_manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false)); 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); 321Assert.Empty(_manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false)); 339var httpsCertificate = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false).Single(c => c.Subject == TestCertificateSubject); 393var httpsCertificateList = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 413var httpsCertificateList = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 451var httpsCertificateList = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 469var httpsCertificateList = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 500var httpsCertificateList = _manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 569Manager.RemoveAllCertificates(StoreName.My, StoreLocation.CurrentUser); 572Manager.RemoveAllCertificates(StoreName.Root, StoreLocation.CurrentUser);
Microsoft.AspNetCore.Server.Kestrel.Core (50)
CertificateLoader.cs (1)
31public static X509Certificate2 LoadFromStoreCert(string subject, string storeName, StoreLocation storeLocation, bool allowInvalid)
Internal\Certificates\CertificateConfigLoader.cs (4)
182var storeLocation = StoreLocation.CurrentUser; 185storeLocation = (StoreLocation)Enum.Parse(typeof(StoreLocation), location, ignoreCase: true);
KestrelServerOptions.cs (1)
382var certs = CertificateManager.Instance.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: false);
ListenOptionsHttpsExtensions.cs (3)
90=> listenOptions.UseHttps(storeName, subject, allowInvalid, StoreLocation.CurrentUser); 101public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location) 114public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location,
Middleware\HttpsConnectionMiddleware.cs (13)
270X509Store? OpenStore(StoreLocation storeLocation) 287var store = OpenStore(StoreLocation.LocalMachine); 297_logger.FoundCertWithPrivateKey(certs[0], StoreLocation.LocalMachine); 303store = OpenStore(StoreLocation.CurrentUser); 313_logger.FoundCertWithPrivateKey(certs[0], StoreLocation.CurrentUser); 617public static void FoundCertWithPrivateKey(this ILogger<HttpsConnectionMiddleware> logger, X509Certificate2 certificate, StoreLocation storeLocation) 619var storeLocationString = storeLocation == StoreLocation.LocalMachine ? nameof(StoreLocation.LocalMachine) : nameof(StoreLocation.CurrentUser); 632public static void FailedToOpenStore(this ILogger<HttpsConnectionMiddleware> logger, StoreLocation storeLocation, Exception exception) 634var storeLocationString = storeLocation == StoreLocation.LocalMachine ? nameof(StoreLocation.LocalMachine) : nameof(StoreLocation.CurrentUser);
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\test\CertHelper.cs (2)
69using (X509Store store = new X509Store(StoreName.CertificateAuthority, StoreLocation.LocalMachine)) 86using (X509Store store = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser))
netstandard (1)
netstandard.cs (1)
1948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreLocation))]
PresentationUI (1)
MS\Internal\Documents\DocumentSignatureManager.cs (1)
905X509Store store = new X509Store(StoreLocation.CurrentUser);
Security.TransportSecurity.IntegrationTests (9)
Https\HttpsTests.4.1.0.cs (5)
43StoreLocation.CurrentUser, 376StoreLocation.CurrentUser, 425StoreLocation.CurrentUser, 487StoreLocation.CurrentUser, 547StoreLocation.CurrentUser,
Tcp\ClientCredentialTypeTests.4.1.0.cs (2)
40StoreLocation.CurrentUser, 92StoreLocation.CurrentUser,
Tcp\ClientCredentialTypeTests.4.1.1.cs (1)
253StoreLocation.CurrentUser,
Tcp\ClientCredentialTypeTests.OSX.cs (1)
153using (store = new X509Store(StoreName.Disallowed, StoreLocation.CurrentUser))
System (1)
src\libraries\shims\System\ref\System.cs (1)
859[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreLocation))]
System.Security.Cryptography (6)
artifacts\obj\System.Security.Cryptography\Debug\net10.0\System.Security.Cryptography.notsupported.cs (6)
4182public X509Store(System.Security.Cryptography.X509Certificates.StoreLocation storeLocation) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4184public X509Store(System.Security.Cryptography.X509Certificates.StoreName storeName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4185public X509Store(System.Security.Cryptography.X509Certificates.StoreName storeName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.OpenFlags flags) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4187public X509Store(string storeName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4188public X509Store(string storeName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.OpenFlags flags) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4191public System.Security.Cryptography.X509Certificates.StoreLocation Location { get { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } }
System.Security.Cryptography.Pkcs (3)
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (2)
20certs.AddRange(PkcsHelpers.GetStoreCertificates(StoreName.My, StoreLocation.CurrentUser, openExistingOnly: false)); 26PkcsHelpers.GetStoreCertificates(StoreName.My, StoreLocation.LocalMachine, openExistingOnly: false));
Internal\Cryptography\PkcsHelpers.cs (1)
153public static X509Certificate2Collection GetStoreCertificates(StoreName storeName, StoreLocation storeLocation, bool openExistingOnly)
System.Security.Cryptography.X509Certificates (1)
System.Security.Cryptography.X509Certificates.cs (1)
11[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreLocation))]
System.Security.Cryptography.Xml (2)
System\Security\Cryptography\Xml\Utils.cs (2)
652stores[0] = new X509Store(storeName, StoreLocation.CurrentUser); 653stores[1] = new X509Store(storeName, StoreLocation.LocalMachine);
System.ServiceModel.Primitives (7)
netstandard.cs (7)
2297public System.Security.Cryptography.X509Certificates.StoreLocation TrustedStoreLocation { get { return default; } set { } } 2303public void SetCertificate(System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName, System.Security.Cryptography.X509Certificates.X509FindType findType, object findValue) { } 2304public void SetCertificate(string subjectName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName) { } 2313public void SetDefaultCertificate(System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName, System.Security.Cryptography.X509Certificates.X509FindType findType, object findValue) { } 2314public void SetDefaultCertificate(string subjectName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName) { } 2315public void SetScopedCertificate(System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName, System.Security.Cryptography.X509Certificates.X509FindType findType, object findValue, System.Uri targetService) { } 2316public void SetScopedCertificate(string subjectName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.StoreName storeName, System.Uri targetService) { }
Templates.Blazor.Tests (28)
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Templates.Blazor.WebAssembly.Auth.Tests (28)
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Templates.Blazor.WebAssembly.Tests (28)
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Templates.Mvc.Tests (28)
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Templates.Tests (28)
src\Shared\CertificateGeneration\CertificateManager.cs (14)
124StoreLocation location, 223ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 237var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 238var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 447var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 506var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 526protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 535protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 744var location = StoreLocation.CurrentUser; 777internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 880using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 957public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1003public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
307protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 376protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 378return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 383if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
152protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 189using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 363using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 451protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 453return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
54protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 76using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 105using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 122var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 127protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
WebTransportInteractiveSampleApp (1)
Program.cs (1)
165var store = new X509Store("KestrelSampleWebTransportCertificates", StoreLocation.CurrentUser);
WebTransportSampleApp (1)
Program.cs (1)
50var store = new X509Store("KestrelSampleWebTransportCertificates", StoreLocation.CurrentUser);