127 references to X509ContentType
aspire (13)
Certificates\CertificateGeneration\CertificateManager.cs (4)
678bytes = certificate.Export(X509ContentType.Pkcs12, password); 710bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 720bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 724bytes = certificate.Export(X509ContentType.Cert);
Certificates\CertificateGeneration\MacOSCertificateManager.cs (2)
221var certBytes = certificate.Export(X509ContentType.Cert); 349var certBytes = certificate.Export(X509ContentType.Pfx, password);
Certificates\CertificateGeneration\UnixCertificateManager.cs (3)
197var export = certificate.Export(X509ContentType.Pkcs12, ""); 244using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert)); 674var certBytes = certificate.Export(X509ContentType.Cert);
Certificates\CertificateGeneration\WindowsCertificateManager.cs (2)
59var export = certificate.Export(X509ContentType.Pkcs12, ""); 91using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Utils\EnvironmentChecker\DcpConnectionChecker.cs (1)
150using var serverCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Utils\EnvironmentChecker\DcpKubeconfig.cs (1)
146return X509CertificateLoader.LoadPkcs12(certificate.Export(X509ContentType.Pkcs12), password: null, X509KeyStorageFlags.EphemeralKeySet);
Aspire.Cli.Tests (3)
Certificates\DeveloperCertificateCacheWriteTests.cs (1)
37File.WriteAllBytes(onDiskPfxPath, certificate.Export(X509ContentType.Pfx));
Certificates\NativeCertificateToolRunnerTests.cs (1)
70certificateManager.Certificates.Add(certificate.Export(X509ContentType.Pfx));
Utils\DevCertsCheckTests.cs (1)
54return X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
369return new X509Certificate2(certificate.Export(X509ContentType.Pfx));
Aspire.Dashboard.Tests (6)
Integration\StartupTests.cs (1)
361initialData[DashboardConfigNames.DebugSessionServerCertificateName.ConfigKey] = Convert.ToBase64String(testCert.Export(X509ContentType.Cert));
Telemetry\DashboardTelemetrySenderTests.cs (3)
40ServerCertificate = Convert.ToBase64String(TelemetryTestHelpers.GenerateDummyCertificate().Export(X509ContentType.Cert)), 67ServerCertificate = Convert.ToBase64String(TelemetryTestHelpers.GenerateDummyCertificate().Export(X509ContentType.Cert)), 117ServerCertificate = isHttps ? Convert.ToBase64String(TelemetryTestHelpers.GenerateDummyCertificate().Export(X509ContentType.Cert)) : null,
Telemetry\DashboardTelemetryServiceTests.cs (1)
91ServerCertificate = Convert.ToBase64String(TelemetryTestHelpers.GenerateDummyCertificate().Export(X509ContentType.Cert)),
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
369return new X509Certificate2(certificate.Export(X509ContentType.Pfx));
Aspire.Hosting (1)
DeveloperCertificateService.cs (1)
342var pfxBytes = needPfx ? certificate.Export(X509ContentType.Pfx, password) : null;
Aspire.Hosting.Java (1)
JavaHostingExtensions.cs (1)
1714using var publicCert = X509CertificateLoader.LoadCertificate(certificates[i].Export(X509ContentType.Cert));
Aspire.Hosting.Tests (4)
Dcp\DcpHostNotificationTests.cs (1)
730return X509CertificateLoader.LoadPkcs12(certificate.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable);
DeveloperCertificateServiceTests.cs (2)
66using var publicOnly = X509CertificateLoader.LoadCertificate(cert.Export(X509ContentType.Cert)); 95var pfxBytes = selfSigned.Export(X509ContentType.Pfx);
ExecutionConfigurationGathererTests.cs (1)
565var publicCert = new X509Certificate2(certificates[i].Export(X509ContentType.Cert));
dotnet-dev-certs (12)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (4)
680bytes = certificate.Export(X509ContentType.Pkcs12, password); 712bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 722bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 726bytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
206var certBytes = certificate.Export(X509ContentType.Cert); 309var certBytes = certificate.Export(X509ContentType.Pfx); 337var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
174var export = certificate.Export(X509ContentType.Pkcs12, ""); 220using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert)); 672var certBytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
63var export = certificate.Export(X509ContentType.Pkcs12, ""); 94using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (12)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (4)
680bytes = certificate.Export(X509ContentType.Pkcs12, password); 712bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 722bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 726bytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
206var certBytes = certificate.Export(X509ContentType.Cert); 309var certBytes = certificate.Export(X509ContentType.Pfx); 337var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
174var export = certificate.Export(X509ContentType.Pkcs12, ""); 220using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert)); 672var certBytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
63var export = certificate.Export(X509ContentType.Pkcs12, ""); 94using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Microsoft.AspNetCore.Server.Kestrel.Core (14)
Internal\Certificates\CertificateConfigLoader.cs (2)
89var certificateBytes = fullCertificate.Export(X509ContentType.Pkcs12, ""); 265if (X509Certificate2.GetCertContentType(certificatePath) == X509ContentType.Cert)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (4)
680bytes = certificate.Export(X509ContentType.Pkcs12, password); 712bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 722bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 726bytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
206var certBytes = certificate.Export(X509ContentType.Cert); 309var certBytes = certificate.Export(X509ContentType.Pfx); 337var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
174var export = certificate.Export(X509ContentType.Pkcs12, ""); 220using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert)); 672var certBytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
63var export = certificate.Export(X509ContentType.Pkcs12, ""); 94using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (1)
DirectTlsTransportFactory.cs (1)
238using var convertedCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
Microsoft.DotNet.HotReload.Watch (2)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
92var certBytes = _certificate.Export(X509ContentType.Cert);
src\sdk\src\Dotnet.Watch\AspireService\Helpers\CertGenerator.cs (1)
41return X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.UserKeySet);
mscorlib (1)
src\runtime\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))]
RepoTasks (12)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (4)
680bytes = certificate.Export(X509ContentType.Pkcs12, password); 712bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 722bytes = Encoding.ASCII.GetBytes(PemEncoding.Write("CERTIFICATE", certificate.Export(X509ContentType.Cert))); 726bytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (3)
206var certBytes = certificate.Export(X509ContentType.Cert); 309var certBytes = certificate.Export(X509ContentType.Pfx); 337var certBytes = certificate.Export(X509ContentType.Pfx, password);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
174var export = certificate.Export(X509ContentType.Pkcs12, ""); 220using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert)); 672var certBytes = certificate.Export(X509ContentType.Cert);
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
63var export = certificate.Export(X509ContentType.Pkcs12, ""); 94using var publicCertificate = X509CertificateLoader.LoadCertificate(certificate.Export(X509ContentType.Cert));
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 (38)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (3)
36/// <see cref="X509ContentType.Cert" /> by <see cref="X509Certificate2.GetCertContentType(byte[])"/>. 57/// <see cref="X509ContentType.Cert" /> by <see cref="X509Certificate2.GetCertContentType(byte[])"/>. 81/// <see cref="X509ContentType.Cert" /> by <see cref="X509Certificate2.GetCertContentType(string)"/>.
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (1)
548public byte[] Export(X509ContentType contentType, SafePasswordHandle password)
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\StorePal.Windows.Export.cs (6)
25public byte[]? Export(X509ContentType contentType, SafePasswordHandle password) 30case X509ContentType.Cert: 53case X509ContentType.SerializedCert: 77case X509ContentType.Pkcs12: 80case X509ContentType.SerializedStore: 83case X509ContentType.Pkcs7:
System\Security\Cryptography\X509Certificates\X509Certificate.cs (7)
318public virtual byte[] Export(X509ContentType contentType) 323public virtual byte[] Export(X509ContentType contentType, string? password) 337public virtual byte[] Export(X509ContentType contentType, SecureString? password) 764private static void VerifyContentType(X509ContentType contentType) 766if (!(contentType == X509ContentType.Cert || contentType == X509ContentType.SerializedCert || contentType == X509ContentType.Pkcs12))
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (3)
392public static X509ContentType GetCertContentType(byte[] rawData) 410public static X509ContentType GetCertContentType(ReadOnlySpan<byte> rawData) 419public static X509ContentType GetCertContentType(string fileName)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (4)
108public byte[]? Export(X509ContentType contentType) 181public byte[]? Export(X509ContentType contentType, string? password) 499byte[]? pkcs7 = Export(X509ContentType.Pkcs7); 526byte[]? pkcs7 = Export(X509ContentType.Pkcs7);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.GetCertContentType.cs (10)
15public X509ContentType GetCertContentType(ReadOnlySpan<byte> rawData) 45public X509ContentType GetCertContentType(string fileName) 78private static X509ContentType MapContentType(Interop.Crypt32.ContentType contentType) 83return X509ContentType.Cert; 85return X509ContentType.SerializedStore; 87return X509ContentType.SerializedCert; 90return X509ContentType.Pkcs7; 92return X509ContentType.Authenticode; 94return X509ContentType.Pkcs12; 96return X509ContentType.Unknown;
System.Security.Cryptography.Pkcs (1)
Internal\Cryptography\Pal\Windows\PkcsPalWindows.Encrypt.cs (1)
171byte[] certEncoded = originatorCerts[i].Export(X509ContentType.Cert);
System.Security.Cryptography.X509Certificates (1)
System.Security.Cryptography.X509Certificates.cs (1)
30[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.X509Certificates.X509ContentType))]