I am using RSA_public_encrypt function to send the encrypted data to socket. I am reading the public key from .PEM file using "pkey = PEM_read_PUBKEY(f, NULL, NULL, NULL);" function. 'pkey' retrieved from above function is of type EVP_PKEY* which I can not use in function RSA_public_encrypt. (RSA_public_encrypt uses RSA* type key)
How to convert EVP_PKEY *pkey to RSA *rsa?