title: How to do RSA public key encryption using OpenSSL EVP routines?
body: <p>I am using the <a href="https://www.openssl.org/docs/man1.1.0/crypto/EVP_EncryptInit.html" rel="nofollow noreferrer">EVP high-level functions in OpenSSL</a>. I haven't found any examples online showing how to use these functions (e.g. <code>EVP_EncryptInit_ex()</code>, <code>EVP_EncryptUpdate()</code>, <code>EVP_EncryptFinal_ex()</code>) to encrypt data using an RSA public key. Specifically, I do not see a <code>EVP_CIPHER</code> type that matches RSA, similar to what you see for AES like: <code>const EVP_CIPHER *EVP_aes_128_cbc(void);</code> in <code>evp.h</code>. I think one for RSA is required to initialize EVP for encryption using that method.</p>
  
  <p>Can anyone help me understand how to use an RSA existing key to encrypt data using OpenSSL's EVP routines? Examples would be <em>extremely</em> helpful.</p>