182 references to X509KeyStorageFlags
dotnet-dev-certs (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
56imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
56imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
56imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
56imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
IIS.ShadowCopy.Tests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
56imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
IISExpress.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (2)
56imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Infrastructure.Common (7)
ServiceUtilHelper.cs (7)
352X509KeyStorageFlags storageFlags = X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.UserKeySet; 359storageFlags = X509KeyStorageFlags.Exportable; 371X509Certificate2 peerCertificate = new X509Certificate2(GetResourceFromServiceAsByteArray(PeerCertificateResource), "test", X509KeyStorageFlags.DefaultKeySet); 380X509Certificate2 peerCertificate = new X509Certificate2(GetResourceFromServiceAsByteArray(PeerCertificateResource), "test", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.UserKeySet);
InMemory.FunctionalTests (1)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
165endEntity = new X509Certificate2(endEntity.Export(X509ContentType.Pfx), (string?)null, X509KeyStorageFlags.Exportable);
Interop.FunctionalTests (1)
Http3\Http3TlsTests.cs (1)
433var expectedCertificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable);
Microsoft.AspNetCore.DataProtection.Extensions.Tests (2)
DataProtectionProviderTests.cs (2)
122using (var imported = new X509Certificate2(filePath, "password", X509KeyStorageFlags.Exportable)) 176var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3WithoutPrivateKey.pfx"), "password3", X509KeyStorageFlags.Exportable);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Microsoft.AspNetCore.Server.Kestrel.Core (7)
Internal\Certificates\CertificateConfigLoader.cs (1)
89return new X509Certificate2(certificateBytes, "", X509KeyStorageFlags.DefaultKeySet);
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
165endEntity = new X509Certificate2(endEntity.Export(X509ContentType.Pfx), (string?)null, X509KeyStorageFlags.Exportable);
Microsoft.AspNetCore.Server.Kestrel.Tests (10)
KestrelConfigurationLoaderTests.cs (10)
249var certificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 290var devCert = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 416var certificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 463var certificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 512var certificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 706var certificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 859var oldCertificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 862var newCertificate = new X509Certificate2(TestResources.TestCertificatePath, "testPassword", X509KeyStorageFlags.Exportable); 957var oldCertificate = new X509Certificate2(TestResources.GetCertPath("aspnetdevcert.pfx"), "testPassword", X509KeyStorageFlags.Exportable); 962var newCertificate = new X509Certificate2(TestResources.TestCertificatePath, "testPassword", X509KeyStorageFlags.Exportable);
Microsoft.Build.Tasks.Core (1)
ManifestUtil\SecurityUtil.cs (1)
613using X509Certificate2 cert = new X509Certificate2(certPath, certPassword, X509KeyStorageFlags.PersistKeySet);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
937[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509KeyStorageFlags))]
netstandard (1)
netstandard.cs (1)
1973[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509KeyStorageFlags))]
System.Security.Cryptography (95)
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (23)
119/// <see cref="LoadPkcs12Collection(ReadOnlySpan{byte},ReadOnlySpan{char},X509KeyStorageFlags,Pkcs12LoaderLimits?)" />, 131X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 178/// <see cref="LoadPkcs12Collection(byte[],string?, X509KeyStorageFlags,Pkcs12LoaderLimits?)" />, 190X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 249/// <see cref="LoadPkcs12CollectionFromFile(string,string?, X509KeyStorageFlags,Pkcs12LoaderLimits?)" />, 261X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 311/// <see cref="LoadPkcs12CollectionFromFile(string, ReadOnlySpan{char}, X509KeyStorageFlags,Pkcs12LoaderLimits?)" />, 323X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 372X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 420X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 483X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 535X509KeyStorageFlags keyStorageFlags = X509KeyStorageFlags.DefaultKeySet, 552X509KeyStorageFlags keyStorageFlags, 558X509KeyStorageFlags keyStorageFlags, 688static partial void ValidateKeyStorageFlagsCore(X509KeyStorageFlags keyStorageFlags);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (6)
37X509KeyStorageFlags keyStorageFlags, 43X509KeyStorageFlags keyStorageFlags, 49X509KeyStorageFlags keyStorageFlags); 54X509KeyStorageFlags keyStorageFlags); 59X509KeyStorageFlags keyStorageFlags, 97X509KeyStorageFlags keyStorageFlags,
System\Security\Cryptography\X509Certificates\CertificatePal.cs (2)
17X509KeyStorageFlags keyStorageFlags); 22X509KeyStorageFlags keyStorageFlags);
System\Security\Cryptography\X509Certificates\CertificatePal.OpenSsl.cs (2)
23internal static partial ICertificatePal FromBlob(ReadOnlySpan<byte> rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) 28internal static partial ICertificatePal FromFile(string fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (2)
42public static ICertificatePal FromBlob(ReadOnlySpan<byte> rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) 73public static ICertificatePal FromFile(string fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
System\Security\Cryptography\X509Certificates\StorePal.cs (2)
16X509KeyStorageFlags keyStorageFlags); 21X509KeyStorageFlags keyStorageFlags);
System\Security\Cryptography\X509Certificates\StorePal.OpenSsl.cs (3)
19internal static partial ILoaderPal FromBlob(ReadOnlySpan<byte> rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) 62internal static partial ILoaderPal FromFile(string fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) 76X509KeyStorageFlags keyStorageFlags)
System\Security\Cryptography\X509Certificates\X509Certificate.cs (17)
69Pal = CertificatePal.FromBlob(data, SafePasswordHandle.InvalidHandle, X509KeyStorageFlags.DefaultKeySet); 76: this(rawData, password, X509KeyStorageFlags.DefaultKeySet) 84: this(rawData, password, X509KeyStorageFlags.DefaultKeySet) 90public X509Certificate(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags) 106public X509Certificate(byte[] rawData, SecureString? password, X509KeyStorageFlags keyStorageFlags) 119private protected X509Certificate(ReadOnlySpan<byte> rawData, ReadOnlySpan<char> password, X509KeyStorageFlags keyStorageFlags) 147: this(fileName, (string?)null, X509KeyStorageFlags.DefaultKeySet) 154: this(fileName, password, X509KeyStorageFlags.DefaultKeySet) 162: this(fileName, password, X509KeyStorageFlags.DefaultKeySet) 168public X509Certificate(string fileName, string? password, X509KeyStorageFlags keyStorageFlags) 180private protected X509Certificate(string fileName, ReadOnlySpan<char> password, X509KeyStorageFlags keyStorageFlags) 196public X509Certificate(string fileName, SecureString? password, X509KeyStorageFlags keyStorageFlags) : this() 583public virtual void Import(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags) 590public virtual void Import(byte[] rawData, SecureString? password, X509KeyStorageFlags keyStorageFlags) 602public virtual void Import(string fileName, string? password, X509KeyStorageFlags keyStorageFlags) 609public virtual void Import(string fileName, SecureString? password, X509KeyStorageFlags keyStorageFlags) 680internal static void ValidateKeyStorageFlags(X509KeyStorageFlags keyStorageFlags) =>
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (10)
74public X509Certificate2(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags) 82public X509Certificate2(byte[] rawData, SecureString? password, X509KeyStorageFlags keyStorageFlags) 117public X509Certificate2(ReadOnlySpan<byte> rawData, ReadOnlySpan<char> password, X509KeyStorageFlags keyStorageFlags = 0) 157public X509Certificate2(string fileName, string? password, X509KeyStorageFlags keyStorageFlags) 165public X509Certificate2(string fileName, SecureString? password, X509KeyStorageFlags keyStorageFlags) 172public X509Certificate2(string fileName, ReadOnlySpan<char> password, X509KeyStorageFlags keyStorageFlags = 0) 642public override void Import(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags) 649public override void Import(byte[] rawData, SecureString? password, X509KeyStorageFlags keyStorageFlags) 661public override void Import(string fileName, string? password, X509KeyStorageFlags keyStorageFlags) 668public override void Import(string fileName, SecureString? password, X509KeyStorageFlags keyStorageFlags)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (7)
156using (ILoaderPal storePal = StorePal.FromBlob(rawData, SafePasswordHandle.InvalidHandle, X509KeyStorageFlags.DefaultKeySet)) 163public void Import(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags = 0) 183public void Import(ReadOnlySpan<byte> rawData, string? password, X509KeyStorageFlags keyStorageFlags = 0) 201public void Import(ReadOnlySpan<byte> rawData, ReadOnlySpan<char> password, X509KeyStorageFlags keyStorageFlags = 0) 217using (ILoaderPal storePal = StorePal.FromFile(fileName, SafePasswordHandle.InvalidHandle, X509KeyStorageFlags.DefaultKeySet)) 224public void Import(string fileName, string? password, X509KeyStorageFlags keyStorageFlags = 0) 250public void Import(string fileName, ReadOnlySpan<char> password, X509KeyStorageFlags keyStorageFlags = 0)
System\Security\Cryptography\X509Certificates\X509CertificateLoader.netcore.cs (16)
45X509KeyStorageFlags keyStorageFlags, 69X509KeyStorageFlags keyStorageFlags, 84private const X509KeyStorageFlags KeyStorageFlagsAll = 85X509KeyStorageFlags.UserKeySet | 86X509KeyStorageFlags.MachineKeySet | 87X509KeyStorageFlags.Exportable | 88X509KeyStorageFlags.UserProtected | 89X509KeyStorageFlags.PersistKeySet | 90X509KeyStorageFlags.EphemeralKeySet; 92internal static void ValidateKeyStorageFlags(X509KeyStorageFlags keyStorageFlags) 97static partial void ValidateKeyStorageFlagsCore(X509KeyStorageFlags keyStorageFlags) 104const X509KeyStorageFlags EphemeralPersist = 105X509KeyStorageFlags.EphemeralKeySet | X509KeyStorageFlags.PersistKeySet; 107X509KeyStorageFlags persistenceFlags = keyStorageFlags & EphemeralPersist; 119static partial void ValidatePlatformKeyStorageFlags(X509KeyStorageFlags keyStorageFlags);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (5)
21static partial void InitializeImportState(ref ImportState importState, X509KeyStorageFlags keyStorageFlags); 26X509KeyStorageFlags keyStorageFlags) 28bool ephemeral = (keyStorageFlags & X509KeyStorageFlags.EphemeralKeySet) != 0; 80X509KeyStorageFlags keyStorageFlags) 82bool ephemeral = (keyStorageFlags & X509KeyStorageFlags.EphemeralKeySet) != 0;
System.Security.Cryptography.X509Certificates (1)
System.Security.Cryptography.X509Certificates.cs (1)
37[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509KeyStorageFlags))]
Templates.Blazor.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Templates.Blazor.WebAssembly.Auth.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Templates.Blazor.WebAssembly.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Templates.Mvc.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
Templates.Tests (6)
src\Shared\CertificateGeneration\CertificateManager.cs (2)
420certificate = new X509Certificate2(certificatePath, password, X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
156certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
60certificate = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);