>     I want to generate a rsa encrypted private key file using openssl
> commands,and then use the privkey file to retrieve the private key in
>  my c language program.
>     I tried the cmd:
>     1)openssl genrsa ¨Cpassout stdin -out key.pem

the '-des' option (or any other cipher is missing) => the output
is not encrypted.

>     and then input the -passout specific parm"12345",so got the key.pem
>  file.But the out file seems not a encrypted priv key file,I am puzzling
>  what is the usage of my input "12345"?
>     so I tried again:
>     2)openssl genrsa -des -out key2.pem
>     It prompted me to "Enter PEM pass phrase:",I gived "12345",and it
>  seems worked. Then I used the file key2.pem in my program as follows:
>
>     char * passin = "12345";
>     EVP_PKEY *pkey = NULL;
>     pkey=PEM_read_bio_PrivateKey(in,pkey,0,passin);//in is key2.pemfile bio
>
>     but it dosen't work at all, pkey is NULL in the end.

What error message do you get ?

Regards,
Nils
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to