> Dennis Xu wrote:
>
> Hi,
>
> I have a problem when I try load a private key from a PEM-format key
> file:
> The private key and certificate are both exported and converted from
> Verisign's free Personal ID (which is installed into IE 5).
> My load_key function is :
> .......
> static EVP_PKEY *load_key(char *key_file, int format)
> {
> BIO *key=NULL;
> EVP_PKEY *pkey=NULL;
>
> key=BIO_new(BIO_s_file());
> if (key == NULL)
> {
> ....
> }
> if (BIO_read_filename(key,key_file) <= 0)
> {
> ....
> }
> if (format == FORMAT_PEM)
> {
> pkey=PEM_read_bio_PrivateKey(key,NULL,NULL,NULL);
> }
> ...................
> if (key != NULL) BIO_free(key);
> return(pkey);
> }
> ......
>
> When it is called, pkey is always return NULL.
>
You are probably missing an SSLeay_add_all_algorithms() in there... that
reminds me we really should have an OpenSSL_add_all_algorithms() now :-)
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]