I use VS2005 to create a private RSA key. But I always get the error from the 
file setmode.c  line 58: Expression: (_osfile(fh)&FOPEN) --Debug assertion 
failed


    RSA *r =NULL;
    int bits=512;
    unsigned long e=RSA_3;
    FILE *privateKeyFile;
r=RSA_generate_key(bits,e,NULL,NULL);
fopen_s(&privateKeyFile,"Privatekey", "w"); //privateKeyFile = 
fopen("Privatekey", "w");
PEM_write_RSAPrivateKey(privateKeyFile, r,NULL,NULL, 0,NULL, NULL); 

The error comes from the function PEM_write_RSAPrivateKey().

Please help me!

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Reply via email to