I'm having trouble with objEnroll.CreatePFX
where the only return type is string, and what I need is a binary output comparable to what happens when I open the Certificates MMC and export a PFX.
This is important because I need the original PFX format so I can import the private key into OSX and iPhone.
CX509Enrollment objEnroll = new CX509Enrollment();
objEnroll.InitializeFromTemplateName(
X509CertificateEnrollmentContext.ContextUser,
templateName);
// ...
objEnroll.Enroll();
string pfxString = objEnroll.CreatePFX("q", PFXExportOptions.PFXExportEEOnly, EncodingType.XCN_CRYPT_STRING_BINARY);
What is the correct way to set the EncodingType
so that it can be properly converted into a binary output? (Similar to a Windows certificate export )