338 references to StoreLocation
aspire (35)
Certificates\CertificateGeneration\CertificateManager.cs (14)
139StoreLocation location, 258ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 293var allCurrentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 294var allLocalMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 549var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 615var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 635protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 644protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 864var location = StoreLocation.CurrentUser; 897internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 971using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 1054public void ListCertificatesStart(StoreLocation location, StoreName storeName) => 1114public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) =>
Certificates\CertificateGeneration\MacOSCertificateManager.cs (4)
337protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 448protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 450return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 455if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(s_macOSUserHttpsCertificateLocation))
Certificates\CertificateGeneration\UnixCertificateManager.cs (5)
200protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 238using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 477using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 568protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 570return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
Certificates\CertificateGeneration\WindowsCertificateManager.cs (5)
56protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 79using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 108using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 125var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 130protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Certificates\NativeCertificateToolRunner.cs (3)
25StoreName.My, StoreLocation.CurrentUser, isValid: true); 94StoreName.My, StoreLocation.CurrentUser, isValid: true); 204StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\Shared\X509Certificate2Extensions.cs (3)
91(StoreName.Root, StoreLocation.CurrentUser), 92(StoreName.Root, StoreLocation.LocalMachine), 151using var rootStore = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
Utils\EnvironmentChecker\DcpConnectionChecker.cs (1)
539var certificates = certificateManager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true);
Aspire.Cli.Tests (2)
TestServices\TestCertificateManager.cs (2)
30protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 50protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) => [];
Aspire.Dashboard (4)
Configuration\DashboardOptions.cs (1)
88public StoreLocation? Location { get; set; }
ServiceClient\DashboardClient.cs (3)
227var location = _dashboardOptions.ResourceServiceClient.ClientCertificate.Location ?? StoreLocation.CurrentUser; 276public required StoreLocation Location { get; set; }
Aspire.Hosting (5)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
117public static IResourceBuilder<CertificateAuthorityCollection> WithCertificatesFromStore(this IResourceBuilder<CertificateAuthorityCollection> builder, StoreName storeName, StoreLocation storeLocation, Func<X509Certificate2, bool>? filter = null)
DeveloperCertificateService.cs (1)
34using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
src\Shared\X509Certificate2Extensions.cs (3)
91(StoreName.Root, StoreLocation.CurrentUser), 92(StoreName.Root, StoreLocation.LocalMachine), 151using var rootStore = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
Aspire.Playground.Tests (4)
src\Shared\X509Certificate2Extensions.cs (3)
91(StoreName.Root, StoreLocation.CurrentUser), 92(StoreName.Root, StoreLocation.LocalMachine), 151using var rootStore = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
tests\Aspire.TestUtilities\RequiresFeatureAttribute.cs (1)
76using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
Aspire.TestUtilities (4)
RequiresFeatureAttribute.cs (1)
76using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
src\Shared\X509Certificate2Extensions.cs (3)
91(StoreName.Root, StoreLocation.CurrentUser), 92(StoreName.Root, StoreLocation.LocalMachine), 151using var rootStore = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
Binding.UDS.IntegrationTests (1)
ServiceHelper.cs (1)
50using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
Binding.WS.TransportWithMessageCredentialSecurity.IntegrationTests (5)
BasicHttpsTransportWithMessageCredentialSecurityTests.cs (1)
32StoreLocation.CurrentUser,
BasicHttpTransportWithMessageCredentialSecurityTests.cs (1)
33StoreLocation.CurrentUser,
WS2007HttpTransportWithMessageCredentialsSecurityTests.cs (1)
37StoreLocation.CurrentUser,
WSHttpTransportWithMessageCredentialSecurityTests.cs (1)
38StoreLocation.CurrentUser,
WSNetTcpTransportWithMessageCredentialSecurityTests.cs (1)
49StoreLocation.CurrentUser,
Client.ChannelLayer.IntegrationTests (3)
DuplexChannelWithSynchronizationContext.cs (3)
47StoreLocation.CurrentUser, 109StoreLocation.CurrentUser, 186StoreLocation.CurrentUser,
dotnet-dev-certs (31)
Program.cs (3)
306var certificates = certificateManager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 367var availableCertificates = CertificateManager.Instance.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true); 382var certificates = manager.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, exportPath.HasValue());
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (14)
135StoreLocation location, 254ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 289var allCurrentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 290var allLocalMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 546var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 612var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 632protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 641protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 861var location = StoreLocation.CurrentUser; 894internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 1023using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 1097public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1143public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
312protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 379protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 381return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 386if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
172protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 209using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 448using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 536protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 538return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
59protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 81using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 110using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 127var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 132protected 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;
Infrastructure.Common (13)
CertificateManager.cs (12)
20private static StoreLocation s_platformSpecificRootStoreLocation = StoreLocation.LocalMachine; 40internal static StoreLocation PlatformSpecificRootStoreLocation 48using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 56s_platformSpecificRootStoreLocation = StoreLocation.CurrentUser; 61s_platformSpecificRootStoreLocation = StoreLocation.CurrentUser; 90StoreLocation storeLocation, 178StoreLocation storeLocation, 215return CertificateFromThumbprint(StoreName.My, StoreLocation.CurrentUser, thumbprint, validOnly); 221return CertificateFromThumbprint(StoreName.TrustedPeople, StoreLocation.CurrentUser, thumbprint, validOnly); 336certificate = AddToStoreIfNeeded(StoreName.My, StoreLocation.CurrentUser, certificate); 349certificate = AddToStoreIfNeeded(StoreName.TrustedPeople, StoreLocation.CurrentUser, certificate);
ServiceUtilHelper.cs (1)
77public static StoreLocation PlatformSpecificRootStoreLocation
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.DeveloperCertificates.XPlat (28)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (14)
135StoreLocation location, 254ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 289var allCurrentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 290var allLocalMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 546var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 612var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 632protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 641protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 861var location = StoreLocation.CurrentUser; 894internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 1023using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 1097public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1143public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
312protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 379protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 381return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 386if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
172protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 209using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 448using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 536protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 538return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
59protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 81using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 110using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 127var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 132protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
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)
329var storeLocation = StoreLocation.CurrentUser; 332storeLocation = (StoreLocation)Enum.Parse(typeof(StoreLocation), location, ignoreCase: true);
KestrelServerOptions.cs (1)
411var certs = CertificateManager.Instance.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: false);
ListenOptionsHttpsExtensions.cs (3)
94=> listenOptions.UseHttps(storeName, subject, allowInvalid, StoreLocation.CurrentUser); 105public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location) 118public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location,
Middleware\HttpsConnectionMiddleware.cs (13)
288X509Store? OpenStore(StoreLocation storeLocation) 305var store = OpenStore(StoreLocation.LocalMachine); 315_logger.FoundCertWithPrivateKey(certs[0], StoreLocation.LocalMachine); 321store = OpenStore(StoreLocation.CurrentUser); 331_logger.FoundCertWithPrivateKey(certs[0], StoreLocation.CurrentUser); 635public static void FoundCertWithPrivateKey(this ILogger<HttpsConnectionMiddleware> logger, X509Certificate2 certificate, StoreLocation storeLocation) 637var storeLocationString = storeLocation == StoreLocation.LocalMachine ? nameof(StoreLocation.LocalMachine) : nameof(StoreLocation.CurrentUser); 653public static void FailedToOpenStore(this ILogger<HttpsConnectionMiddleware> logger, StoreLocation storeLocation, Exception exception) 655var storeLocationString = storeLocation == StoreLocation.LocalMachine ? nameof(StoreLocation.LocalMachine) : nameof(StoreLocation.CurrentUser);
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (14)
135StoreLocation location, 254ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 289var allCurrentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 290var allLocalMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 546var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 612var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 632protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 641protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 861var location = StoreLocation.CurrentUser; 894internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 1023using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 1097public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1143public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
312protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 379protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 381return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 386if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
172protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 209using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 448using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 536protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 538return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
59protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 81using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 110using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 127var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 132protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Microsoft.Build.Tasks.Core (3)
ManifestUtil\SecurityUtil.cs (2)
931var personalStore = new X509Store(StoreName.My, StoreLocation.CurrentUser); 950var personalStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
ResolveKeySource.cs (1)
183var personalStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
netstandard (1)
netstandard.cs (1)
1948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreLocation))]
NuGet.CommandLine.XPlat (5)
Commands\Signing\SignCommand.cs (5)
151StoreLocation storeLocation = ValidateAndParseStoreLocation(locationValue); 219private static StoreLocation ValidateAndParseStoreLocation(string? locationValue) 221StoreLocation storeLocation = StoreLocation.CurrentUser; 230string.Join(",", Enum.GetValues<StoreLocation>().ToList())));
NuGet.Commands (4)
ClientCertificatesCommand\ClientCertArgsExtensions.cs (2)
26public static StoreLocation? GetStoreLocation(this IClientCertArgsWithStoreData args) 28if (Enum.TryParse(args.StoreLocation, ignoreCase: true, result: out StoreLocation value))
SignCommand\CertificateFindOptions.cs (1)
36public StoreLocation StoreLocation { get; set; }
SignCommand\SignArgs.cs (1)
42public StoreLocation CertificateStoreLocation { get; set; }
NuGet.Configuration (9)
Settings\Items\StoreClientCertItem.cs (9)
24private const StoreLocation DefaultStoreLocation = StoreLocation.CurrentUser; 37public static string GetString(StoreLocation storeLocation) 44StoreLocation? storeLocation = null, 125public StoreLocation StoreLocation 129if (Enum.TryParse(Attributes[ConfigurationConstants.StoreLocationAttribute], ignoreCase: true, result: out StoreLocation result)) 167GetString(StoreLocation.CurrentUser), 168GetString(StoreLocation.LocalMachine) 264StoreLocation? storeLocation = null,
PresentationUI (1)
MS\Internal\Documents\DocumentSignatureManager.cs (1)
905X509Store store = new X509Store(StoreLocation.CurrentUser);
RepoTasks (28)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (14)
135StoreLocation location, 254ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 289var allCurrentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 290var allLocalMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 546var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 612var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 632protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 641protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 861var location = StoreLocation.CurrentUser; 894internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 1023using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 1097public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 1143public void SaveCertificateInStoreStart(string certificate, StoreName name, StoreLocation location) => WriteEvent(20, certificate, name, location);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
312protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 379protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 381return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 386if (store.Name! == StoreName.My.ToString() && store.Location == StoreLocation.CurrentUser && Directory.Exists(MacOSUserHttpsCertificateLocation))
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (5)
172protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 209using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 448using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 536protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation) 538return ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (5)
59protected override X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation) 81using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 110using var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); 127var isTrusted = ListCertificates(StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false) 132protected override IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation)
Security.TransportSecurity.IntegrationTests (10)
Https\HttpsTests.4.1.0.cs (5)
42StoreLocation.CurrentUser, 371StoreLocation.CurrentUser, 419StoreLocation.CurrentUser, 481StoreLocation.CurrentUser, 541StoreLocation.CurrentUser,
Tcp\ClientCredentialTypeTests.4.1.0.cs (2)
39StoreLocation.CurrentUser, 90StoreLocation.CurrentUser,
Tcp\ClientCredentialTypeTests.4.1.1.cs (1)
251StoreLocation.CurrentUser,
Tcp\ClientCredentialTypeTests.OSX.cs (1)
153using (store = new X509Store(StoreName.Disallowed, StoreLocation.CurrentUser))
Tcp\SctRenewalRegressionTests.cs (1)
64StoreLocation.CurrentUser,
System (1)
parent\ref\System.cs (1)
859[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreLocation))]
System.Net.Http (1)
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateHelper.Unix.cs (1)
14using (var myStore = new X509Store(StoreName.My, StoreLocation.CurrentUser))
System.Net.Http.WinHttpHandler (1)
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateHelper.Windows.cs (1)
14using (var myStore = new X509Store(StoreName.My, StoreLocation.CurrentUser))
System.Net.Security (8)
System\Net\CertificateValidationPal.cs (4)
27static partial void CheckSupportsStore(StoreLocation storeLocation, ref bool hasSupport); 35StoreLocation storeLocation = isMachineStore ? StoreLocation.LocalMachine : StoreLocation.CurrentUser;
System\Net\CertificateValidationPal.Unix.cs (4)
170static partial void CheckSupportsStore(StoreLocation storeLocation, ref bool hasSupport) 176if (storeLocation == StoreLocation.LocalMachine) 180private static X509Store OpenStore(StoreLocation storeLocation) 182Debug.Assert(storeLocation == StoreLocation.CurrentUser);
System.Security.Cryptography (18)
System\Security\Cryptography\X509Certificates\StorePal.cs (1)
30StoreLocation storeLocation,
System\Security\Cryptography\X509Certificates\StorePal.Windows.Import.cs (4)
192internal static partial IStorePal FromSystemStore(string storeName, StoreLocation storeLocation, OpenFlags openFlags) 216private static Interop.Crypt32.CertStoreFlags MapX509StoreFlags(StoreLocation storeLocation, OpenFlags flags) 235if (storeLocation == StoreLocation.LocalMachine) 237else if (storeLocation == StoreLocation.CurrentUser)
System\Security\Cryptography\X509Certificates\X509Store.cs (13)
18: this("MY", StoreLocation.CurrentUser) 23: this(storeName, StoreLocation.CurrentUser) 28: this(storeName, StoreLocation.CurrentUser) 32public X509Store(StoreLocation storeLocation) 37public X509Store(StoreName storeName, StoreLocation storeLocation) 39if (storeLocation != StoreLocation.CurrentUser && storeLocation != StoreLocation.LocalMachine) 57public X509Store(StoreName storeName, StoreLocation storeLocation, OpenFlags flags) 63public X509Store(string storeName, StoreLocation storeLocation) 65if (storeLocation != StoreLocation.CurrentUser && storeLocation != StoreLocation.LocalMachine) 72public X509Store(string storeName, System.Security.Cryptography.X509Certificates.StoreLocation storeLocation, System.Security.Cryptography.X509Certificates.OpenFlags flags) 100public StoreLocation Location { get; }
System.Security.Cryptography.Pkcs (7)
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\Pal\Windows\DecryptorPalWindows.Decrypt.cs (2)
224candidateCerts.AddRange(PkcsHelpers.GetStoreCertificates(StoreName.AddressBook, StoreLocation.CurrentUser, openExistingOnly: true)); 225candidateCerts.AddRange(PkcsHelpers.GetStoreCertificates(StoreName.AddressBook, StoreLocation.LocalMachine, openExistingOnly: true));
Internal\Cryptography\Pal\Windows\PkcsPalWindows.cs (2)
59certs.AddRange(PkcsHelpers.GetStoreCertificates(StoreName.My, StoreLocation.CurrentUser, openExistingOnly: true)); 60certs.AddRange(PkcsHelpers.GetStoreCertificates(StoreName.My, StoreLocation.LocalMachine, openExistingOnly: true));
Internal\Cryptography\PkcsHelpers.cs (1)
218public 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)
921stores[0] = new X509Store(storeName, StoreLocation.CurrentUser); 922stores[1] = new X509Store(storeName, StoreLocation.LocalMachine);
System.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpsChannelFactory.cs (1)
298using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
System.ServiceModel.Primitives (24)
System\IdentityModel\Selectors\X509CertificateValidator.cs (1)
124X509Store store = new X509Store(storeName, StoreLocation.CurrentUser);
System\ServiceModel\Security\SecurityUtils.cs (4)
846internal static X509Certificate2 GetCertificateFromStore(StoreName storeName, StoreLocation storeLocation, 858internal static bool TryGetCertificateFromStore(StoreName storeName, StoreLocation storeLocation, 865private static X509Certificate2 GetCertificateFromStoreCore(StoreName storeName, StoreLocation storeLocation, 901internal static Exception CreateCertificateLoadException(StoreName storeName, StoreLocation storeLocation,
System\ServiceModel\Security\X509CertificateInitiatorClientCredential.cs (4)
12internal const StoreLocation DefaultStoreLocation = StoreLocation.CurrentUser; 54public void SetCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName) 64public void SetCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
System\ServiceModel\Security\X509CertificateRecipientClientCredential.cs (6)
15internal const StoreLocation DefaultStoreLocation = StoreLocation.CurrentUser; 75public void SetDefaultCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName) 84public void SetDefaultCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue) 94public void SetScopedCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName, Uri targetService) 103public void SetScopedCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue, Uri targetService)
System\ServiceModel\Security\X509ClientCertificateAuthentication.cs (3)
15internal const StoreLocation DefaultTrustedStoreLocation = StoreLocation.LocalMachine; 24bool useMachineContext = DefaultTrustedStoreLocation == StoreLocation.LocalMachine;
System\ServiceModel\Security\X509ServiceCertificateAuthentication.cs (6)
18internal const StoreLocation DefaultTrustedStoreLocation = StoreLocation.CurrentUser; 25private StoreLocation _trustedStoreLocation = DefaultTrustedStoreLocation; 48bool useMachineContext = DefaultTrustedStoreLocation == StoreLocation.LocalMachine; 92public StoreLocation TrustedStoreLocation 135bool useMachineContext = _trustedStoreLocation == StoreLocation.LocalMachine;