I am getting the error Warning: openssl_get_publickey() [function.openssl-get-publickey]: Don't know how to get public key from this private key on line 5 When trying to get a public key from a private key. Here is my PHP code:
<?php
$privatekeyorig = openssl_pkey_new();
openssl_pkey_export($privatekeyorig,$privatekey);
echo '<b>Private Key:</b> ' . $privatekey . '<br>';
$publickey = openssl_get_publickey($privatekeyorig);
echo '<b>Public Key:</b> ' . $publickey . '<br>';
?>
According to the PHP manual I am doing this correctly. Anyone spot an error? Help would be greatly appreciated!