Doc #65176 [NEW]: openssl_pkey_new / openssl_pkey_get_public

From: Date: Mon, 01 Jul 2013 14:52:49 +0000
Subject: Doc #65176 [NEW]: openssl_pkey_new / openssl_pkey_get_public
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10033@lists.php.net to get a copy of this message
From: lynch@php.net Operating system: N/A PHP version: Irrelevant Package: OpenSSL related Bug Type: Documentation Problem Bug description:openssl_pkey_new / openssl_pkey_get_public Description: ------------ --- From manual page: http://www.php.net/function.openssl-pkey-new#refsect1-function.openssl-pkey-new-description --- The resulting resource cannot be used with openssl_pkey_get_public as stated. At least not always. Maybe that statement is only valid for some inputs for the config? If so, clarification is needed, preferably identifying the sorts of keys where the statement is applicable. See also: 25614 from 2009... Test script: --------------- $key_pair = openssl_pkey_new(array('digest_alg'=>'sha1', 'private_key_bits'=>1024, 'private_key_type'=>OPENSSL_KEYTYPE_RSA)); var_dump($key_pair); $public = openssl_pkey_get_public($key_pair); var_dump($public); Expected result: ---------------- resource (4) of type (OpenSSL key) Actual result: -------------- PHP Warning: openssl_pkey_get_public(): Don't know how to get public key from this private key in /var/www/vhost.d/zackstrade.dev/ib/keys/key_setup.php on line 8 PHP Stack trace: PHP 1. {main}() /var/www/vhost.d/zackstrade.dev/ib/keys/key_setup.php:0 PHP 2. openssl_pkey_get_public() /var/www/vhost.d/zackstrade.dev/ib/keys/key_setup.php:8 Warning: openssl_pkey_get_public(): Don't know how to get public key from this private key in /var/www/vhost.d/zackstrade.dev/ib/keys/key_setup.php on line 8 Call Stack: 0.0005 222672 1. {main}() /var/www/vhost.d/zackstrade.dev/ib/keys/key_setup.php:0 0.0466 223696 2. openssl_pkey_get_public() /var/www/vhost.d/zackstrade.dev/ib/keys/key_setup.php:8 -- Edit bug report at https://bugs.php.net/bug.php?id=65176&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65176&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65176&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65176&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65176&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65176&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65176&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65176&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65176&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65176&r=support Expected behavior: https://bugs.php.net/fix.php?id=65176&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65176&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65176&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65176&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65176&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65176&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65176&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65176&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65176&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65176&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65176&r=mysqlcfg

« previous php.doc.bugs (#10033) next »