Skip to content

Commit ef0ba37

Browse files
committed
Use X509CertificateLoader
1 parent 5a82b55 commit ef0ba37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Contrast.K8s.AgentOperator/Core/Tls/TlsCertificateChainConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public TlsCertificateChainExport Export(TlsCertificateChain chain)
3131

3232
public TlsCertificateChain Import(TlsCertificateChainExport export)
3333
{
34-
var caCertificate = new X509Certificate2(export.CaCertificatePfx, (string?)null, X509KeyStorageFlags.Exportable);
35-
var serverCertificate = new X509Certificate2(export.ServerCertificatePfx, (string?)null, X509KeyStorageFlags.Exportable);
34+
var caCertificate = X509CertificateLoader.LoadPkcs12(export.CaCertificatePfx, null, X509KeyStorageFlags.Exportable);
35+
var serverCertificate = X509CertificateLoader.LoadPkcs12(export.ServerCertificatePfx, null, X509KeyStorageFlags.Exportable);
3636

3737
return new TlsCertificateChain(caCertificate, serverCertificate, export.SansHash, export.Version);
3838
}

0 commit comments

Comments
 (0)