It works fine with a code similar to this:

  EVP_PKEY *key;
  BIO *bio;
  char *file;
  //Init file with the appropriate path to the private key file.
  char *password;
  //Init the password.

  bio = BIO_new( BIO_s_file() );
  BIO_read_filename( bio, file );
  key  = PEM_read_bio_PrivateKey( bio, NULL, NULL, password );

Note that I am not providing a password callback and that I am using the bio
version of the PEM_read_PrivateKey.
I hope it helps.

Marc-Andre

-----Original Message-----
From: Roberto Rodrigues - McLean [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 4:55 PM
To: '[EMAIL PROTECTED]'
Subject: PEM_read_PrivateKey() wont work on Windows (visual)


hi,

I basically copied the code from sign.c, I call it like this:
PEM_read_PrivateKey(fp, NULL, pass_cb, password);

it crashes complaining about memory access.

Has anyone make it work on Windows ? Is there any other way of loading a
Private Key from a file (into a EVP obj) ?

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

Reply via email to