On Mon, Jul 27, 2009, Neil Dugan wrote:
> Hi,
>
> I have been trying to read the keys generated by "openssl genrsa ..." and
> "openssl rsa -pubout ..." commands.
>
> I successfully (according to the return code) read the private key with
>
> if (in = BIO_new_file("rsakey.pem", "r")) {
> int ok;
> printf ("Created private BIO\n");
> ok = (PEM_read_bio_RSAPrivateKey(in, &rsa, NULL, NULL) != NULL);
> printf ("ok = %s\n", (ok != 0) ? "true":"false");
> BIO_free(in);
> }
>
> but the similar code using PEM_read_bio_RSAPublicKey() doesn't want to
> work.
>
Use PEM_read_bio_RSA_PUBKEY() instead.
Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [email protected]