Martin: I couldn't get your code to compile. However, I could get this to work:
#include <openssl/rsa.h> #include <stdio.h> int main() { // Do some init: RSA *oRsaKey = NULL; int iLength=2048; // Generate the key: oRsaKey = RSA_generate_key(iLength, 65537, NULL, NULL); // Write key to hard disk (for testing) FILE *oFile = fopen("MyKey.txt","w"); if (oFile!=0) { RSA_print_fp(oFile, oRsaKey, 0); fclose(oFile); } // Clean up: if (oRsaKey!=NULL) RSA_free(oRsaKey); } ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]