Re: Sorry, but I can't read encrypted RSA key from file

2003-09-10 Thread Alexander Krizhanovskiy
> http://www.openssl.org/support/faq.html#PROG5 > http://www.openssl.org/support/faq.html#PROG6 > http://www.openssl.org/support/faq.html#PROG7 It realy helped. Before that I didn't understand my bug. Thanks. __ OpenSSL Project

Re: Sorry, but I can't read encrypted RSA key from file

2003-09-10 Thread Dr. Stephen Henson
On Wed, Sep 10, 2003, Alexander Krizhanovskiy wrote: > Thanks, > > This is correct code: > > char *passwd = "123456"; > FILE F1 = fopen("key.pem", "wb"); > PEM_write_RSAPrivateKey(F1, rsa, EVP_des_cbc(), NULL, 0, NULL, passwd); > fclose(F1); > . > FILE F2 = fopen("key.pem", "rb"); > RSA *rsa

Re: Sorry, but I can't read encrypted RSA key from file

2003-09-10 Thread Alexander Krizhanovskiy
Thanks, This is correct code: char *passwd = "123456"; FILE F1 = fopen("key.pem", "wb"); PEM_write_RSAPrivateKey(F1, rsa, EVP_des_cbc(), NULL, 0, NULL, passwd); fclose(F1); . FILE F2 = fopen("key.pem", "rb"); RSA *rsa_2; rsa_2 = PEM_read_RSAPrivateKey(F2, NULL, NULL, passwd); char str[256];

Re: Sorry, but I can't read encrypted RSA key from file

2003-09-08 Thread Dr. Stephen Henson
On Mon, Sep 08, 2003, Alexander Krizhanovskiy wrote: > Hello, > > I know that this theme discussed a lot. > > I have a code: > > char *passwd = "123456"; > FILE F1 = fopen("key.pem", "wb"); > PEM_write_RSAPrivateKey(F1, rsa, EVP_des_cbc(), NULL, 0, NULL, passwd); > fclose(F1); > . > FILE F2

Sorry, but I can't read encrypted RSA key from file

2003-09-08 Thread Alexander Krizhanovskiy
Hello, I know that this theme discussed a lot. I have a code: char *passwd = "123456"; FILE F1 = fopen("key.pem", "wb"); PEM_write_RSAPrivateKey(F1, rsa, EVP_des_cbc(), NULL, 0, NULL, passwd); fclose(F1); . FILE F2 = fopen("key.pem", "rb"); RSA *rsa_2 = RSA_new(); rsa_2 = PEM_read_RSAPrivate