openssl_pkey_new generates a new private key. How to obtain the public component of the key is shown in an example below.
You need to have a valid openssl.cnf installed for this function to operate correctly. See the notes under the installation section for more information.
You can finetune the key generation (such as specifying the number of bits) using options. See openssl_csr_new for more information about options.
Returns an OpenSSLAsymmetricKey instance for the pkey on success, or false on error.
|8.0.0||On success, this function returns an OpenSSLAsymmetricKey instance now; previously, a resource of type OpenSSL key was returned.|
|7.1.0||The curve_name option was added to make it possible to create EC keys.|