ENGINE based or a raw key, otherwise the duplication will fail.</p>

<p>EVP_PKEY_free() decrements the reference count of <i>key</i> and, if the reference count is zero, frees it up. If <i>key</i> is NULL, nothing is done.</p>

<p>EVP_PKEY_new_raw_private_key_ex() allocates a new <b>EVP_PKEY</b>. Unless an engine should be used for the key type, a provider for the key is found using the library context <i>libctx</i> and the property query string <i>propq</i>. The <i>keytype</i> argument indicates what kind 