[openssl-users] NULL EVP_PKEY
Vollaro, John
john.vollaro at optum.com
Mon Apr 20 21:10:10 UTC 2015
I am having a problem reading a password protected private key file (.pem) using the OpenSSL library (programmatically).
I just get a NULL key returned.
I am using the OpenSSL 1.0.2a 19 Mar 2015 library in a Windows environment.
The code snippet as follows:
char *pemFileName = "C:\\Work\\mypemfile.pem";
char passwordBuffer[12];
strcpy(passwordBuffer, "pwd1234");
OpenSSL_add_all_algorithms();
BIO *bio_key = BIO_new( BIO_s_file() );
BIO_read_filename( bio_key, pemFileName );
EVP_PKEY *sigkey = PEM_read_bio_PrivateKey( bio_key, NULL, NULL,(void *)passwordBuffer );
pemFileName is the (correct) path to the private key file.
I did read that calling OpenSSL_add_all_algorithms() loads OpenSSL's table of algorithms and was a fix to this issue.
In my case it has not helped.
Thanks for any help in soliving this issue.
John Vollaro
Phone 860.221.0129
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150420/25787121/attachment.html>
More information about the openssl-users
mailing list