Archived Forum Post

Index of archived forum posts


convert a CkString into a CkCert*

May 22 '13 at 10:47


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.



Look at the reference documentation. There are methods for exporting and loading from string formats. (