Archived Forum Post

Index of archived forum posts

Question:

convert a CkString into a CkCert*

May 22 '13 at 10:47

Hi,,

I've used your "Extract Public/Private Keys and Certs from PFX into String Variables" function, to convert a digital certificate into a string to be passed in an SSL client/server application as follows:

CkString CLIENT::Convert_Cert_into_String(CkCert * certificate) { bool success; printf("%sn",certificate->subjectDN()); printf("---n");

CkString encodedCert;
encodedCert = certificate->getEncoded();
return encodedCert;

} And now I'm wondering, Is it possible to convert the CkString back into a CkCert* ? and how? Regards.

regards.


Answer

Look at the reference documentation. There are methods for exporting and loading from string formats. (http://www.chilkatsoft.com/refdoc/vcCkCertRef.html)