如何在 OpenSSL 中制作证书以与 php 一起使用?
最近,我决定为我的 php 商店添加 Banklink 付款选项,在阅读实施规范后,一切似乎都正常,但有一点。所有公钥(证书)交换均采用X509格式。现在,最后一个是什么意思?它与常规密码保护的 .pem 文件有何不同? 另外,对于常规密码保护的 .pem 文件,我无法使用由 openssl_sign()
函数签名的 openssl_verify()
等 php 函数。
我可以在这里得到一些建议吗,因为提供这种付款方式的银行对此的信息很少,而且我对此完全陌生。
所以我在这里需要做的例程是为他们生成 request.pem 并将其发送给他们。之后他们会签署它或我不知道的任何东西,我应该能够在我的应用程序中使用它。
请告诉我我的信息是否不够,因为正如我所说,我对证书或 openssl 知之甚少。
Recently i decided to add banklink payment option for my php store and after reading specifications of implementation everything seems okey, but the 1 point of it. All public key(certificates) exchange are in X509 format. Now what does that last one mean and how it's different from regular password protected .pem file?
Also with regular password protected .pem file i cannot use php function like openssl_verify()
signed by openssl_sign()
function.
Could i get some advice here please since the bank that offering this payment method has very little information on this and im totally newb to this.
So the routine i need to do here is generate request.pem for them and send it to them. After that they will sign it or whatever i dunno and i should be able to use it in my application.
Please, tell me if my information is not enough because as i told i don't know much when in comes to certificates or openssl.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
PEM 文件包含加密和 Base64 编码的“原始”证书/私钥值,因此使用 PEM 的函数也应该使用原始证书。 OpenSSL 应该能够从一种格式转换为另一种格式。
PEM file contains encrypted and base64-encoded 'raw' certificate/private key value, so functions that work with PEM should also work with raw certificates. OpenSSL should be able to convert from one format to another.
您必须使用
curl
概念。You have to use
curl
concept.老实说,PHP 中的 OpenSSL 功能很糟糕。你最好的选择是选择一个很棒的包,比如 phpseclib。
Honestly, the OpenSSL capabilities in PHP are abysmal. Your best bet is to go for an awesome package like phpseclib.
很久以前我也在做类似的事情。不同的是他们只是给了我 pem 文件,我用它来连接到他们的服务器。
下面我为大家写下我的猜测。 :)
long time ago i was doing something similar. The difference is they just gave me the pem file, and i used it to connect to their server.
Below I wrote my guiessing for you. :)