I am working on OpenSSL in Windows 8.1, Wamp Apache Version: 2.4.9 PHP Version: 5.5.12. And I ended up with the following error:
My PHP code is given below. WAMP is unable to generate private key.
$privateKey = openssl_pkey_new(array(
'private_key_bits' => 384, // Size of Key.
'private_key_type' => OPENSSL_KEYTYPE_RSA,
));
openssl_pkey_export($privateKey, $privKey, null, ['config' => 'C:/wamp/bin/apache/apache2.4.9/conf/openssl.cnf']);
$a_key = openssl_pkey_get_details($privateKey);
file_put_contents('keys/'.$username.'_public.key', $a_key['key']);
file_put_contents('keys/'.$username.'_private.key', $privKey);
openssl_free_key($privateKey);
Can anyone please help me in running OpenSSL in Windows. Thanks in advance.