Bug #62349 [NEW]: openssl_get_publickey does not support private keys as docs imply

From: Date: Mon, 18 Jun 2012 04:29:54 +0000
Subject: Bug #62349 [NEW]: openssl_get_publickey does not support private keys as docs imply
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8477@lists.php.net to get a copy of this message
From: terrafrost@php.net Operating system: Windows 7 PHP version: 5.4.4 Package: Documentation problem Bug Type: Bug Bug description:openssl_get_publickey does not support private keys as docs imply Description: ------------ Trying to load a private key with openssl_get_publickey yields an error when it in fact shouldn't. Test script: --------------- <?php openssl_get_publickey('-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQCDGCwMqcI6b0VUr7cMH+Rm+cwlPvkpCUJZu4Ntk1aUc76xYtem+/R29CsyQaiw GYGsnsw70BFSgbz7Pdv5R5q6SleuMxrLxvPDxoWW5M1pl1jGE0sV9dmNXWJm2VhMzdnLoLGFFSi5 03Og8nLobFsbkytd8uKZ0ZT6TALI67HlBQIDAQABAoGAG7IAIF6+22SFk6oZtFSKhtzQLbA7qFk9 7MIqNnyRpoQ7bbNRlwQUtgrIk3H+ptGErUjRIfPHrRQerj932RaxD8eXZ4oBKuGjwsHt+hsh+x6F Z1rV9q2qXZCDz+CSaEBCdwBv1yPJyEBKhINqN+p2slWDU3bpz1IaJFzyIlQnn3MCQQCDn7D8G1vG N+jTmrWPFvNKMeNwcycAzJhobPenB4S8G8CW7ESC1dzHLorchuV1znwif/gxcK7kTcdoBPou/eyD AkEA/vhsbFZCH8QouPm6EdzqiYegQz7bPqhU0bqQoNB5n5eBcG24ZGDJGJtYOYnE9Ez8G1+P6GqV CMhGxlMdP6FB1wJAQj2dvmKuXyVIASY89RQhwFc3FSJ+oIJWuUcNo3u/K0P0OoARQp8Kixs7OxyQ YidWha5NY+RHwBH8prbKide0rQJAFddWAlnJREtbaa0KwWj5NlrF4bzKry1gRq8CoKP7Jy6lSeo8 N20LDO6RuiwRERRfLEEdZL1sktoFJgwMn1zC9QJAJumaEF/b86FFQfRrAhc7vOWHUcwXs98P2Y9u /JpqhdQYz/41GMhW2pOSp2FmOGNlJxHE0JS+0tbu5mOrSzo6/w== -----END RSA PRIVATE KEY-----'); echo openssl_error_string(); Expected result: ---------------- I wouldn't expect there to be any output. Actual result: -------------- "error:0906D06C:PEM routines:PEM_read_bio:no start line" is the output. -- Edit bug report at https://bugs.php.net/bug.php?id=62349&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62349&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62349&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62349&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62349&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62349&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62349&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62349&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62349&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62349&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62349&r=support Expected behavior: https://bugs.php.net/fix.php?id=62349&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62349&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62349&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62349&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62349&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62349&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62349&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62349&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62349&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62349&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62349&r=mysqlcfg

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