有没有办法在 PHP 中通过 OpenSSL 生成私钥openssl-pkey-新 http://php.net/manual/en/function.openssl-pkey-new.php在 RSA 和 PKCS1 中?
如果您的意思是带有 BEGIN RSA PRIVATE KEY 标头的私钥,那么 PHP 中存在一个问题,没有简单的解决方案。基本上,使用 OpenSSL 1.0+ 编译的 PHP 会生成 PKCS#8 PEM 格式的私钥,但似乎无法再以 PKCS#1 格式生成它(至少我无法找到解决方案)。
https://bugs.php.net/bug.php?id=53850 https://bugs.php.net/bug.php?id=53850
为什么Linux和Windows下的私钥字符串不同? https://stackoverflow.com/questions/9678202/why-different-private-key-strings-under-linux-or-windows
还有一个图书馆叫phpseclib https://github.com/phpseclib/phpseclib那应该可以做到。 (但我没有个人经验)。
http://phpseclib.sourceforge.net/rsa/examples.html#create,pkcs1,pkcs1pub,sign1,enc1, http://phpseclib.sourceforge.net/rsa/examples.html#create,pkcs1,pkcs1pub,sign1,enc1,
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)