Warning: openssl_get_publickey() [function.openssl-get-publickey]: Don't know how to get public key from this private key on line 5
尝试从私钥获取公钥时出现错误。这是我的PHP代码:
<?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>';
?>
根据 PHP 手册,我这样做是正确的。有人发现错误吗?帮助将不胜感激!