I have access to an object of type X509Certicate2 in memory (it has both the private key and public key). I need to generate a physical .CER file that can be double-clicked and imported into certificate store by an end user.
So far, my attempts in doing so have failed. I’ve tried various ways to dump the Public key of the certificate into a file but non are importable by the certificate tool.
Any advice?
Turns out that as Bruno mentioned, all I needed to do was to call Export method on the object itself and the byte array containing only the public key was ready to be saved as *.cer file