ÑŠÔŽ
2002-11-18 07:23:20 UTC
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
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.
How can I get the right private key from my key2.pem?
best regards!
xue yuan
________________
USTC Alumni Email System, http://mail.ustc.edu, FREE Signup.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
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
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.
How can I get the right private key from my key2.pem?
best regards!
xue yuan
________________
USTC Alumni Email System, http://mail.ustc.edu, FREE Signup.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org