php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77602 OpenSSL extension lacks PKCS#8 support
Submitted: 2019-02-11 10:22 UTC Modified: -
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jonas at freesources dot org Assigned:
Status: Open Package: OpenSSL related
PHP Version: 7.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jonas at freesources dot org
New email:
PHP Version: OS:

 

 [2019-02-11 10:22 UTC] jonas at freesources dot org
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 25 00:01:26 2019 UTC