Archived Forum Post

Index of archived forum posts


Is it possible to convert a Chilkat.Cert object to a byte array?

Apr 14 '14 at 17:13

This is to avoid creating a .pfx file on the computer. I tried to serialize the object but it won't let me because Chilkat.Cert is not marked as serializable.

I tried to use .ExportCertDer() method, however, when i try to instantiate a X509Certificate2 object it tells me it doesn't have a private key

Accepted Answer

There is an ExportToPfxFile method, but it (obviously) exports to a PFX file. I will add an ExportToPfxData method to export to an in-memory byte array. Please let me know exactly what build you would need (programming language, operating system, and whatever else is applicable: .NET Framework, Visual Studio version, Perl version, Python version, 32-bit/64-bit, etc.)


Here are the new builds:

See the ExportToPfxData method added to the reference documentation here: