173 references to X509ContentType
dotnet-dev-certs (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
HttpClientApp (1)
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
HttpStress (1)
Program.cs (1)
405cert = new X509Certificate2(cert.Export(X509ContentType.Pfx));
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
55var export = parentCert.Export(X509ContentType.Pkcs12, "");
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
55var export = parentCert.Export(X509ContentType.Pkcs12, "");
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
55var export = parentCert.Export(X509ContentType.Pkcs12, "");
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
55var export = parentCert.Export(X509ContentType.Pkcs12, "");
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
55var export = parentCert.Export(X509ContentType.Pkcs12, "");
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
55var export = parentCert.Export(X509ContentType.Pkcs12, "");
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
165endEntity = new X509Certificate2(endEntity.Export(X509ContentType.Pfx), (string?)null, X509KeyStorageFlags.Exportable);
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Interop.FunctionalTests (2)
Http3\Http3TlsTests.cs (1)
434var bytes = expectedCertificate.Export(X509ContentType.Pkcs12, "1234");
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (2)
CertificateManagerTests.cs (2)
119Output.WriteLine($"Certificate: {certificate.Subject} '{Convert.ToBase64String(certificate.Export(X509ContentType.Cert))}'."); 314File.WriteAllBytes(CertificateName, wrongSubjectCertificate.Export(X509ContentType.Pfx, certificatePassword));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Microsoft.AspNetCore.Server.Kestrel.Core (13)
Internal\Certificates\CertificateConfigLoader.cs (2)
88var certificateBytes = fullCertificate.Export(X509ContentType.Pkcs12, ""); 157if (X509Certificate2.GetCertContentType(certificatePath) == X509ContentType.Cert)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
165endEntity = new X509Certificate2(endEntity.Export(X509ContentType.Pfx), (string?)null, X509KeyStorageFlags.Exportable);
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Microsoft.AspNetCore.Server.Kestrel.Tests (11)
KestrelConfigurationLoaderTests.cs (10)
250var bytes = certificate.Export(X509ContentType.Pkcs12, "1234"); 291var devCertBytes = devCert.Export(X509ContentType.Pkcs12, "1234"); 417var bytes = certificate.Export(X509ContentType.Pkcs12, "1234"); 464var bytes = certificate.Export(X509ContentType.Pkcs12, "1234"); 513var bytes = certificate.Export(X509ContentType.Pkcs12, "1234"); 707var bytes = certificate.Export(X509ContentType.Pkcs12, "1234"); 860var oldCertificateBytes = oldCertificate.Export(X509ContentType.Pkcs12, certificatePassword); 863var newCertificateBytes = newCertificate.Export(X509ContentType.Pkcs12, certificatePassword); 958var oldCertificateBytes = oldCertificate.Export(X509ContentType.Pkcs12, certificatePassword); 963var newCertificateBytes = newCertificate.Export(X509ContentType.Pkcs12, certificatePassword);
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Microsoft.DotNet.SignTool (2)
src\VerifySignatures.cs (2)
173var certContentType = X509Certificate2.GetCertContentType(fullPath); 174if (certContentType != X509ContentType.Authenticode)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
936[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509ContentType))]
netstandard (1)
netstandard.cs (1)
1966[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509ContentType))]
Sockets.BindTests (1)
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
Sockets.FunctionalTests (1)
src\Shared\TestResources.cs (1)
51return new X509Certificate2(cert.Export(X509ContentType.Pkcs12));
System.Net.Quic (3)
System\Net\Quic\Internal\MsQuicConfiguration.cs (2)
264certificateData = collection.Export(X509ContentType.Pkcs12)!; 268certificateData = certificate.Export(X509ContentType.Pkcs12);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (1)
208Debug.Assert(X509Certificate2.GetCertContentType(chainData) is X509ContentType.Pkcs7);
System.Security.Cryptography (42)
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (3)
35/// <see cref="X509ContentType.Cert" /> by <see cref="X509Certificate2.GetCertContentType(byte[])"/>. 56/// <see cref="X509ContentType.Cert" /> by <see cref="X509Certificate2.GetCertContentType(byte[])"/>. 80/// <see cref="X509ContentType.Cert" /> by <see cref="X509Certificate2.GetCertContentType(string)"/>.
System\Security\Cryptography\X509Certificates\ICertificatePalCore.cs (1)
26byte[] Export(X509ContentType contentType, SafePasswordHandle password);
System\Security\Cryptography\X509Certificates\IExportPal.cs (1)
10byte[]? Export(X509ContentType contentType, SafePasswordHandle password);
System\Security\Cryptography\X509Certificates\IX509Pal.cs (2)
14X509ContentType GetCertContentType(ReadOnlySpan<byte> rawData); 15X509ContentType GetCertContentType(string fileName);
System\Security\Cryptography\X509Certificates\OpenSslCertificateAssetDownloader.cs (3)
27X509ContentType contentType = X509Certificate2.GetCertContentType(data); 32case X509ContentType.Cert: 35case X509ContentType.Pkcs7:
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
215byte[] pkcs12 = copy.Export(X509ContentType.Pkcs12)!;
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (1)
831public byte[] Export(X509ContentType contentType, SafePasswordHandle password)
System\Security\Cryptography\X509Certificates\OpenSslX509Encoder.cs (10)
64public X509ContentType GetCertContentType(ReadOnlySpan<byte> rawData) 74return X509ContentType.Cert; 80return X509ContentType.Pkcs7; 85return X509ContentType.Pkcs12; 93public X509ContentType GetCertContentType(string fileName) 111return X509ContentType.Cert; 120return X509ContentType.Cert; 130return X509ContentType.Pkcs7; 137return X509ContentType.Pkcs7; 147return X509ContentType.Pkcs12;
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (6)
47public byte[]? Export(X509ContentType contentType, SafePasswordHandle password) 52case X509ContentType.Cert: 54case X509ContentType.Pfx: 56case X509ContentType.Pkcs7: 58case X509ContentType.SerializedCert: 59case X509ContentType.SerializedStore:
System\Security\Cryptography\X509Certificates\X509Certificate.cs (7)
316public virtual byte[] Export(X509ContentType contentType) 321public virtual byte[] Export(X509ContentType contentType, string? password) 335public virtual byte[] Export(X509ContentType contentType, SecureString? password) 684private static void VerifyContentType(X509ContentType contentType) 686if (!(contentType == X509ContentType.Cert || contentType == X509ContentType.SerializedCert || contentType == X509ContentType.Pkcs12))
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (3)
387public static X509ContentType GetCertContentType(byte[] rawData) 405public static X509ContentType GetCertContentType(ReadOnlySpan<byte> rawData) 414public static X509ContentType GetCertContentType(string fileName)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (4)
108public byte[]? Export(X509ContentType contentType) 116public byte[]? Export(X509ContentType contentType, string? password) 434byte[]? pkcs7 = Export(X509ContentType.Pkcs7); 461byte[]? pkcs7 = Export(X509ContentType.Pkcs7);
System.Security.Cryptography.X509Certificates (1)
System.Security.Cryptography.X509Certificates.cs (1)
30[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509ContentType))]
Templates.Blazor.Tests (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Templates.Blazor.WebAssembly.Auth.Tests (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Templates.Blazor.WebAssembly.Tests (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Templates.Mvc.Tests (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Templates.Tests (11)
src\Shared\CertificateGeneration\CertificateManager.cs (4)
533bytes = certificate.Export(X509ContentType.Pkcs12, password); 565bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 575bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 579bytes = certificate.Export(X509ContentType.Cert);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
204var certBytes = certificate.Export(X509ContentType.Cert); 313var certBytes = certificate.Export(X509ContentType.Pfx); 341var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
154var export = certificate.Export(X509ContentType.Pkcs12, ""); 200using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
58var export = certificate.Export(X509ContentType.Pkcs12, ""); 89using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
WebTransportInteractiveSampleApp (1)
Program.cs (1)
195cert = new(crt.Export(X509ContentType.Pfx));
WebTransportSampleApp (1)
Program.cs (1)
81cert = new(crt.Export(X509ContentType.Pfx));