I need to extract the RSA public key from a RSA private key using OpenSSL.
I'm currently using
$ openssl rsa -in private.pem -pubout > public.pem
I managed to make this work using
PEM_write_bio_RSA_PUBKEY() to write the PEM data to a in-memory buffer, then using
PEM_read_bio_RSA_PUBKEY() to get a new
Now the generated public key can be used ;)