I tried this following code
// Create the keypair
$res=openssl_pkey_new();
// Get private key
openssl_pkey_export($res, $privatekey);
// Get public key
$publickey=openssl_pkey_get_details($res);
$publickey=$publickey["key"];
but i get this error
Warning: openssl_pkey_export(): cannot get key from parameter 1 in ... Warning: openssl_pkey_get_details() expects parameter 1 to be resource, boolean given in ...
I already uncomment extension=php_openssl.dll
my php.ini file. and openssl supported when i checked in phpinfo(). short of confused. i don't know how to fix this problem.