Would it be possible to embed the private and public key for a simple server application into it through the C/C++ APIs? Preferably without hacking the entire OpenSSL library first.
And by embed I mean by passing either something like a string or a char* to the API instead of reading directly from a file.
Thanks.
You can use the
d2i_X509()function to directly convert a DER-encoded certificate from anunsigned char *buffer into an X509 object:There are similar
d2i_*()functions for other OpenSSL objects, like keys – eg.d2i_RSAPrivateKey().