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?

  Please comment.

  Thank you in advance.

-- 
Best regards,
 Tony                   mailto:[EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to