377 references to StoreName
Binding.UDS.IntegrationTests (1)
ServiceHelper.cs (1)
50using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
Client.ChannelLayer.IntegrationTests (3)
DuplexChannelWithSynchronizationContext.cs (3)
47StoreName.My, 108StoreName.My, 184StoreName.My,
dotnet-dev-certs (34)
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 (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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 (16)
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)
12internal const StoreName DefaultStoreName = StoreName.My; 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)
16internal const StoreName DefaultStoreName = StoreName.My; 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)
Http3SampleApp (2)
Program.cs (2)
27var cert = CertificateLoader.LoadFromStoreCert("localhost", StoreName.My.ToString(), StoreLocation.CurrentUser, false); 55listenOptions.UseHttps(StoreName.My, "localhost");
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 (9)
CertificateManager.cs (9)
47using (var store = new X509Store(StoreName.Root, StoreLocation.LocalMachine)) 88public static X509Certificate2 AddToStoreIfNeeded(StoreName storeName, 174private static X509Certificate2 CertificateFromThumbprint(StoreName storeName, 206return CertificateFromThumbprint(StoreName.Root, PlatformSpecificRootStoreLocation, thumbprint, validOnly); 212return CertificateFromThumbprint(StoreName.My, StoreLocation.CurrentUser, thumbprint, validOnly); 218return CertificateFromThumbprint(StoreName.TrustedPeople, StoreLocation.CurrentUser, thumbprint, validOnly); 233certificate = AddToStoreIfNeeded(StoreName.Root, PlatformSpecificRootStoreLocation, certificate); 245certificate = AddToStoreIfNeeded(StoreName.My, StoreLocation.CurrentUser, certificate); 258certificate = AddToStoreIfNeeded(StoreName.TrustedPeople, StoreLocation.CurrentUser, certificate);
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)
123listenOptions.UseHttps(StoreName.My, "localhost", allowInvalid: true);
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) 40public StoreName Name { get; }
Microsoft.AspNetCore.DeveloperCertificates.XPlat (31)
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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 (38)
Internal\Certificates\CertificateConfigLoader.cs (1)
180var storeName = string.IsNullOrEmpty(certInfo.Store) ? StoreName.My.ToString() : certInfo.Store;
KestrelServerOptions.cs (1)
382var certs = CertificateManager.Instance.ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: false);
ListenOptionsHttpsExtensions.cs (4)
79public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject) 90public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid) 102public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location) 115public static ListenOptions UseHttps(this ListenOptions listenOptions, StoreName storeName, string subject, bool allowInvalid, StoreLocation location,
Middleware\HttpsConnectionMiddleware.cs (1)
261var store = new X509Store(StoreName.My, storeLocation);
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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))
Microsoft.Build.Tasks.Core (3)
ManifestUtil\SecurityUtil.cs (2)
889var personalStore = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908var personalStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
ResolveKeySource.cs (1)
180var personalStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
Microsoft.Build.Tasks.UnitTests (1)
SecurityUtil_Tests.cs (1)
49private static readonly X509Store s_personalStore = new(StoreName.My, StoreLocation.CurrentUser);
Microsoft.DotNet.SignCheckLibrary (1)
Verification\XmlVerifier.cs (1)
69using (var rootStore = new X509Store(StoreName.Root))
netstandard (1)
netstandard.cs (1)
1949[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreName))]
Security.TransportSecurity.IntegrationTests (9)
Https\HttpsTests.4.1.0.cs (5)
44StoreName.My, 377StoreName.My, 426StoreName.My, 487StoreName.My, 546StoreName.My,
Tcp\ClientCredentialTypeTests.4.1.0.cs (2)
41StoreName.My, 93StoreName.My,
Tcp\ClientCredentialTypeTests.4.1.1.cs (1)
251StoreName.My,
Tcp\ClientCredentialTypeTests.OSX.cs (1)
153using (store = new X509Store(StoreName.Disallowed, StoreLocation.CurrentUser))
System (1)
src\libraries\shims\System\ref\System.cs (1)
860[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreName))]
System.Net.Http (1)
src\libraries\Common\src\System\Net\Security\CertificateHelper.Unix.cs (1)
14using (var myStore = new X509Store(StoreName.My, StoreLocation.CurrentUser))
System.Net.Security (1)
System\Net\CertificateValidationPal.Unix.cs (1)
184X509Store store = new X509Store(StoreName.My, storeLocation);
System.Security.Cryptography (13)
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (2)
111using (new X509Store(StoreName.Disallowed, StoreLocation.CurrentUser, OpenFlags.ReadOnly)) 205using (var userIntermediate = new X509Store(StoreName.CertificateAuthority, StoreLocation.CurrentUser))
System\Security\Cryptography\X509Certificates\X509Store.cs (11)
27public X509Store(StoreName storeName) 37public X509Store(StoreName storeName, StoreLocation storeLocation) 44StoreName.AddressBook => "AddressBook", 45StoreName.AuthRoot => "AuthRoot", 46StoreName.CertificateAuthority => IntermediateCAStoreName, 47StoreName.Disallowed => DisallowedStoreName, 48StoreName.My => MyStoreName, 49StoreName.Root => RootStoreName, 50StoreName.TrustedPeople => "TrustedPeople", 51StoreName.TrustedPublisher => "TrustedPublisher", 57public X509Store(StoreName storeName, StoreLocation storeLocation, OpenFlags flags)
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)
12[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.StoreName))]
System.ServiceModel.Primitives (6)
netstandard.cs (6)
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 (31)
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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 (31)
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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 (31)
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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 (31)
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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 (31)
src\Shared\CertificateGeneration\CertificateManager.cs (17)
119StoreName storeName, 219ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 233var currentUserCertificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true); 234var localMachineCertificates = ListCertificates(StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true); 443var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: false); 502var certificates = ListCertificates(StoreName.My, StoreLocation.CurrentUser, isValid: false); 522protected abstract X509Certificate2 SaveCertificateCore(X509Certificate2 certificate, StoreName storeName, StoreLocation storeLocation); 531protected abstract IList<X509Certificate2> GetCertificatesToRemove(StoreName storeName, StoreLocation storeLocation); 737var name = StoreName.My; 771internal void RemoveAllCertificates(StoreName storeName, StoreLocation storeLocation) 776var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted; 874using var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 908/// Given a certificate, usually from the <see cref="StoreName.My"/> store, try to find the 909/// corresponding certificate in <paramref name="store"/> (usually the <see cref="StoreName.Root"/> store)."/> 951public void ListCertificatesStart(StoreLocation location, StoreName storeName) => WriteEvent(1, location, storeName); 997public 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)