I have a C program. Within it, I would like to embed either a file or a pre-assigned variable. I would prefer a method that is platform independent.

I am using the data type "RSA" from <openssl/rsa.h>. I have a key file in PEM format, but I would like to embed an RSA object in the program instead. I tried creating a char array and then casting the pointer, but that caused some sort of illegal casting issue. I tried using memcpy but I haven't been able to get it working that way. What is the best way of going about this? Is it possible to read a file directly from a memory buffer?