Req #77602 [NEW]: OpenSSL extension lacks PKCS#8 support
| From: | jonas at freesources dot org | Date: | Mon, 11 Feb 2019 10:22:48 +0000 |
| Subject: | Req #77602 [NEW]: OpenSSL extension lacks PKCS#8 support | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-219497@lists.php.net to get a copy of this message | ||
From: jonas at freesources dot org
Operating system: Linux
PHP version: 7.3.2
Package: OpenSSL related
Bug Type: Feature/Change Request
Bug description:OpenSSL extension lacks PKCS#8 support
Description:
------------
Hello,
the PHP openssl extension lacks support to export private keys in
PKCS#8[1] format. The function openssl_pkey_export()[2] only supports
one export format - the traditional PEM format. This is especially a
problem when maintaining keys for applications that accept only the
PKCS#8 format as input (like the Dovecot MailCrypt plugin[3])
The only PHP libraries I found with PKCS#8 support are phpseclib[4] and
SOP\pkcs8[5]. Unfortunately, both lack support for elliptic curve keys,
so they're not an option for me either.
The only option left to me, was to spawn a system call to
openssl pkey
just for the sake of migrating the traditional PEM key to PKCS#8
format.
[1] https://en.wikipedia.org/wiki/PKCS_8
[2] https://secure.php.net/manual/en/function.openssl-pkey-export.php
[3] https://wiki.dovecot.org/Plugins/MailCrypt#EC_key
[4] https://github.com/phpseclib/phpseclib
[5] https://github.com/sop/pkcs8
--
Edit bug report at https://bugs.php.net/bug.php?id=77602&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77602&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77602&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77602&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77602&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77602&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77602&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77602&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77602&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77602&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77602&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77602&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77602&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77602&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77602&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77602&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77602&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77602&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77602&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77602&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77602&r=mysqlcfg