On Mon, Aug 14, 2006, [EMAIL PROTECTED] wrote:

> Hello openssl-users,
> 
>   I generate an RSA key-pair like this:
>   openssl genrsa 1024
>   And put it's output into a PEM file.
>   Now I need to read both private and public parts of the key-pair
>   into an RSA object in a program.
> 
>   This is how I try handling the PEM:
> 
>         fp = fopen( priv_exp, "rb" );
>         if( NULL == fp )
>         {
>                 printf( "file not found '%s'\n", priv_exp );
>                 exit( EXIT_FAILURE );
>         }
> 
>         ca_rsa = PEM_read_RSAPrivateKey( fp, NULL, NULL, NULL );
>         if( NULL == ca_rsa )
>         {
>                 printf( "Failed\n" );
>                 exit( EXIT_FAILURE );
>         }
> 
> 
>   If the key is unprotected - this works, if the key is protected - it
>   fails. The book tells about some "default password callback
>   function", which should be called if the third and fourth parameters
>   are NULL.
>   I do not see any pass phrase promtps. Why?
> 

Try the FAQ...

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to