业务代码

function exportOpenSSLFile(){
$config = array(
"digest_alg" => "sha512",
"private_key_bits" => 4096, //字节数 512 1024 2048 4096 等
"private_key_type" => OPENSSL_KEYTYPE_RSA, //加密类型
);
$res = openssl_pkey_new($config);
if($res == false) return false;
openssl_pkey_export($res, $private_key);
$public_key = openssl_pkey_get_details($res);
$public_key = $public_key["key"];
file_put_contents("/conf/cert_public.key",$public_key);
file_put_contents("/conf/cert_private.pem",$private_key);
openssl_free_key($res);
}
exportOpenSSLFile();
返回值

PHP配置

请问是不是还需要配置什么才可以啊?
openssl.cnf
存在?