如何在PHP中与兼容PKCS#11的HSM设备进行接口 [英] How to interface with PKCS#11 compliant HSM device in PHP

查看:95
本文介绍了如何在PHP中与兼容PKCS#11的HSM设备进行接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Linux服务器上运行的PHP应用程序中使用兼容PKCS#11的HSM的密钥材料(例如,SafeNet iKey 2032 [USB]或Aladdin eToken PRO [USB])?

How can I use key material from a PKCS#11 compliant HSM (for example a SafeNet iKey 2032 [USB] or a Aladdin eToken PRO [USB]) in PHP application running on a Linux server?

推荐答案

我还没有看到,也没有粗略的搜索到关于PHP的PCKS#11胶库.可能不是您要找的答案.(:如果您的搜寻条件比我更好,请更新此主题.

I have not seen, and a cursory search has not found, a PCKS#11 glue library for PHP. Probably not the answer you're looking for. (: If you have better search fu than I, do update this thread.

我认为您最好的选择是编写一个调用PKCS#11并访问HSM的C程序,然后从您的PHP应用程序将其作为外部二进制文件进行调用.即使为PHP出现了PKCS#11包装器,此方法也将为您提供C代码可用的完整API,而不必处理包装器作者满足其自身需求所需的任何工作.PKCS#11是一个大型API,包装器的实现通常不完整.

I think your best bet would be to write a C program that calls PKCS#11 and accesses the HSM, and call that from your PHP app as an external binary. Even if a PKCS#11 wrapper emerges for PHP, this approach will give you the full API available to the C code rather than having to make do with whatever the author of the wrapper needed to satisfy their own requirements. PKCS#11 is a large API, and wrapper implementations are often less than complete.

这篇关于如何在PHP中与兼容PKCS#11的HSM设备进行接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆